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