Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2541)

Unified Diff: chrome/common/extensions/api/processes.idl

Issue 1584473004: Migrate ProcessesEventRouter to the new task manager (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: dispatch onCreated and onExited only for processes with valid child process host IDs Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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 {
ncarter (slow) 2016/02/08 22:37:09 It is very hard to see how the API has changed. Wo
afakhry 2016/02/09 04:01:23 All the API remained the same except for the Proce
+ // 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);
+ };
+};

Powered by Google App Engine
This is Rietveld 408576698