OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #ifndef CHROME_BROWSER_CHROME_BROWSER_MAIN_H_ | 5 #ifndef CHROME_BROWSER_CHROME_BROWSER_MAIN_H_ |
6 #define CHROME_BROWSER_CHROME_BROWSER_MAIN_H_ | 6 #define CHROME_BROWSER_CHROME_BROWSER_MAIN_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/gtest_prod_util.h" | 9 #include "base/gtest_prod_util.h" |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
11 #include "base/memory/scoped_vector.h" | 11 #include "base/memory/scoped_vector.h" |
12 #include "base/metrics/field_trial.h" | 12 #include "base/metrics/field_trial.h" |
13 #include "base/tracked_objects.h" | 13 #include "base/tracked_objects.h" |
| 14 #include "chrome/browser/chrome_browser_field_trials.h" |
14 #include "chrome/browser/first_run/first_run.h" | 15 #include "chrome/browser/first_run/first_run.h" |
15 #include "chrome/browser/process_singleton.h" | 16 #include "chrome/browser/process_singleton.h" |
16 #include "chrome/browser/task_profiler/auto_tracking.h" | 17 #include "chrome/browser/task_profiler/auto_tracking.h" |
17 #include "chrome/browser/ui/startup/startup_browser_creator.h" | 18 #include "chrome/browser/ui/startup/startup_browser_creator.h" |
18 #include "content/public/browser/browser_main_parts.h" | 19 #include "content/public/browser/browser_main_parts.h" |
19 #include "content/public/browser/browser_thread.h" | 20 #include "content/public/browser/browser_thread.h" |
20 | 21 |
21 class BrowserProcessImpl; | 22 class BrowserProcessImpl; |
22 class ChromeBrowserMainExtraParts; | 23 class ChromeBrowserMainExtraParts; |
23 class FieldTrialSynchronizer; | 24 class FieldTrialSynchronizer; |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
90 } | 91 } |
91 const CommandLine& parsed_command_line() const { | 92 const CommandLine& parsed_command_line() const { |
92 return parsed_command_line_; | 93 return parsed_command_line_; |
93 } | 94 } |
94 | 95 |
95 Profile* profile() { return profile_; } | 96 Profile* profile() { return profile_; } |
96 | 97 |
97 const PrefService* local_state() const { return local_state_; } | 98 const PrefService* local_state() const { return local_state_; } |
98 | 99 |
99 private: | 100 private: |
100 // Methods for |EarlyInitialization()| --------------------------------------- | |
101 | |
102 // A/B test for the maximum number of persistent connections per host. | |
103 void ConnectionFieldTrial(); | |
104 | |
105 // A/B test for determining a value for unused socket timeout. | |
106 void SocketTimeoutFieldTrial(); | |
107 | |
108 // A/B test for the maximum number of connections per proxy server. | |
109 void ProxyConnectionsFieldTrial(); | |
110 | |
111 // A/B test for spdy when --use-spdy not set. | |
112 void SpdyFieldTrial(); | |
113 | |
114 // A/B test for warmest socket vs. most recently used socket. | |
115 void WarmConnectionFieldTrial(); | |
116 | |
117 // A/B test for automatically establishing a backup TCP connection when a | |
118 // specified timeout value is reached. | |
119 void ConnectBackupJobsFieldTrial(); | |
120 | |
121 // Field trial to see what disabling DNS pre-resolution does to | |
122 // latency of page loads. | |
123 void PredictorFieldTrial(); | |
124 | |
125 // Field trial to see what effect installing defaults in the NTP apps pane | |
126 // has on retention and general apps/webstore usage. | |
127 void DefaultAppsFieldTrial(); | |
128 | |
129 // A field trial to see what effects launching Chrome automatically on | |
130 // computer startup has on retention and usage of Chrome. | |
131 void AutoLaunchChromeFieldTrial(); | |
132 | |
133 // A collection of one-time-randomized and session-randomized field trials | |
134 // intended to test the uniformity and correctness of the field trial control, | |
135 // bucketing and reporting systems. | |
136 void SetupUniformityFieldTrials(); | |
137 | |
138 // Disables the new tab field trial if not running in desktop mode. | |
139 void DisableNewTabFieldTrialIfNecesssary(); | |
140 | |
141 // Field trial for testing TLS channel id. | |
142 void ChannelIDFieldTrial(); | |
143 | 101 |
144 // Methods for |SetupMetricsAndFieldTrials()| -------------------------------- | 102 // Methods for |SetupMetricsAndFieldTrials()| -------------------------------- |
145 | 103 |
146 // Constructs metrics service and does related initialization, including | 104 // Constructs metrics service and does related initialization, including |
147 // creation of field trials. Call only after labs have been converted to | 105 // creation of field trials. Call only after labs have been converted to |
148 // switches. | 106 // switches. |
149 void SetupMetricsAndFieldTrials(); | 107 void SetupMetricsAndFieldTrials(); |
150 | 108 |
151 // Add an invocation of your field trial init function to this method. | |
152 void SetupFieldTrials(bool proxy_policy_is_set); | |
153 | |
154 // Starts recording of metrics. This can only be called after we have a file | 109 // Starts recording of metrics. This can only be called after we have a file |
155 // thread. | 110 // thread. |
156 void StartMetricsRecording(); | 111 void StartMetricsRecording(); |
157 | 112 |
158 // Returns true if the user opted in to sending metric reports. | 113 // Returns true if the user opted in to sending metric reports. |
159 bool IsMetricsReportingEnabled(); | 114 bool IsMetricsReportingEnabled(); |
160 | 115 |
161 // Methods for Main Message Loop ------------------------------------------- | 116 // Methods for Main Message Loop ------------------------------------------- |
162 | 117 |
163 int PreCreateThreadsImpl(); | 118 int PreCreateThreadsImpl(); |
(...skipping 15 matching lines...) Expand all Loading... |
179 | 134 |
180 // Creating this object starts tracking the creation and deletion of Task | 135 // Creating this object starts tracking the creation and deletion of Task |
181 // instance. This MUST be done before main_message_loop, so that it is | 136 // instance. This MUST be done before main_message_loop, so that it is |
182 // destroyed after the main_message_loop. | 137 // destroyed after the main_message_loop. |
183 task_profiler::AutoTracking tracking_objects_; | 138 task_profiler::AutoTracking tracking_objects_; |
184 | 139 |
185 // Statistical testing infrastructure for the entire browser. NULL until | 140 // Statistical testing infrastructure for the entire browser. NULL until |
186 // SetupMetricsAndFieldTrials is called. | 141 // SetupMetricsAndFieldTrials is called. |
187 scoped_ptr<base::FieldTrialList> field_trial_list_; | 142 scoped_ptr<base::FieldTrialList> field_trial_list_; |
188 | 143 |
| 144 ChromeBrowserFieldTrials browser_field_trials_; |
| 145 |
189 // Vector of additional ChromeBrowserMainExtraParts. | 146 // Vector of additional ChromeBrowserMainExtraParts. |
190 // Parts are deleted in the inverse order they are added. | 147 // Parts are deleted in the inverse order they are added. |
191 std::vector<ChromeBrowserMainExtraParts*> chrome_extra_parts_; | 148 std::vector<ChromeBrowserMainExtraParts*> chrome_extra_parts_; |
192 | 149 |
193 // Members initialized after / released before main_message_loop_ ------------ | 150 // Members initialized after / released before main_message_loop_ ------------ |
194 | 151 |
195 scoped_ptr<StartupBrowserCreator> browser_creator_; | 152 scoped_ptr<StartupBrowserCreator> browser_creator_; |
196 scoped_ptr<BrowserProcessImpl> browser_process_; | 153 scoped_ptr<BrowserProcessImpl> browser_process_; |
197 scoped_refptr<chrome_browser_metrics::TrackingSynchronizer> | 154 scoped_refptr<chrome_browser_metrics::TrackingSynchronizer> |
198 tracking_synchronizer_; | 155 tracking_synchronizer_; |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
242 // Records the time from our process' startup to the present time in | 199 // Records the time from our process' startup to the present time in |
243 // the Startup.BrowserMessageLoopStartTime UMA histogram. | 200 // the Startup.BrowserMessageLoopStartTime UMA histogram. |
244 void RecordBrowserStartupTime(); | 201 void RecordBrowserStartupTime(); |
245 | 202 |
246 // Records a time value to an UMA histogram in the context of the | 203 // Records a time value to an UMA histogram in the context of the |
247 // PreReadExperiment field-trial. This also reports to the appropriate | 204 // PreReadExperiment field-trial. This also reports to the appropriate |
248 // sub-histogram (_PreRead(Enabled|Disabled)). | 205 // sub-histogram (_PreRead(Enabled|Disabled)). |
249 void RecordPreReadExperimentTime(const char* name, base::TimeDelta time); | 206 void RecordPreReadExperimentTime(const char* name, base::TimeDelta time); |
250 | 207 |
251 #endif // CHROME_BROWSER_CHROME_BROWSER_MAIN_H_ | 208 #endif // CHROME_BROWSER_CHROME_BROWSER_MAIN_H_ |
OLD | NEW |