| 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. |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 71 // Instantiates dynamic trials by querying their state, to ensure they get | 71 // Instantiates dynamic trials by querying their state, to ensure they get |
| 72 // reported as used. | 72 // reported as used. |
| 73 void InstantiateDynamicTrials(); | 73 void InstantiateDynamicTrials(); |
| 74 | 74 |
| 75 const CommandLine& parsed_command_line_; | 75 const CommandLine& parsed_command_line_; |
| 76 | 76 |
| 77 DISALLOW_COPY_AND_ASSIGN(ChromeBrowserFieldTrials); | 77 DISALLOW_COPY_AND_ASSIGN(ChromeBrowserFieldTrials); |
| 78 }; | 78 }; |
| 79 | 79 |
| 80 #endif // CHROME_BROWSER_CHROME_BROWSER_FIELD_TRIALS_H_ | 80 #endif // CHROME_BROWSER_CHROME_BROWSER_FIELD_TRIALS_H_ |
| OLD | NEW |