( command, appCommandPrefix = DEFAULTS.appCommandPrefix, )
| 90 | } |
| 91 | |
| 92 | export function classifyProcess( |
| 93 | command, |
| 94 | appCommandPrefix = DEFAULTS.appCommandPrefix, |
| 95 | ) { |
| 96 | if ( |
| 97 | command.startsWith( |
| 98 | "/System/Library/PrivateFrameworks/SkyLight.framework/Resources/WindowServer", |
| 99 | ) |
| 100 | ) { |
| 101 | return { |
| 102 | group: "system", |
| 103 | kind: "window-server", |
| 104 | label: "windowserver", |
| 105 | }; |
| 106 | } |
| 107 | |
| 108 | if (command === appCommandPrefix) { |
| 109 | return { group: "cap", kind: "cap-main", label: "cap-main" }; |
| 110 | } |
| 111 | |
| 112 | if (command.startsWith(`${appCommandPrefix} --crash-reporter-server=`)) { |
| 113 | return { group: "cap", kind: "cap-crash", label: "cap-crash" }; |
| 114 | } |
| 115 | |
| 116 | if (command.includes("com.apple.WebKit.GPU.xpc")) { |
| 117 | return { group: "cap", kind: "webkit-gpu", label: "wk-gpu" }; |
| 118 | } |
| 119 | |
| 120 | if (command.includes("com.apple.WebKit.Networking.xpc")) { |
| 121 | return { group: "cap", kind: "webkit-networking", label: "wk-net" }; |
| 122 | } |
| 123 | |
| 124 | if (command.includes("com.apple.WebKit.WebContent.xpc")) { |
| 125 | return { group: "cap", kind: "webkit-webcontent", label: "wk-webcontent" }; |
| 126 | } |
| 127 | |
| 128 | for (const [label, pattern] of MEDIA_PROCESS_PATTERNS) { |
| 129 | if (pattern.test(command)) { |
| 130 | return { group: "media", kind: label, label }; |
| 131 | } |
| 132 | } |
| 133 | |
| 134 | return null; |
| 135 | } |
| 136 | |
| 137 | export function findCapMainProcess( |
| 138 | processes, |
no outgoing calls
no test coverage detected