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

Issue 10830241: Inform GetEntropySource of whether or not metrics reporting will be enabled. (Closed)

Created:
8 years, 4 months ago by SteveT
Modified:
8 years, 4 months ago
Reviewers:
Nico, Ilya Sherman
CC:
chromium-reviews, MAD, asvitkine_google, jwd
Base URL:
http://git.chromium.org/chromium/src.git@master
Visibility:
Public.

Description

Inform GetEntropySource of whether or not metrics reporting will be enabled. This resolves an issue where we were calling GetEntropySource too early before MetricsService::Start was called. Instead of checking the reporting_active member in MetricsService, we instead just check if the criteria for metrics reporting is allowed or not, ahead of time. BUG=141628 Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=150934

Patch Set 1 #

Total comments: 6

Patch Set 2 : addressed isherman comments #

Patch Set 3 : Added cmdline flag for metrics reporting #

Patch Set 4 : Added browsertest #

Total comments: 4

Patch Set 5 : isherman test requests #

Total comments: 2

Patch Set 6 : thakis nit #

Unified diffs Side-by-side diffs Delta from patch set Stats (+81 lines, -11 lines) Patch
M chrome/browser/chrome_browser_main.cc View 1 2 3 4 5 2 chunks +9 lines, -4 lines 0 comments Download
M chrome/browser/metrics/metrics_service.h View 1 2 3 4 4 chunks +31 lines, -4 lines 0 comments Download
M chrome/browser/metrics/metrics_service.cc View 1 2 3 3 chunks +7 lines, -3 lines 0 comments Download
M chrome/browser/metrics/metrics_service_browsertest.cc View 1 2 3 4 5 3 chunks +27 lines, -0 lines 0 comments Download
M chrome/common/chrome_switches.h View 1 2 3 4 5 1 chunk +1 line, -0 lines 0 comments Download
M chrome/common/chrome_switches.cc View 1 2 3 4 5 1 chunk +6 lines, -0 lines 0 comments Download

Messages

Total messages: 24 (0 generated)
SteveT
Hey Ilya, mind taking a look? If you can think of a cleaner way of ...
8 years, 4 months ago (2012-08-09 15:01:18 UTC) #1
Ilya Sherman
Can you also add a test to make sure this doesn't regress? https://chromiumcodereview.appspot.com/10830241/diff/1/chrome/browser/chrome_browser_main.cc File chrome/browser/chrome_browser_main.cc ...
8 years, 4 months ago (2012-08-09 16:47:29 UTC) #2
SteveT
Addressed your comments except for the test... As for testing, I am not sure if ...
8 years, 4 months ago (2012-08-09 17:18:30 UTC) #3
Ilya Sherman
On 2012/08/09 17:18:30, SteveT wrote: > Addressed your comments except for the test... > > ...
8 years, 4 months ago (2012-08-09 17:24:29 UTC) #4
SteveT
Do browser_tests run the browser as a Chromium instance, or an official Chrome instance? The ...
8 years, 4 months ago (2012-08-09 17:26:41 UTC) #5
Ilya Sherman
On 2012/08/09 17:26:41, SteveT wrote: > Do browser_tests run the browser as a Chromium instance, ...
8 years, 4 months ago (2012-08-09 17:50:43 UTC) #6
SteveT
Not sure how far the command line flags will take us in this case - ...
8 years, 4 months ago (2012-08-09 17:55:30 UTC) #7
jar (doing other things)
Metrics is always compiled in... we just don't turn it on from browser_main.cc unles we're ...
8 years, 4 months ago (2012-08-09 18:03:09 UTC) #8
SteveT
Taking Jim's advice and adding a new command line flag to force-enable metrics reporting. As ...
8 years, 4 months ago (2012-08-09 18:16:51 UTC) #9
SteveT
Back to you. Let me know what you think.
8 years, 4 months ago (2012-08-09 20:24:13 UTC) #10
Ilya Sherman
LGTM --thanks for adding test coverage! :) In an ideal world, I think it would ...
8 years, 4 months ago (2012-08-09 20:41:18 UTC) #11
SteveT
Agreed that this is not the optimal test for this behaviour, but yeah, it at ...
8 years, 4 months ago (2012-08-09 21:07:59 UTC) #12
SteveT
Okay, manual tests look good for network accesses (as in there are none). Gotta love ...
8 years, 4 months ago (2012-08-09 21:46:56 UTC) #13
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/stevet@chromium.org/10830241/7005
8 years, 4 months ago (2012-08-09 21:51:10 UTC) #14
commit-bot: I haz the power
Presubmit check for 10830241-7005 failed and returned exit status 1. Running presubmit commit checks ...
8 years, 4 months ago (2012-08-09 21:51:19 UTC) #15
SteveT
Hey Nico - looks like I need OWNERS approval for chrome_browser_main.cc.
8 years, 4 months ago (2012-08-09 21:53:35 UTC) #16
Nico
lgtm https://chromiumcodereview.appspot.com/10830241/diff/7005/chrome/common/chrome_switches.cc File chrome/common/chrome_switches.cc (right): https://chromiumcodereview.appspot.com/10830241/diff/7005/chrome/common/chrome_switches.cc#newcode579 chrome/common/chrome_switches.cc:579: const char kEnableMetricsReporting[] = "enable-metrics-reporting"; kEnableMetricsReportForTesting / enable-metrics-report-for-testing ...
8 years, 4 months ago (2012-08-09 21:57:52 UTC) #17
SteveT
Thanks for the quick look, Nico! Going to CQ this bad boy. https://chromiumcodereview.appspot.com/10830241/diff/7005/chrome/common/chrome_switches.cc File chrome/common/chrome_switches.cc ...
8 years, 4 months ago (2012-08-09 22:05:02 UTC) #18
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/stevet@chromium.org/10830241/13010
8 years, 4 months ago (2012-08-09 22:05:12 UTC) #19
commit-bot: I haz the power
Change committed as 150934
8 years, 4 months ago (2012-08-09 23:07:41 UTC) #20
Mark P
I know this is a little late, but wouldn't it better to have entropy_source_returned_ keep ...
8 years, 4 months ago (2012-08-10 18:03:18 UTC) #21
SteveT
On 2012/08/10 18:03:18, Mark P wrote: > I know this is a little late, but ...
8 years, 4 months ago (2012-08-10 19:53:45 UTC) #22
Mark P
On 2012/08/10 19:53:45, SteveT wrote: > On 2012/08/10 18:03:18, Mark P wrote: > > I ...
8 years, 4 months ago (2012-08-16 19:00:21 UTC) #23
SteveT
8 years, 4 months ago (2012-08-16 19:03:07 UTC) #24
On 2012/08/16 19:00:21, Mark P wrote:
> On 2012/08/10 19:53:45, SteveT wrote:
> > On 2012/08/10 18:03:18, Mark P wrote:
> > > I know this is a little late, but wouldn't it better to have
> > > entropy_source_returned_ keep a copy of the *first* entropy source
returned,
> > not
> > > the last?  That way you'd notice problems if, for instance,
> IsMetricsRecording
> > > in chrome_browser_main.cc starts returning false before startup is
complete,
> > and
> > > thus the first field trials created have the low entropy source but the
> latter
> > > ones have the high entropy source.  The current way you test will hide
this
> > > situation because the last entropy source return is likely to be the high
> one
> > > (because a field trial might've been created late in startup that sees the
> > > correct value for IsMetricsReporting).
> > > 
> > > --mark
> > 
> > Good suggestion. I can make this change in a new CL.
> 
> I haven't seen this new CL.
> 
> Do I need to file a bug to remind you to do it?
> 
> thanks,
> mark

Yes please - haven't gotten around to this change yet. Please file a bug against
me.

Powered by Google App Engine
This is Rietveld 408576698