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

Issue 2517363002: Decouple Metrics Initialization from IO Thread Initialization (Closed)

Created:
4 years, 1 month ago by robliao
Modified:
4 years ago
CC:
chromium-reviews, gayane -on leave until 09-2017, brettw
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Decouple Metrics Initialization from IO Thread Initialization In preparation of moving Task Scheduler initialization to the content CreateThreads phase, metrics has to be initialized during PreMainMessageLoopRun. The only reference to metrics during PreCreateThreads was in the IO Thread state initialization to set up a IO thread to UI thread forwarder that reported network connection state (e.g. cellular or not). This change moves that initialization to be called on demand as the callback is not needed until the first network URL request is satisfied. This happens after CreateThreads and generally after PreMainMessageLoopRun. BUG=662052 Committed: https://crrev.com/7253fd2e30a62a81e3638f0bdbf1c5dacfd03512 Cr-Commit-Position: refs/heads/master@{#435657}

Patch Set 1 #

Total comments: 6

Patch Set 2 : Remove #if's, add "Can be a null callback" comment. #

Patch Set 3 : Add One Level of Indirection #

Total comments: 8

Patch Set 4 : Shift UI Call Marshalling Responsibility to Caller #

Patch Set 5 : Fix Unit Test #

Total comments: 6

Patch Set 6 : CR Feedback #

Total comments: 2

Patch Set 7 : CR Feedback #

Unified diffs Side-by-side diffs Delta from patch set Stats (+57 lines, -79 lines) Patch
M chrome/browser/io_thread.h View 1 2 3 2 chunks +1 line, -5 lines 0 comments Download
M chrome/browser/io_thread.cc View 1 2 3 4 5 6 4 chunks +29 lines, -12 lines 0 comments Download
M components/metrics/data_use_tracker.h View 1 2 3 4 5 4 chunks +4 lines, -15 lines 0 comments Download
M components/metrics/data_use_tracker.cc View 1 2 3 4 5 3 chunks +11 lines, -37 lines 0 comments Download
M components/metrics/data_use_tracker_unittest.cc View 1 2 3 4 2 chunks +2 lines, -2 lines 0 comments Download
M components/metrics/metrics_service.h View 1 2 3 4 5 1 chunk +4 lines, -3 lines 0 comments Download
M components/metrics/metrics_service.cc View 1 2 3 4 5 1 chunk +6 lines, -5 lines 0 comments Download

Dependent Patchsets:

Messages

Total messages: 57 (36 generated)
robliao
asvitkine: Please review this CL. Thanks!
4 years, 1 month ago (2016-11-22 02:00:47 UTC) #4
Alexei Svitkine (slow)
lgtm % comment https://codereview.chromium.org/2517363002/diff/1/chrome/browser/io_thread.cc File chrome/browser/io_thread.cc (right): https://codereview.chromium.org/2517363002/diff/1/chrome/browser/io_thread.cc#newcode1089 chrome/browser/io_thread.cc:1089: #if DCHECK_IS_ON() Nit: I'd remove these ...
4 years, 1 month ago (2016-11-22 16:29:46 UTC) #7
robliao
mmenke@chromium.org: Please review changes in c/b/io_* brettw@chromium.org: Please review changes in c/b/[everything else] Thanks! https://codereview.chromium.org/2517363002/diff/1/chrome/browser/io_thread.cc ...
4 years, 1 month ago (2016-11-22 18:02:37 UTC) #9
mmenke
https://codereview.chromium.org/2517363002/diff/1/chrome/browser/io_thread.cc File chrome/browser/io_thread.cc (right): https://codereview.chromium.org/2517363002/diff/1/chrome/browser/io_thread.cc#newcode1089 chrome/browser/io_thread.cc:1089: #if DCHECK_IS_ON() On 2016/11/22 18:02:37, robliao wrote: > On ...
4 years, 1 month ago (2016-11-22 18:09:06 UTC) #10
robliao
https://codereview.chromium.org/2517363002/diff/1/chrome/browser/io_thread.cc File chrome/browser/io_thread.cc (right): https://codereview.chromium.org/2517363002/diff/1/chrome/browser/io_thread.cc#newcode1089 chrome/browser/io_thread.cc:1089: #if DCHECK_IS_ON() On 2016/11/22 18:09:06, mmenke wrote: > On ...
4 years, 1 month ago (2016-11-22 18:10:27 UTC) #11
mmenke
What guarantee do we have that nothing does anything with IOThread between when it's created ...
4 years, 1 month ago (2016-11-22 18:20:58 UTC) #12
robliao
> What guarantee do we have that nothing does anything with IOThread between when it's ...
4 years, 1 month ago (2016-11-22 19:00:57 UTC) #13
mmenke
This just seems like a really bad idea to me. There's only one consumer of ...
4 years ago (2016-11-23 18:47:22 UTC) #14
robliao
On 2016/11/23 18:47:22, mmenke wrote: > This just seems like a really bad idea to ...
4 years ago (2016-11-23 19:17:14 UTC) #15
robliao
Alright. How about this approach? Instead of immediately requiring the callback which we won't need ...
4 years ago (2016-11-28 22:33:21 UTC) #20
Alexei Svitkine (slow)
https://codereview.chromium.org/2517363002/diff/60001/chrome/browser/io_thread.cc File chrome/browser/io_thread.cc (right): https://codereview.chromium.org/2517363002/diff/60001/chrome/browser/io_thread.cc#newcode266 chrome/browser/io_thread.cc:266: metrics_service->GetDataUseForwardingCallback(); If you're doing like this, then maybe you ...
4 years ago (2016-11-28 23:04:19 UTC) #23
robliao
https://codereview.chromium.org/2517363002/diff/60001/chrome/browser/io_thread.cc File chrome/browser/io_thread.cc (right): https://codereview.chromium.org/2517363002/diff/60001/chrome/browser/io_thread.cc#newcode266 chrome/browser/io_thread.cc:266: metrics_service->GetDataUseForwardingCallback(); On 2016/11/28 23:04:18, Alexei Svitkine (slow) wrote: > ...
4 years ago (2016-11-29 18:17:44 UTC) #26
Alexei Svitkine (slow)
https://codereview.chromium.org/2517363002/diff/60001/chrome/browser/io_thread.cc File chrome/browser/io_thread.cc (right): https://codereview.chromium.org/2517363002/diff/60001/chrome/browser/io_thread.cc#newcode266 chrome/browser/io_thread.cc:266: metrics_service->GetDataUseForwardingCallback(); On 2016/11/29 18:17:43, robliao wrote: > On 2016/11/28 ...
4 years ago (2016-11-29 18:34:34 UTC) #27
robliao
asvitkine: Please review the new metrics service changes. Thanks! https://codereview.chromium.org/2517363002/diff/60001/chrome/browser/io_thread.cc File chrome/browser/io_thread.cc (right): https://codereview.chromium.org/2517363002/diff/60001/chrome/browser/io_thread.cc#newcode266 chrome/browser/io_thread.cc:266: ...
4 years ago (2016-11-30 02:22:46 UTC) #31
Alexei Svitkine (slow)
Awesome cleanup - thanks! LGTM % comments below https://codereview.chromium.org/2517363002/diff/140001/components/metrics/data_use_tracker.h File components/metrics/data_use_tracker.h (right): https://codereview.chromium.org/2517363002/diff/140001/components/metrics/data_use_tracker.h#newcode38 components/metrics/data_use_tracker.h:38: // ...
4 years ago (2016-11-30 19:16:28 UTC) #38
robliao
mmenke: Please review the io_thread files in this CL. Thanks! https://codereview.chromium.org/2517363002/diff/140001/components/metrics/data_use_tracker.h File components/metrics/data_use_tracker.h (right): https://codereview.chromium.org/2517363002/diff/140001/components/metrics/data_use_tracker.h#newcode38 ...
4 years ago (2016-11-30 20:33:13 UTC) #42
mmenke
LGTM https://codereview.chromium.org/2517363002/diff/180001/chrome/browser/io_thread.cc File chrome/browser/io_thread.cc (right): https://codereview.chromium.org/2517363002/diff/180001/chrome/browser/io_thread.cc#newcode553 chrome/browser/io_thread.cc:553: base::Bind(&UpdateMetricsUsagePrefsOnUIThread)); Maybe just use GetMetricsDataUseForwarder() here? Doesn't get ...
4 years ago (2016-12-01 16:10:40 UTC) #47
robliao
https://codereview.chromium.org/2517363002/diff/180001/chrome/browser/io_thread.cc File chrome/browser/io_thread.cc (right): https://codereview.chromium.org/2517363002/diff/180001/chrome/browser/io_thread.cc#newcode553 chrome/browser/io_thread.cc:553: base::Bind(&UpdateMetricsUsagePrefsOnUIThread)); On 2016/12/01 16:10:39, mmenke wrote: > Maybe just ...
4 years ago (2016-12-01 17:56:52 UTC) #48
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/2517363002/200001
4 years ago (2016-12-01 17:57:14 UTC) #51
commit-bot: I haz the power
Committed patchset #7 (id:200001)
4 years ago (2016-12-01 18:42:13 UTC) #55
commit-bot: I haz the power
4 years ago (2016-12-01 18:44:50 UTC) #57
Message was sent while issue was closed.
Patchset 7 (id:??) landed as
https://crrev.com/7253fd2e30a62a81e3638f0bdbf1c5dacfd03512
Cr-Commit-Position: refs/heads/master@{#435657}

Powered by Google App Engine
This is Rietveld 408576698