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

Unified Diff: chrome/browser/browser_main.cc

Issue 6883102: Add one-time randomization support for FieldTrial, and the ability to (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Unit test cancel support. Created 9 years, 8 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
« base/rand_util.cc ('K') | « base/rand_util.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/browser_main.cc
diff --git a/chrome/browser/browser_main.cc b/chrome/browser/browser_main.cc
index 1f59543be950a93eba76cacf8a5b0bd72ab566fa..cfd5bb5288b825962248e50034417742a7c4a249 100644
--- a/chrome/browser/browser_main.cc
+++ b/chrome/browser/browser_main.cc
@@ -1326,6 +1326,14 @@ int BrowserMain(const MainFunctionParams& parameters) {
about_flags::ConvertFlagsToSwitches(local_state,
CommandLine::ForCurrentProcess());
+ // Initialize FieldTrialList to support FieldTrials that use one-time
+ // randomization. The metrics client ID has been initialized if needed
+ // (and only if metrics collection is enabled) by the call to
+ // browser::RegisterLocalState() above.
Jói 2011/04/21 20:23:00 Whoops, my bad, that's not where the state actuall
jar (doing other things) 2011/04/21 22:10:02 Perhaps the above comment means this... but to rei
Jói 2011/04/28 01:03:50 Agreed, this was me thinking I had found a shortcu
+ std::string client_id = local_state->GetString(prefs::kMetricsClientID);
+ if (!client_id.empty())
+ base::FieldTrialList::EnableOneTimeRandomization(client_id);
+
// Now the command line has been mutated based on about:flags, we can run some
// field trials
parts->SetupFieldTrials();
« base/rand_util.cc ('K') | « base/rand_util.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698