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

Unified Diff: chrome/browser/task_manager/task_manager_interface.h

Issue 2905403002: plumb network upload into the task manager (Closed)
Patch Set: js formatting, fixing spelling, modifying browser tests Created 3 years, 6 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/browser/task_manager/task_manager_interface.h
diff --git a/chrome/browser/task_manager/task_manager_interface.h b/chrome/browser/task_manager/task_manager_interface.h
index c4e31c24234f6f922dc8db5292a98befad2dbbd8..85b972cd64c317b3a4898c5cd02dd142203d940b 100644
--- a/chrome/browser/task_manager/task_manager_interface.h
+++ b/chrome/browser/task_manager/task_manager_interface.h
@@ -51,10 +51,15 @@ class TaskManagerInterface {
static TaskManagerInterface* GetTaskManager();
// This notification will be received on the IO thread from
- // ChromeNetworkDelegate to update the task manager with network usage.
+ // ChromeNetworkDelegate to update the task manager with read network usage.
static void OnRawBytesRead(const net::URLRequest& request,
int64_t bytes_read);
+ // This notification will be received on the IO thread from
+ // ChromeNetworkDelegate to update the task manager with sent network usage.
+ static void OnRawBytesSent(const net::URLRequest& request,
+ int64_t bytes_sent);
+
void AddObserver(TaskManagerObserver* observer);
void RemoveObserver(TaskManagerObserver* observer);
@@ -172,11 +177,13 @@ class TaskManagerInterface {
int* out_error_code) const = 0;
// Returns the network usage (in bytes per second) during the current refresh
- // cycle for the task with |task_id|. A value of -1 means no valid value is
- // currently available or that task has never been notified of any network
- // usage.
+ // cycle for the task with |task_id|.
virtual int64_t GetNetworkUsage(TaskId task_id) const = 0;
+ // Returns the network usage during the current lifetime of the task
+ // for the task with |task_id|.
+ virtual int64_t GetCumulativeNetworkUsage(TaskId task_id) const = 0;
+
// Returns the total network usage (in bytes per second) during the current
// refresh cycle for the process on which the task with |task_id| is running.
// This is the sum of all the network usage of the individual tasks (that
@@ -184,6 +191,14 @@ class TaskManagerInterface {
// usage calculation refresh is currently not available.
virtual int64_t GetProcessTotalNetworkUsage(TaskId task_id) const = 0;
+ // Returns the total network usage during the lifetime of the process
+ // on which the task with |task_id| is running.
+ // This is the sum of all the network usage of the individual tasks (that
+ // can be gotten by the above GetTotalNetworkUsage()). A value of -1
+ // means network usage calculation refresh is currently not available.
ncarter (slow) 2017/06/20 19:52:27 GetCumulativeProcessTotalNetworkUsage doesn't seem
cburn 2017/06/20 21:34:56 Done.
+ virtual int64_t GetCumulativeProcessTotalNetworkUsage(
+ TaskId task_id) const = 0;
+
// Returns the Sqlite used memory (in bytes) for the task with |task_id|.
// A value of -1 means no valid value is currently available.
virtual int64_t GetSqliteMemoryUsed(TaskId task_id) const = 0;

Powered by Google App Engine
This is Rietveld 408576698