Chromium Code Reviews| Index: chrome/browser/task_manager/sampling/task_manager_io_thread_helper.h |
| diff --git a/chrome/browser/task_manager/sampling/task_manager_io_thread_helper.h b/chrome/browser/task_manager/sampling/task_manager_io_thread_helper.h |
| index ff5315bdd49952a0775239ddfd8782c0883ea56a..6b626bb7b4918a867e1b5b9e9461fdbfa9557c8d 100644 |
| --- a/chrome/browser/task_manager/sampling/task_manager_io_thread_helper.h |
| +++ b/chrome/browser/task_manager/sampling/task_manager_io_thread_helper.h |
| @@ -20,7 +20,7 @@ namespace task_manager { |
| // Defines a wrapper of values that will be sent from IO to UI thread upon |
| // reception of bytes read notifications. |
|
ncarter (slow)
2017/06/17 00:21:01
"bytes read" is still read-specific
cburn
2017/06/19 22:07:08
Done.
|
| -struct BytesReadParam { |
| +struct BytesTransferedParam { |
| // The PID of the originating process of the URLRequest, if the request is |
| // sent on behalf of another process. Otherwise it's 0. |
| int origin_pid; |
| @@ -34,17 +34,21 @@ struct BytesReadParam { |
| int route_id; |
| // The number of bytes read. |
| - int64_t byte_count; |
| + int64_t byte_read_count; |
| - BytesReadParam(int origin_pid, |
| - int child_id, |
| - int route_id, |
| - int64_t byte_count) |
| + // The number of bytes sent. |
| + int64_t byte_sent_count; |
| + |
| + BytesTransferedParam(int origin_pid, |
| + int child_id, |
| + int route_id, |
| + int64_t byte_read_count, |
| + int64_t byte_sent_count) |
| : origin_pid(origin_pid), |
| child_id(child_id), |
| route_id(route_id), |
| - byte_count(byte_count) { |
| - } |
| + byte_read_count(byte_read_count), |
| + byte_sent_count(byte_sent_count) {} |
| }; |
| // Defines a utility class used to schedule the creation and removal of the |
| @@ -68,25 +72,33 @@ class TaskManagerIoThreadHelper { |
| static void CreateInstance(); |
| static void DeleteInstance(); |
| - // This is used to forward the call to update the network bytes from the |
| - // TaskManagerInterface if the new task manager is enabled. |
| + // This is used to forward the call to update the network bytes with read |
| + // bytes from the TaskManagerInterface if the new task manager is enabled. |
| static void OnRawBytesRead(const net::URLRequest& request, |
| int64_t bytes_read); |
| + // This is used to forward the call to update the network bytes with sent |
| + // bytes from the TaskManagerInterface if the new task manager is enabled. |
| + static void OnRawBytesSent(const net::URLRequest& request, |
| + int64_t bytes_sent); |
| + |
| private: |
| TaskManagerIoThreadHelper(); |
| ~TaskManagerIoThreadHelper(); |
| // We gather multiple notifications on the IO thread in one second before a |
| - // call is made to the following function to start the processing. |
| - void OnMultipleBytesReadIO(); |
| + // call is made to the following function to start the processing for |
| + // transfered bytes. |
| + void OnMultipleBytesTransferedIO(); |
| // This will update the task manager with the network bytes read. |
| - void OnNetworkBytesRead(const net::URLRequest& request, int64_t bytes_read); |
| + void OnNetworkBytesTransfered(const net::URLRequest& request, |
| + int64_t bytes_read, |
| + int64_t bytes_sent); |
| // This buffer will be filled on IO thread with information about the number |
| - // of bytes read from URLRequests. |
| - std::vector<BytesReadParam> bytes_read_buffer_; |
| + // of bytes transfered from URLRequests. |
| + std::vector<BytesTransferedParam> bytes_transfered_buffer_; |
| base::WeakPtrFactory<TaskManagerIoThreadHelper> weak_factory_; |