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

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

Issue 2905403002: plumb network upload into the task manager (Closed)
Patch Set: fixed negative byte totals 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..2712d1da0961456e79e9a3aa9906f40a2c121834 100644
--- a/chrome/browser/task_manager/task_manager_interface.h
+++ b/chrome/browser/task_manager/task_manager_interface.h
@@ -55,6 +55,11 @@ class TaskManagerInterface {
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 network usage.
+ static void OnRawBytesSent(const net::URLRequest& request,
+ int64_t bytes_sent);
+
void AddObserver(TaskManagerObserver* observer);
void RemoveObserver(TaskManagerObserver* observer);
@@ -177,6 +182,12 @@ class TaskManagerInterface {
// usage.
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|. A value of -1 means no valid value is
+ // currently available or that task has never been notified of any network
+ // usage.
+ virtual int64_t GetTotalNetworkUsage(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 +195,13 @@ 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.
+ virtual int64_t GetTotalProcessTotalNetworkUsage(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