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