OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 [ | 5 [ |
6 { | 6 { |
7 "namespace": "experimental.processes", | 7 "namespace": "experimental.processes", |
8 "nodoc": true, | |
9 "types": [ | 8 "types": [ |
10 { | 9 { |
11 "id": "Process", | 10 "id": "Process", |
12 "type": "object", | 11 "type": "object", |
13 "description": "An object containing information about one of the browse
r's processes.", | 12 "description": "An object containing information about one of the browse
r's processes.", |
14 "properties": { | 13 "properties": { |
15 "id": { | 14 "id": { |
16 "type": "integer", | 15 "type": "integer", |
| 16 "description": "Unique ID of the process provided by the browser." |
| 17 }, |
| 18 "osProcessId": { |
| 19 "type": "integer", |
17 "description": "The ID of the process, as provided by the OS." | 20 "description": "The ID of the process, as provided by the OS." |
18 }, | 21 }, |
19 "type": { | 22 "type": { |
20 "type": "string", | 23 "type": "string", |
21 "enum": ["browser", "renderer", "extension", "notification", "plugin
", "worker", "nacl", "utility", "gpu", "other"], | 24 "enum": ["browser", "renderer", "extension", "notification", "plugin
", "worker", "nacl", "utility", "gpu", "other"], |
22 "description": "The type of process." | 25 "description": "The type of process." |
23 }, | 26 }, |
| 27 "profile": { |
| 28 "type": "string", |
| 29 "description": "The profile which the process is associated with." |
| 30 }, |
| 31 "tabs": { |
| 32 "type": "array", "items": {"type": "integer", "minimum": 0}, |
| 33 "description": "Array of Tab IDs that have a page rendered by this p
rocess. The list will be non-empty for renderer processes only." |
| 34 }, |
24 "cpu": { | 35 "cpu": { |
25 "type": "number", | 36 "type": "number", |
26 "description": "The most recent measurement of the process's CPU usa
ge, between 0 and 100%." | 37 "optional": true, |
| 38 "description": "The most recent measurement of the process CPU usage
, between 0 and 100%. Only available when receiving the object as part of a call
back from onUpdated or onUpdatedWithMemory." |
27 }, | 39 }, |
28 "network": { | 40 "network": { |
29 "type": "number", | 41 "type": "number", |
30 "description": "The most recent measurement of the process's network
usage, in bytes per second." | 42 "optional": true, |
| 43 "description": "The most recent measurement of the process network u
sage, in bytes per second. Only available when receiving the object as part of a
callback from onUpdated or onUpdatedWithMemory." |
31 }, | 44 }, |
32 "privateMemory": { | 45 "privateMemory": { |
33 "type": "number", | 46 "type": "number", |
34 "description": "The most recent measurement of the process's private
memory usage, in bytes." | 47 "optional": true, |
| 48 "description": "The most recent measurement of the process private m
emory usage, in bytes. Only available when receiving the object as part of a cal
lback from onUpdatedWithMemory or getProcessInfo with the includeMemory flag." |
35 }, | 49 }, |
36 "sharedMemory": { | 50 "jsMemoryAllocated": { |
37 "type": "number", | 51 "type": "number", |
38 "description": "The most recent measurement of the process's shared
memory usage, in bytes." | 52 "optional": true, |
| 53 "description": "The most recent measurement of the process JavaScrip
t allocated memory, in bytes. Only available when receiving the object as part o
f a callback from onUpdated or onUpdatedWithMemory." |
| 54 }, |
| 55 "jsMemoryUsed": { |
| 56 "type": "number", |
| 57 "optional": true, |
| 58 "description": "The most recent measurement of the process JavaScrip
t memory used, in bytes. Only available when receiving the object as part of a c
allback from onUpdated or onUpdatedWithMemory." |
| 59 }, |
| 60 "sqliteMemory": { |
| 61 "type": "number", |
| 62 "optional": true, |
| 63 "description": "The most recent measurement of the process’s SQLite
memory usage, in bytes. Only available when receiving the object as part of a ca
llback from onUpdated or onUpdatedWithMemory." |
| 64 }, |
| 65 "fps": { |
| 66 "type": "number", |
| 67 "optional": true, |
| 68 "description": "The most recent measurement of the process frames pe
r second. Only available when receiving the object as part of a callback from on
Updated or onUpdatedWithMemory." |
| 69 }, |
| 70 "imageCache": { |
| 71 "$ref": "Cache", |
| 72 "optional": true, |
| 73 "description": "The most recent information about the image cache fo
r the process. Only available when receiving the object as part of a callback fr
om onUpdated or onUpdatedWithMemory." |
| 74 }, |
| 75 "scriptCache": { |
| 76 "$ref": "Cache", |
| 77 "optional": true, |
| 78 "description": "The most recent information about the script cache f
or the process. Only available when receiving the object as part of a callback f
rom onUpdated or onUpdatedWithMemory." |
| 79 }, |
| 80 "cssCache": { |
| 81 "$ref": "Cache", |
| 82 "optional": true, |
| 83 "description": "The most recent information about the CSS cache for
the process. Only available when receiving the object as part of a callback from
onUpdated or onUpdatedWithMemory." |
| 84 } |
| 85 } |
| 86 }, |
| 87 { |
| 88 "id": "Cache", |
| 89 "type": "object", |
| 90 "description": "The Cache object contains information about the size and
utilization of a cache used by the browser.", |
| 91 "properties": { |
| 92 "size": { |
| 93 "type": "number", |
| 94 "description": "The size of the cache, in bytes." |
| 95 }, |
| 96 "liveSize": { |
| 97 "type": "number", |
| 98 "description": "The part of the cache that is utilized, in bytes." |
39 } | 99 } |
40 } | 100 } |
41 } | 101 } |
42 ], | 102 ], |
43 "functions": [ | 103 "functions": [ |
44 { | 104 { |
| 105 "name": "terminate", |
| 106 "type": "function", |
| 107 "description": "Terminates the specified renderer process. Equivalent to
visiting about:crash, but without changing the tab's URL.", |
| 108 "parameters": [ |
| 109 { |
| 110 "name": "processId", |
| 111 "type": "integer", |
| 112 "minimum": 0, |
| 113 "description": "The ID of the process to be terminated." |
| 114 }, |
| 115 { |
| 116 "name": "callback", |
| 117 "type": "function", |
| 118 "optional": true, |
| 119 "parameters": [ |
| 120 { |
| 121 "name": "didTerminate", |
| 122 "type": "boolean", |
| 123 "description": "True if terminating the process was successful,
otherwise false." |
| 124 } |
| 125 ] |
| 126 } |
| 127 ] |
| 128 }, |
| 129 { |
45 "name": "getProcessIdForTab", | 130 "name": "getProcessIdForTab", |
46 "type": "function", | 131 "type": "function", |
47 "description": "Returns the ID of the renderer process for the specified
tab.", | 132 "description": "Returns the ID of the renderer process for the specified
tab.", |
48 "parameters": [ | 133 "parameters": [ |
49 { | 134 { |
50 "name": "tabId", | 135 "name": "tabId", |
51 "type": "integer", | 136 "type": "integer", |
52 "minimum": 0 | 137 "minimum": 0, |
| 138 "description": "The ID of the tab for which the renderer process ID
is to be returned." |
53 }, | 139 }, |
54 { | 140 { |
| 141 "name": "callback", |
55 "type": "function", | 142 "type": "function", |
56 "name": "callback", | |
57 "parameters": [ | 143 "parameters": [ |
58 { | 144 { |
59 "name": "processId", | 145 "name": "processId", |
60 "type": "integer", | 146 "type": "integer", |
61 "description": "Process ID of the tab's renderer process." | 147 "description": "Process ID of the tab's renderer process." |
62 } | 148 } |
63 ] | 149 ] |
64 } | 150 } |
65 ] | 151 ] |
| 152 }, |
| 153 { |
| 154 "name": "getProcessInfo", |
| 155 "type": "function", |
| 156 "description": "Retrieves the process information for each process ID sp
ecified.", |
| 157 "parameters": [ |
| 158 { |
| 159 "name": "processIds", |
| 160 "choices": [ |
| 161 {"type": "integer", "minimum": 0}, |
| 162 {"type": "array", "items": {"type": "integer", "minimum": 0}} |
| 163 ], |
| 164 "description": "The list of process IDs or single process ID for whi
ch to return the process information. An empty list indicates all processes are
requested." |
| 165 }, |
| 166 { |
| 167 "name": "includeMemory", |
| 168 "type": "boolean", |
| 169 "description": "True if detailed memory usage is required. Note, col
lecting memory usage information incurs extra CPU usage and should only be queri
ed for when needed." |
| 170 }, |
| 171 { |
| 172 "name": "callback", |
| 173 "type": "function", |
| 174 "description": "Called when the processes information is collected."
, |
| 175 "parameters": [ |
| 176 { |
| 177 "name": "processes", |
| 178 "description": "A dictionary of Process objects for each request
ed process that is a live child process of the current browser process, indexed
by process ID. Metrics requiring aggregation over time will not be populated in
each Process object.", |
| 179 "type": "object", |
| 180 "additionalProperties": { "$ref": "Process" } |
| 181 } |
| 182 ] |
| 183 } |
| 184 ] |
66 } | 185 } |
67 ], | 186 ], |
68 "events": [ | 187 "events": [ |
69 { | 188 { |
70 "name": "onUpdated", | 189 "name": "onUpdated", |
71 "type": "function", | 190 "type": "function", |
72 "description": "Fired each time the Task Manager updates its process sta
tistics, providing the dictionary of updated Process objects, indexed by process
ID.", | 191 "description": "Fired each time the Task Manager updates its process sta
tistics, providing the dictionary of updated Process objects, indexed by process
ID.", |
73 "parameters": [ | 192 "parameters": [ |
74 { | 193 { |
75 "name": "processes", | 194 "name": "processes", |
76 "type": "object", | 195 "type": "object", |
| 196 "description": "A dictionary of updated Process objects for each liv
e process in the browser, indexed by process ID. Metrics requiring aggregation
over time will be populated in each Process object.", |
77 "additionalProperties": { "$ref": "Process" } | 197 "additionalProperties": { "$ref": "Process" } |
78 } | 198 } |
79 ] | 199 ] |
| 200 }, |
| 201 { |
| 202 "name": "onUpdatedWithMemory", |
| 203 "type": "function", |
| 204 "description": "Fired each time the Task Manager updates its process sta
tistics, providing the dictionary of updated Process objects, indexed by process
ID. Identical to onUpdate, with the addition of memory usage details included i
n each Process object. Note, collecting memory usage information incurs extra CP
U usage and should only be listened for when needed.", |
| 205 "parameters": [ |
| 206 { |
| 207 "name": "processes", |
| 208 "type": "object", |
| 209 "description": "A dictionary of updated Process objects for each liv
e process in the browser, indexed by process ID. Memory usage details will be i
ncluded in each Process object.", |
| 210 "additionalProperties": { "$ref": "Process" } |
| 211 } |
| 212 ] |
| 213 }, |
| 214 { |
| 215 "name": "onCreated", |
| 216 "type": "function", |
| 217 "description": "Fired each time a process is created, providing the corr
seponding Process object.", |
| 218 "parameters": [ |
| 219 { |
| 220 "name": "process", |
| 221 "description": "Details of the process that was created. Metrics req
uiring aggregation over time will not be populated in the object.", |
| 222 "$ref": "Process" |
| 223 } |
| 224 ] |
| 225 }, |
| 226 { |
| 227 "name": "onUnresponsive", |
| 228 "type": "function", |
| 229 "description": "Fired each time a process becomes unresponsive, providin
g the corrseponding Process object.", |
| 230 "parameters": [ |
| 231 { |
| 232 "name": "process", |
| 233 "description": "Details of the unresponsive process. Metrics requiri
ng aggregation over time will not be populated in the object. Only available for
renderer processes.", |
| 234 "$ref": "Process" |
| 235 } |
| 236 ] |
| 237 }, |
| 238 { |
| 239 "name": "onExited", |
| 240 "type": "function", |
| 241 "description": "Fired each time a process is terminated, providing the t
ype of exit.", |
| 242 "parameters": [ |
| 243 { |
| 244 "name": "processId", |
| 245 "description": "The ID of the process that exited.", |
| 246 "type": "integer" |
| 247 }, |
| 248 { |
| 249 "name": "exitType", |
| 250 "description": "The type of exit that occurred for the process - nor
mal, abnormal, killed, crashed. Only available for renderer processes.", |
| 251 "type": "integer" |
| 252 }, |
| 253 { |
| 254 "name": "exitCode", |
| 255 "description": "The exit code if the process exited abnormally. Only
available for renderer processes.", |
| 256 "type": "integer" |
| 257 } |
| 258 ] |
80 } | 259 } |
81 ] | 260 ] |
82 } | 261 } |
83 ] | 262 ] |
OLD | NEW |