summaryrefslogtreecommitdiffstats
path: root/chrome/common/extensions/api/experimental_processes.json
blob: 9bb76331763d4be0d2d55d6e5babb0f0e41dfa19 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

[
  {
    "namespace": "experimental.processes",
    "description": "Use the <code>chrome.experimental.processes</code> API to interact with the browser's processes.",
    "types": [
      {
        "id": "Process",
        "type": "object",
        "description": "An object containing information about one of the browser's processes.",
        "properties": {
          "id": {
            "type": "integer",
            "description": "Unique ID of the process provided by the browser."
          },
          "osProcessId": {
            "type": "integer",
            "description": "The ID of the process, as provided by the OS."
          },
          "type": {
            "type": "string",
            "enum": ["browser", "renderer", "extension", "notification", "plugin", "worker", "nacl", "utility", "gpu", "other"],
            "description": "The type of process."
          },
          "profile": {
            "type": "string",
            "description": "The profile which the process is associated with."
          },
          "tabs": {
            "type": "array",  "items": {"type": "integer", "minimum": 0},
            "description": "Array of Tab IDs that have a page rendered by this process. The list will be non-empty for renderer processes only."
          },
          "cpu": {
            "type": "number",
            "optional": true,
            "description": "The most recent measurement of the process CPU usage, between 0 and 100%. Only available when receiving the object as part of a callback from onUpdated or onUpdatedWithMemory."
          },
          "network": {
            "type": "number",
            "optional": true,
            "description": "The most recent measurement of the process network usage, in bytes per second. Only available when receiving the object as part of a callback from onUpdated or onUpdatedWithMemory."
          },
          "privateMemory": {
            "type": "number",
            "optional": true,
            "description": "The most recent measurement of the process private memory usage, in bytes. Only available when receiving the object as part of a callback from onUpdatedWithMemory or getProcessInfo with the includeMemory flag."
          },
          "jsMemoryAllocated": {
            "type": "number",
            "optional": true,
            "description": "The most recent measurement of the process JavaScript allocated memory, in bytes. Only available when receiving the object as part of a callback from onUpdated or onUpdatedWithMemory."
          },
          "jsMemoryUsed": {
            "type": "number",
            "optional": true,
            "description": "The most recent measurement of the process JavaScript memory used, in bytes. Only available when receiving the object as part of a callback from onUpdated or onUpdatedWithMemory."
          },
          "sqliteMemory": {
            "type": "number",
            "optional": true,
            "description": "The most recent measurement of the process’s SQLite memory usage, in bytes. Only available when receiving the object as part of a callback from onUpdated or onUpdatedWithMemory."
          },
          "fps": {
            "type": "number",
            "optional": true,
            "description": "The most recent measurement of the process frames per second. Only available when receiving the object as part of a callback from onUpdated or onUpdatedWithMemory."
          },
          "imageCache": {
            "$ref": "Cache",
            "optional": true,
            "description": "The most recent information about the image cache for the process. Only available when receiving the object as part of a callback from onUpdated or onUpdatedWithMemory."
          },
          "scriptCache": {
            "$ref": "Cache",
            "optional": true,
            "description": "The most recent information about the script cache for the process. Only available when receiving the object as part of a callback from onUpdated or onUpdatedWithMemory."
          },
          "cssCache": {
            "$ref": "Cache",
            "optional": true,
            "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."
          }
        }
      },
      {
        "id": "Cache",
        "type": "object",
        "description": "The Cache object contains information about the size and utilization of a cache used by the browser.",
        "properties": {
          "size": {
            "type": "number",
            "description": "The size of the cache, in bytes."
          },
          "liveSize": {
            "type": "number",
            "description": "The part of the cache that is utilized, in bytes."
          }
        }
      }
    ],
    "functions": [
      {
        "name": "terminate",
        "type": "function",
        "description": "Terminates the specified renderer process. Equivalent to visiting about:crash, but without changing the tab's URL.",
        "parameters": [
          {
            "name": "processId",
            "type": "integer",
            "minimum": 0,
            "description": "The ID of the process to be terminated."
          },
          {
            "name": "callback",
            "type": "function",
            "optional": true,
            "parameters": [
              {
                "name": "didTerminate",
                "type": "boolean",
                "description": "True if terminating the process was successful, otherwise false."
              }
            ]
          }
        ]
      },
      {
        "name": "getProcessIdForTab",
        "type": "function",
        "description": "Returns the ID of the renderer process for the specified tab.",
        "parameters": [
          {
            "name": "tabId",
            "type": "integer",
            "minimum": 0,
            "description": "The ID of the tab for which the renderer process ID is to be returned."
          },
          {
            "name": "callback",
            "type": "function",
            "parameters": [
              {
                "name": "processId",
                "type": "integer",
                "description": "Process ID of the tab's renderer process."
              }
            ]
          }
        ]
      },
      {
        "name": "getProcessInfo",
        "type": "function",
        "description": "Retrieves the process information for each process ID specified.",
        "parameters": [
          {
            "name": "processIds",
            "choices": [
              {"type": "integer", "minimum": 0},
              {"type": "array", "items": {"type": "integer", "minimum": 0}}
            ],
            "description": "The list of process IDs or single process ID for which to return the process information. An empty list indicates all processes are requested."
          },
          {
            "name": "includeMemory",
            "type": "boolean",
            "description": "True if detailed memory usage is required. Note, collecting memory usage information incurs extra CPU usage and should only be queried for when needed."
          },
          {
            "name": "callback",
            "type": "function",
            "description": "Called when the processes information is collected.",
            "parameters": [
              {
                "name": "processes",
                "description": "A dictionary of Process objects for each requested 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.",
                "type": "object",
                "additionalProperties": { "$ref": "Process" }
              }
            ]
          }
        ]
      }
    ],
    "events": [
      {
        "name": "onUpdated",
        "type": "function",
        "description": "Fired each time the Task Manager updates its process statistics, providing the dictionary of updated Process objects, indexed by process ID.",
        "parameters": [
          {
            "name": "processes",
            "type": "object",
            "description": "A dictionary of updated Process objects for each live process in the browser, indexed by process ID.  Metrics requiring aggregation over time will be populated in each Process object.",
            "additionalProperties": { "$ref": "Process" }
          }
        ]
      },
      {
        "name": "onUpdatedWithMemory",
        "type": "function",
        "description": "Fired each time the Task Manager updates its process statistics, providing the dictionary of updated Process objects, indexed by process ID. Identical to onUpdate, with the addition of memory usage details included in each Process object. Note, collecting memory usage information incurs extra CPU usage and should only be listened for when needed.",
        "parameters": [
          {
            "name": "processes",
            "type": "object",
            "description": "A dictionary of updated Process objects for each live process in the browser, indexed by process ID.  Memory usage details will be included in each Process object.",
            "additionalProperties": { "$ref": "Process" }
          }
        ]
      },
      {
        "name": "onCreated",
        "type": "function",
        "description": "Fired each time a process is created, providing the corrseponding Process object.",
        "parameters": [
          {
            "name": "process",
            "description": "Details of the process that was created. Metrics requiring aggregation over time will not be populated in the object.",
            "$ref": "Process"
          }
        ]
      },
      {
        "name": "onUnresponsive",
        "type": "function",
        "description": "Fired each time a process becomes unresponsive, providing the corrseponding Process object.",
        "parameters": [
          {
            "name": "process",
            "description": "Details of the unresponsive process. Metrics requiring aggregation over time will not be populated in the object. Only available for renderer processes.",
            "$ref": "Process"
          }
        ]
      },
      {
        "name": "onExited",
        "type": "function",
        "description": "Fired each time a process is terminated, providing the type of exit.",
        "parameters": [
          {
            "name": "processId",
            "description": "The ID of the process that exited.",
            "type": "integer"
          },
          {
            "name": "exitType",
            "description": "The type of exit that occurred for the process - normal, abnormal, killed, crashed. Only available for renderer processes.",
            "type": "integer"
          },
          {
            "name": "exitCode",
            "description": "The exit code if the process exited abnormally. Only available for renderer processes.",
            "type": "integer"
          }
        ]
      }
    ]
  }
]