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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
« base/rand_util.cc ('K') | « base/rand_util.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/browser_main.h" 5 #include "chrome/browser/browser_main.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 1308 matching lines...) Expand 10 before | Expand all | Expand 10 after
1319 // watched. 1319 // watched.
1320 scoped_ptr<ThreadWatcherList> thread_watcher_list(new ThreadWatcherList()); 1320 scoped_ptr<ThreadWatcherList> thread_watcher_list(new ThreadWatcherList());
1321 1321
1322 // Initialize the prefs of the local state. 1322 // Initialize the prefs of the local state.
1323 browser::RegisterLocalState(local_state); 1323 browser::RegisterLocalState(local_state);
1324 1324
1325 // Convert active labs into switches. Modifies the current command line. 1325 // Convert active labs into switches. Modifies the current command line.
1326 about_flags::ConvertFlagsToSwitches(local_state, 1326 about_flags::ConvertFlagsToSwitches(local_state,
1327 CommandLine::ForCurrentProcess()); 1327 CommandLine::ForCurrentProcess());
1328 1328
1329 // Initialize FieldTrialList to support FieldTrials that use one-time
1330 // randomization. The metrics client ID has been initialized if needed
1331 // (and only if metrics collection is enabled) by the call to
1332 // 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
1333 std::string client_id = local_state->GetString(prefs::kMetricsClientID);
1334 if (!client_id.empty())
1335 base::FieldTrialList::EnableOneTimeRandomization(client_id);
1336
1329 // Now the command line has been mutated based on about:flags, we can run some 1337 // Now the command line has been mutated based on about:flags, we can run some
1330 // field trials 1338 // field trials
1331 parts->SetupFieldTrials(); 1339 parts->SetupFieldTrials();
1332 1340
1333 // Now that all preferences have been registered, set the install date 1341 // Now that all preferences have been registered, set the install date
1334 // for the uninstall metrics if this is our first run. This only actually 1342 // for the uninstall metrics if this is our first run. This only actually
1335 // gets used if the user has metrics reporting enabled at uninstall time. 1343 // gets used if the user has metrics reporting enabled at uninstall time.
1336 int64 install_date = 1344 int64 install_date =
1337 local_state->GetInt64(prefs::kUninstallMetricsInstallDate); 1345 local_state->GetInt64(prefs::kUninstallMetricsInstallDate);
1338 if (install_date == 0) { 1346 if (install_date == 0) {
(...skipping 548 matching lines...) Expand 10 before | Expand all | Expand 10 after
1887 #if defined(OS_CHROMEOS) 1895 #if defined(OS_CHROMEOS)
1888 // To be precise, logout (browser shutdown) is not yet done, but the 1896 // To be precise, logout (browser shutdown) is not yet done, but the
1889 // remaining work is negligible, hence we say LogoutDone here. 1897 // remaining work is negligible, hence we say LogoutDone here.
1890 chromeos::BootTimesLoader::Get()->AddLogoutTimeMarker("LogoutDone", 1898 chromeos::BootTimesLoader::Get()->AddLogoutTimeMarker("LogoutDone",
1891 false); 1899 false);
1892 chromeos::BootTimesLoader::Get()->WriteLogoutTimes(); 1900 chromeos::BootTimesLoader::Get()->WriteLogoutTimes();
1893 #endif 1901 #endif
1894 TRACE_EVENT_END("BrowserMain", 0, 0); 1902 TRACE_EVENT_END("BrowserMain", 0, 0);
1895 return result_code; 1903 return result_code;
1896 } 1904 }
OLDNEW
« 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