| Index: chrome/common/extensions/api/processes.idl
|
| diff --git a/chrome/common/extensions/api/processes.idl b/chrome/common/extensions/api/processes.idl
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..b7e40410ca378a2acaab4ee1aa9b24735c4bbcad
|
| --- /dev/null
|
| +++ b/chrome/common/extensions/api/processes.idl
|
| @@ -0,0 +1,142 @@
|
| +// Copyright 2015 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.
|
| +
|
| +// Use the <code>chrome.processes</code> API to interact with the browser's
|
| +// processes.
|
| +namespace processes {
|
| + // The types of the browser processes.
|
| + enum ProcessType {
|
| + browser,
|
| + renderer,
|
| + extension,
|
| + notification,
|
| + plugin,
|
| + worker,
|
| + nacl,
|
| + utility,
|
| + gpu,
|
| + other
|
| + };
|
| +
|
| + // An object that represents a Chrome task running on a process. Several tasks
|
| + // can share the same process.
|
| + dictionary TaskInfo {
|
| + // The title of the task.
|
| + DOMString title;
|
| + // Optional tab ID, if this task represents a tab running on a renderer
|
| + // process.
|
| + long? tabId;
|
| + };
|
| +
|
| + // The Cache object contains information about the size and utilization of a
|
| + // cache used by the browser.
|
| + dictionary Cache {
|
| + // The size eof the cache, in bytes.
|
| + double size;
|
| + // The part of the cache that is utilized, in bytes.
|
| + double liveSize;
|
| + };
|
| +
|
| + // An object containing information about one of the browser's processes.
|
| + dictionary Process {
|
| + // Unique ID of the process provided by the browser.
|
| + long id;
|
| + // The ID of the process, as provided by the OS.
|
| + long osProcessId;
|
| + // The type of process.
|
| + ProcessType type;
|
| + // The profile which the process is associated with.
|
| + DOMString profile;
|
| + // The debugging port for Native Client processes. Zero for other process
|
| + // types and for NaCl processes that do not have debugging enabled.
|
| + long naclDebugPort;
|
| + // Array of TaskInfos representing the tasks running on this process.
|
| + TaskInfo[] tasks;
|
| + // 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.
|
| + double? cpu;
|
| + // 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.
|
| + double? network;
|
| + // 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.
|
| + double? privateMemory;
|
| + // 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.
|
| + double? jsMemoryAllocated;
|
| + // 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.
|
| + double? jsMemoryUsed;
|
| + // 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.
|
| + double? sqliteMemory;
|
| + // 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.
|
| + Cache? imageCache;
|
| + // 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.
|
| + Cache? scriptCache;
|
| + // 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.
|
| + Cache? cssCache;
|
| + };
|
| +
|
| + // A callback to report the status of the termination |didTerminate| is true
|
| + // if terminating the process was successful, and false otherwise.
|
| + callback TerminateCallback = void(boolean didTerminate);
|
| +
|
| + // A callback to return the ID of the renderer process of a tab.
|
| + callback GetProcessIdForTabCallback = void(long processId);
|
| +
|
| + // A callback called when the processes information is collected.
|
| + // |processes| is 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.
|
| + callback GetProcessInfoCallback = void(object processes);
|
| +
|
| + interface Functions {
|
| + // Terminates the specified renderer process. Equivalent to visiting
|
| + // about:crash, but without changing the tab's URL.
|
| + static void terminate(long processId, optional TerminateCallback callback);
|
| + // Returns the ID of the renderer process for the specified tab.
|
| + static void getProcessIdForTab(long tabId,
|
| + GetProcessIdForTabCallback callback);
|
| + // Retrieves the process information for each process ID specified.
|
| + static void getProcessInfo((long or long[]) processIds,
|
| + boolean includeMemory,
|
| + GetProcessInfoCallback callback);
|
| + };
|
| +
|
| + interface Events {
|
| + // Fired each time the Task Manager updates its process statistics,
|
| + // providing the dictionary of updated Process objects, indexed by process
|
| + // ID.
|
| + static void onUpdated(object processes);
|
| + // 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.
|
| + static void onUpdatedWithMemory(object processes);
|
| + // Fired each time a process is created, providing the corrseponding Process
|
| + // object.
|
| + static void onCreated(Process process);
|
| + // Fired each time a process becomes unresponsive, providing the
|
| + // corrseponding Process object.
|
| + static void onUnresponsive(Process process);
|
| + // Fired each time a process is terminated, providing the type of exit.
|
| + static void onExited(long processId, long exitType, long exitCode);
|
| + };
|
| +};
|
|
|