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

Side by Side Diff: chrome/browser/task_management/providers/task.h

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 unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 #ifndef CHROME_BROWSER_TASK_MANAGEMENT_PROVIDERS_TASK_H_ 5 #ifndef CHROME_BROWSER_TASK_MANAGEMENT_PROVIDERS_TASK_H_
6 #define CHROME_BROWSER_TASK_MANAGEMENT_PROVIDERS_TASK_H_ 6 #define CHROME_BROWSER_TASK_MANAGEMENT_PROVIDERS_TASK_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include "base/macros.h" 10 #include "base/macros.h"
11 #include "base/process/kill.h"
11 #include "base/process/process_handle.h" 12 #include "base/process/process_handle.h"
12 #include "base/strings/string16.h" 13 #include "base/strings/string16.h"
13 #include "base/time/time.h" 14 #include "base/time/time.h"
14 #include "third_party/WebKit/public/web/WebCache.h" 15 #include "third_party/WebKit/public/web/WebCache.h"
15 #include "ui/gfx/image/image_skia.h" 16 #include "ui/gfx/image/image_skia.h"
16 17
17 class Profile; 18 class Profile;
18 19
19 namespace task_management { 20 namespace task_management {
20 21
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
76 // Returns the task type. 77 // Returns the task type.
77 virtual Type GetType() const = 0; 78 virtual Type GetType() const = 0;
78 79
79 // This is the unique ID of the BrowserChildProcessHost/RenderProcessHost. It 80 // This is the unique ID of the BrowserChildProcessHost/RenderProcessHost. It
80 // is not the PID nor the handle of the process. 81 // is not the PID nor the handle of the process.
81 // For a task that represents the browser process, the return value is 0. For 82 // For a task that represents the browser process, the return value is 0. For
82 // other tasks that represent renderers and other child processes, the return 83 // other tasks that represent renderers and other child processes, the return
83 // value is whatever unique IDs of their hosts in the browser process. 84 // value is whatever unique IDs of their hosts in the browser process.
84 virtual int GetChildProcessUniqueID() const = 0; 85 virtual int GetChildProcessUniqueID() const = 0;
85 86
87 // If the process, in which this task is running, is terminated, this gets the
88 // termination status. Currently implemented only for Renderer processes.
89 virtual void GetTerminationStatus(base::TerminationStatus* out_status,
90 int* out_error_code) const;
91
86 // The name of the profile owning this task. 92 // The name of the profile owning this task.
87 virtual base::string16 GetProfileName() const; 93 virtual base::string16 GetProfileName() const;
88 94
95 // Returns the unique ID of the tab if this task represents a renderer
96 // WebContents used for a tab. Returns -1 if this task does not represent
97 // a renderer, or a contents of a tab.
98 virtual int GetTabId() const;
99
89 // Getting the Sqlite used memory (in bytes). Not all tasks reports Sqlite 100 // Getting the Sqlite used memory (in bytes). Not all tasks reports Sqlite
90 // memory, in this case a default invalid value of -1 will be returned. 101 // memory, in this case a default invalid value of -1 will be returned.
91 // Check for whether the task reports it or not first. 102 // Check for whether the task reports it or not first.
92 bool ReportsSqliteMemory() const; 103 bool ReportsSqliteMemory() const;
93 virtual int64_t GetSqliteMemoryUsed() const; 104 virtual int64_t GetSqliteMemoryUsed() const;
94 105
95 // Getting the allocated and used V8 memory (in bytes). Not all tasks reports 106 // Getting the allocated and used V8 memory (in bytes). Not all tasks reports
96 // V8 memory, in this case a default invalid value of -1 will be returned. 107 // V8 memory, in this case a default invalid value of -1 will be returned.
97 // Check for whether the task reports it or not first. 108 // Check for whether the task reports it or not first.
98 bool ReportsV8Memory() const; 109 bool ReportsV8Memory() const;
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
150 161
151 // The PID of the process on which this task is running. 162 // The PID of the process on which this task is running.
152 const base::ProcessId process_id_; 163 const base::ProcessId process_id_;
153 164
154 DISALLOW_COPY_AND_ASSIGN(Task); 165 DISALLOW_COPY_AND_ASSIGN(Task);
155 }; 166 };
156 167
157 } // namespace task_management 168 } // namespace task_management
158 169
159 #endif // CHROME_BROWSER_TASK_MANAGEMENT_PROVIDERS_TASK_H_ 170 #endif // CHROME_BROWSER_TASK_MANAGEMENT_PROVIDERS_TASK_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698