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_FIELD_TRIALS_H_ | 5 #ifndef CHROME_BROWSER_CHROME_BROWSER_FIELD_TRIALS_H_ |
6 #define CHROME_BROWSER_CHROME_BROWSER_FIELD_TRIALS_H_ | 6 #define CHROME_BROWSER_CHROME_BROWSER_FIELD_TRIALS_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/gtest_prod_util.h" | 10 #include "base/gtest_prod_util.h" |
11 #include "base/time.h" | 11 #include "base/time.h" |
12 | 12 |
| 13 class PrefService; |
| 14 |
13 class ChromeBrowserFieldTrials { | 15 class ChromeBrowserFieldTrials { |
14 public: | 16 public: |
15 explicit ChromeBrowserFieldTrials(const CommandLine& command_line); | 17 explicit ChromeBrowserFieldTrials(const CommandLine& command_line); |
16 ~ChromeBrowserFieldTrials(); | 18 ~ChromeBrowserFieldTrials(); |
17 | 19 |
18 // Called by the browser main sequence to set up Field Trials for this client. | 20 // Called by the browser main sequence to set up Field Trials for this client. |
19 // |install_time| is the time this browser was installed (or the last time | 21 // |local_state| is used to extract properties like install time. |
20 // prefs was reset). |install_time| is used by trials that are only created | 22 void SetupFieldTrials(PrefService* local_state); |
21 // for new installs of the browser. | |
22 void SetupFieldTrials(const base::Time& install_time); | |
23 | 23 |
24 private: | 24 private: |
25 FRIEND_TEST_ALL_PREFIXES(BrowserMainTest, | 25 FRIEND_TEST_ALL_PREFIXES(BrowserMainTest, |
26 WarmConnectionFieldTrial_WarmestSocket); | 26 WarmConnectionFieldTrial_WarmestSocket); |
27 FRIEND_TEST_ALL_PREFIXES(BrowserMainTest, WarmConnectionFieldTrial_Random); | 27 FRIEND_TEST_ALL_PREFIXES(BrowserMainTest, WarmConnectionFieldTrial_Random); |
28 FRIEND_TEST_ALL_PREFIXES(BrowserMainTest, WarmConnectionFieldTrial_Invalid); | 28 FRIEND_TEST_ALL_PREFIXES(BrowserMainTest, WarmConnectionFieldTrial_Invalid); |
29 | 29 |
30 // Sets up common desktop-only field trials. | 30 // Sets up common desktop-only field trials. |
31 // Add an invocation of your field trial init function to this method, or to | 31 // Add an invocation of your field trial init function to this method, or to |
32 // SetupFieldTrials if it is for all platforms. | 32 // SetupFieldTrials if it is for all platforms. |
33 void SetupDesktopFieldTrials(); | 33 // |local_state| is needed by some other methods called from within this one. |
| 34 void SetupDesktopFieldTrials(PrefService* local_state); |
| 35 |
| 36 // This is not quite a field trial initialization, but it's an initialization |
| 37 // that depends on a field trial, so why not? :-) |
| 38 // |local_state| is needed to reset a local pref based on the chosen group. |
| 39 void SetupAppLauncherFieldTrial(PrefService* local_state); |
34 | 40 |
35 // A/B test for spdy when --use-spdy not set. | 41 // A/B test for spdy when --use-spdy not set. |
36 void SpdyFieldTrial(); | 42 void SpdyFieldTrial(); |
37 | 43 |
38 // A/B test for warmest socket vs. most recently used socket. | 44 // A/B test for warmest socket vs. most recently used socket. |
39 void WarmConnectionFieldTrial(); | 45 void WarmConnectionFieldTrial(); |
40 | 46 |
41 // Field trial to see what disabling DNS pre-resolution does to | 47 // Field trial to see what disabling DNS pre-resolution does to |
42 // latency of page loads. | 48 // latency of page loads. |
43 void PredictorFieldTrial(); | 49 void PredictorFieldTrial(); |
(...skipping 27 matching lines...) Expand all Loading... |
71 // Instantiates dynamic trials by querying their state, to ensure they get | 77 // Instantiates dynamic trials by querying their state, to ensure they get |
72 // reported as used. | 78 // reported as used. |
73 void InstantiateDynamicTrials(); | 79 void InstantiateDynamicTrials(); |
74 | 80 |
75 const CommandLine& parsed_command_line_; | 81 const CommandLine& parsed_command_line_; |
76 | 82 |
77 DISALLOW_COPY_AND_ASSIGN(ChromeBrowserFieldTrials); | 83 DISALLOW_COPY_AND_ASSIGN(ChromeBrowserFieldTrials); |
78 }; | 84 }; |
79 | 85 |
80 #endif // CHROME_BROWSER_CHROME_BROWSER_FIELD_TRIALS_H_ | 86 #endif // CHROME_BROWSER_CHROME_BROWSER_FIELD_TRIALS_H_ |
OLD | NEW |