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

Unified Diff: chrome/browser/browser_main.h

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: Merge to head. Created 9 years, 7 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
« no previous file with comments | « base/rand_util.cc ('k') | chrome/browser/browser_main.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/browser_main.h
diff --git a/chrome/browser/browser_main.h b/chrome/browser/browser_main.h
index 41e6f95939f14d9112f178e83813b85ee1a3ba41..a867e20984c5d47e57804ccc7a5ad780f61792e4 100644
--- a/chrome/browser/browser_main.h
+++ b/chrome/browser/browser_main.h
@@ -13,10 +13,12 @@
class BrowserThread;
class CommandLine;
+class FieldTrialSynchronizer;
class HighResolutionTimerManager;
struct MainFunctionParams;
class MessageLoop;
class MetricsService;
+class PrefService;
namespace net {
class NetworkChangeNotifier;
@@ -80,7 +82,12 @@ class BrowserMainParts {
void EarlyInitialization();
void MainMessageLoopStart();
- void SetupFieldTrials();
+ // Constructs metrics service and does related initialization, including
+ // creation of field trials. Call only after labs have been converted to
+ // switches.
+ MetricsService* SetupMetricsAndFieldTrials(
+ const CommandLine& parsed_command_line,
+ PrefService* local_state);
protected:
explicit BrowserMainParts(const MainFunctionParams& parameters);
@@ -132,6 +139,15 @@ class BrowserMainParts {
void InitializeMainThread();
+ // Methods for |SetupMetricsAndFieldTrials()| --------------------------------
+
+ static MetricsService* InitializeMetrics(
+ const CommandLine& parsed_command_line,
+ const PrefService* local_state);
+
+ // Add an invocation of your field trial init function to this method.
+ void SetupFieldTrials(bool metrics_recording_enabled);
+
// Members initialized on construction ---------------------------------------
const MainFunctionParams& parameters_;
@@ -144,8 +160,9 @@ class BrowserMainParts {
tracked_objects::AutoTracking tracking_objects_;
#endif
- // Statistical testing infrastructure for the entire browser.
- base::FieldTrialList field_trial_;
+ // Statistical testing infrastructure for the entire browser. NULL until
+ // SetupMetricsAndFieldTrials is called.
+ scoped_ptr<base::FieldTrialList> field_trial_list_;
// Members initialized in |MainMessageLoopStart()| ---------------------------
scoped_ptr<MessageLoop> main_message_loop_;
@@ -154,6 +171,9 @@ class BrowserMainParts {
scoped_ptr<net::NetworkChangeNotifier> network_change_notifier_;
scoped_ptr<BrowserThread> main_thread_;
+ // Initialized in SetupMetricsAndFieldTrials.
+ scoped_refptr<FieldTrialSynchronizer> field_trial_synchronizer_;
+
DISALLOW_COPY_AND_ASSIGN(BrowserMainParts);
};
« no previous file with comments | « base/rand_util.cc ('k') | chrome/browser/browser_main.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698