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

Issue 2964543002: TaskManager: use an unordered_map for tracking network usage (Closed)

Created:
3 years, 5 months ago by cburn
Modified:
3 years, 5 months ago
Reviewers:
afakhry, ncarter (slow)
CC:
chromium-reviews, cbentzel+watch_chromium.org, net-reviews_chromium.org
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

TaskManager: use an unordered_map for tracking network usage This CL changes a vector to an unordered_map and splits BytesTransferredParam into BytesTransferedKey and BytesTransferedParam. Where the key contains the |origin_pid|, |child_id| and |route_id|. The BytesTransferedParam contains |byte_read_count| and |byte_sent_count| and will use those values to increment the entry in the unordered map. This hoists |content::ResourceRequestInfo::ForRequest(request)| to the task manager interface so the bytes transferred pipeline can be simplified from the task manager interface to the task manager. This also allows for unit tests to be written for task_manager_io_thread_helper to test that the unordered map is being filled out appropriately. This is done through dependency injection in the IoThreadHelperManager. BUG=720773 Review-Url: https://codereview.chromium.org/2964543002 Cr-Commit-Position: refs/heads/master@{#484652} Committed: https://chromium.googlesource.com/chromium/src/+/c0a595329cf5a58ed1beb487a84c3213b0247061

Patch Set 1 #

Patch Set 2 : changed some formatting back #

Patch Set 3 : fixed more formatting #

Patch Set 4 : edited comments #

Total comments: 22

Patch Set 5 : Updated from first CR #

Total comments: 50

Patch Set 6 : 2nd code review #

Patch Set 7 : updated unit tests and changed some names #

Total comments: 6

Patch Set 8 : fixed nits from lgtm #

Unified diffs Side-by-side diffs Delta from patch set Stats (+553 lines, -114 lines) Patch
M chrome/browser/task_manager/sampling/task_manager_impl.h View 2 chunks +3 lines, -3 lines 0 comments Download
M chrome/browser/task_manager/sampling/task_manager_impl.cc View 1 2 3 4 5 6 3 chunks +21 lines, -13 lines 0 comments Download
M chrome/browser/task_manager/sampling/task_manager_io_thread_helper.h View 1 2 3 4 5 6 7 5 chunks +42 lines, -33 lines 0 comments Download
M chrome/browser/task_manager/sampling/task_manager_io_thread_helper.cc View 1 2 3 4 5 6 7 5 chunks +49 lines, -62 lines 0 comments Download
A chrome/browser/task_manager/sampling/task_manager_io_thread_helper_unittest.cc View 1 2 3 4 5 6 7 1 chunk +408 lines, -0 lines 0 comments Download
M chrome/browser/task_manager/task_manager_interface.cc View 1 2 3 4 3 chunks +29 lines, -3 lines 0 comments Download
M chrome/test/BUILD.gn View 1 chunk +1 line, -0 lines 0 comments Download

Depends on Patchset:

Messages

Total messages: 43 (30 generated)
cburn
ptal.
3 years, 5 months ago (2017-06-29 23:05:19 UTC) #11
ncarter (slow)
https://codereview.chromium.org/2964543002/diff/50001/chrome/browser/net/chrome_network_delegate.cc File chrome/browser/net/chrome_network_delegate.cc (right): https://codereview.chromium.org/2964543002/diff/50001/chrome/browser/net/chrome_network_delegate.cc#newcode404 chrome/browser/net/chrome_network_delegate.cc:404: task_manager::TaskManagerInterface::OnRawBytesTransferred(key, bytes_received, Let's adjust this layering slightly. It shouldn't ...
3 years, 5 months ago (2017-06-29 23:40:01 UTC) #12
cburn
ptal https://codereview.chromium.org/2964543002/diff/50001/chrome/browser/net/chrome_network_delegate.cc File chrome/browser/net/chrome_network_delegate.cc (right): https://codereview.chromium.org/2964543002/diff/50001/chrome/browser/net/chrome_network_delegate.cc#newcode404 chrome/browser/net/chrome_network_delegate.cc:404: task_manager::TaskManagerInterface::OnRawBytesTransferred(key, bytes_received, On 2017/06/29 23:40:00, ncarter (slow) wrote: ...
3 years, 5 months ago (2017-06-30 18:04:39 UTC) #16
ncarter (slow)
Very close, this is looking great! +afakhry for thoughts https://codereview.chromium.org/2964543002/diff/70001/chrome/browser/task_manager/sampling/task_manager_impl.cc File chrome/browser/task_manager/sampling/task_manager_impl.cc (right): https://codereview.chromium.org/2964543002/diff/70001/chrome/browser/task_manager/sampling/task_manager_impl.cc#newcode459 chrome/browser/task_manager/sampling/task_manager_impl.cc:459: ...
3 years, 5 months ago (2017-06-30 20:08:30 UTC) #21
ncarter (slow)
https://codereview.chromium.org/2964543002/diff/70001/chrome/browser/task_manager/sampling/task_manager_io_thread_helper_unittest.cc File chrome/browser/task_manager/sampling/task_manager_io_thread_helper_unittest.cc (right): https://codereview.chromium.org/2964543002/diff/70001/chrome/browser/task_manager/sampling/task_manager_io_thread_helper_unittest.cc#newcode57 chrome/browser/task_manager/sampling/task_manager_io_thread_helper_unittest.cc:57: ASSERT_TRUE(mock_main_runner->HasPendingTask()); On 2017/06/30 20:08:30, ncarter (slow) wrote: > Replace ...
3 years, 5 months ago (2017-06-30 20:10:08 UTC) #22
cburn
ptal. https://codereview.chromium.org/2964543002/diff/70001/chrome/browser/task_manager/sampling/task_manager_impl.cc File chrome/browser/task_manager/sampling/task_manager_impl.cc (right): https://codereview.chromium.org/2964543002/diff/70001/chrome/browser/task_manager/sampling/task_manager_impl.cc#newcode459 chrome/browser/task_manager/sampling/task_manager_impl.cc:459: DCHECK_CURRENTLY_ON(content::BrowserThread::UI); On 2017/06/30 20:08:28, ncarter (slow) wrote: > ...
3 years, 5 months ago (2017-07-05 16:30:07 UTC) #25
ncarter (slow)
lgtm https://codereview.chromium.org/2964543002/diff/110001/chrome/browser/task_manager/sampling/task_manager_io_thread_helper_unittest.cc File chrome/browser/task_manager/sampling/task_manager_io_thread_helper_unittest.cc (right): https://codereview.chromium.org/2964543002/diff/110001/chrome/browser/task_manager/sampling/task_manager_io_thread_helper_unittest.cc#newcode9 chrome/browser/task_manager/sampling/task_manager_io_thread_helper_unittest.cc:9: #include "testing/gmock/include/gmock/gmock.h" Add back #include "testing/gtest/include/gtest/gtest.h" & remove ...
3 years, 5 months ago (2017-07-05 18:28:19 UTC) #26
afakhry
lgtm https://codereview.chromium.org/2964543002/diff/110001/chrome/browser/task_manager/sampling/task_manager_io_thread_helper.cc File chrome/browser/task_manager/sampling/task_manager_io_thread_helper.cc (right): https://codereview.chromium.org/2964543002/diff/110001/chrome/browser/task_manager/sampling/task_manager_io_thread_helper.cc#newcode80 chrome/browser/task_manager/sampling/task_manager_io_thread_helper.cc:80: if (g_io_thread_helper) { Nit: Remove single-line block braces. ...
3 years, 5 months ago (2017-07-05 19:01:21 UTC) #27
commit-bot: I haz the power
CQ is trying da patch. Follow status at: https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2964543002/130001
3 years, 5 months ago (2017-07-05 20:51:27 UTC) #31
commit-bot: I haz the power
Try jobs failed on following builders: ios-device on master.tryserver.chromium.mac (JOB_TIMED_OUT, build has not started yet; ...
3 years, 5 months ago (2017-07-05 22:52:26 UTC) #33
commit-bot: I haz the power
CQ is trying da patch. Follow status at: https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2964543002/130001
3 years, 5 months ago (2017-07-06 17:30:38 UTC) #39
cburn
https://codereview.chromium.org/2964543002/diff/110001/chrome/browser/task_manager/sampling/task_manager_io_thread_helper.cc File chrome/browser/task_manager/sampling/task_manager_io_thread_helper.cc (right): https://codereview.chromium.org/2964543002/diff/110001/chrome/browser/task_manager/sampling/task_manager_io_thread_helper.cc#newcode80 chrome/browser/task_manager/sampling/task_manager_io_thread_helper.cc:80: if (g_io_thread_helper) { On 2017/07/05 19:01:21, afakhry wrote: > ...
3 years, 5 months ago (2017-07-06 17:30:41 UTC) #40
commit-bot: I haz the power
3 years, 5 months ago (2017-07-06 17:35:01 UTC) #43
Message was sent while issue was closed.
Committed patchset #8 (id:130001) as
https://chromium.googlesource.com/chromium/src/+/c0a595329cf5a58ed1beb487a84c...

Powered by Google App Engine
This is Rietveld 408576698