| 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 #include "chrome/browser/chrome_browser_field_trials.h" | 5 #include "chrome/browser/chrome_browser_field_trials.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/metrics/field_trial.h" | 10 #include "base/metrics/field_trial.h" |
| 11 #include "base/string_number_conversions.h" | 11 #include "base/string_number_conversions.h" |
| 12 #include "base/string_util.h" | 12 #include "base/string_util.h" |
| 13 #include "base/stringprintf.h" | 13 #include "base/stringprintf.h" |
| 14 #include "base/sys_string_conversions.h" | 14 #include "base/sys_string_conversions.h" |
| 15 #include "base/utf_string_conversions.h" | 15 #include "base/utf_string_conversions.h" |
| 16 #include "chrome/browser/auto_launch_trial.h" | 16 #include "chrome/browser/auto_launch_trial.h" |
| 17 #include "chrome/browser/autocomplete/autocomplete_field_trial.h" | 17 #include "chrome/browser/autocomplete/autocomplete_field_trial.h" |
| 18 #include "chrome/browser/chrome_gpu_util.h" | 18 #include "chrome/browser/chrome_gpu_util.h" |
| 19 #include "chrome/browser/extensions/default_apps_trial.h" | 19 #include "chrome/browser/extensions/default_apps_trial.h" |
| 20 #include "chrome/browser/google/google_util.h" | 20 #include "chrome/browser/google/google_util.h" |
| 21 #include "chrome/browser/instant/instant_field_trials.h" | 21 #include "chrome/browser/instant/instant_field_trials.h" |
| 22 #include "chrome/browser/net/predictor.h" | 22 #include "chrome/browser/net/predictor.h" |
| 23 #include "chrome/browser/prerender/prerender_field_trial.h" | 23 #include "chrome/browser/prerender/prerender_field_trial.h" |
| 24 #include "chrome/browser/safe_browsing/safe_browsing_blocking_page.h" | 24 #include "chrome/browser/safe_browsing/safe_browsing_blocking_page.h" |
| 25 #include "chrome/browser/ui/sync/one_click_signin_helper.h" |
| 25 #include "chrome/common/chrome_switches.h" | 26 #include "chrome/common/chrome_switches.h" |
| 26 #include "chrome/common/chrome_version_info.h" | 27 #include "chrome/common/chrome_version_info.h" |
| 27 #include "chrome/common/metrics/variations/variations_util.h" | 28 #include "chrome/common/metrics/variations/variations_util.h" |
| 28 #include "net/http/http_stream_factory.h" | 29 #include "net/http/http_stream_factory.h" |
| 29 #include "net/socket/client_socket_pool_base.h" | 30 #include "net/socket/client_socket_pool_base.h" |
| 30 #include "net/socket/client_socket_pool_manager.h" | 31 #include "net/socket/client_socket_pool_manager.h" |
| 31 #include "net/spdy/spdy_session.h" | 32 #include "net/spdy/spdy_session.h" |
| 32 #include "net/spdy/spdy_session_pool.h" | 33 #include "net/spdy/spdy_session_pool.h" |
| 33 #include "ui/base/layout.h" | 34 #include "ui/base/layout.h" |
| 34 | 35 |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 122 PredictorFieldTrial(); | 123 PredictorFieldTrial(); |
| 123 DefaultAppsFieldTrial(); | 124 DefaultAppsFieldTrial(); |
| 124 AutoLaunchChromeFieldTrial(); | 125 AutoLaunchChromeFieldTrial(); |
| 125 gpu_util::InitializeCompositingFieldTrial(); | 126 gpu_util::InitializeCompositingFieldTrial(); |
| 126 SetupUniformityFieldTrials(); | 127 SetupUniformityFieldTrials(); |
| 127 AutocompleteFieldTrial::Activate(); | 128 AutocompleteFieldTrial::Activate(); |
| 128 DisableNewTabFieldTrialIfNecesssary(); | 129 DisableNewTabFieldTrialIfNecesssary(); |
| 129 SetUpSafeBrowsingInterstitialFieldTrial(); | 130 SetUpSafeBrowsingInterstitialFieldTrial(); |
| 130 SetUpChannelIDFieldTrial(); | 131 SetUpChannelIDFieldTrial(); |
| 131 SetUpInfiniteCacheFieldTrial(); | 132 SetUpInfiniteCacheFieldTrial(); |
| 133 #if defined(ENABLE_ONE_CLICK_SIGNIN) |
| 134 OneClickSigninHelper::InitializeFieldTrial(); |
| 135 #endif |
| 132 } | 136 } |
| 133 | 137 |
| 134 // This is an A/B test for the maximum number of persistent connections per | 138 // This is an A/B test for the maximum number of persistent connections per |
| 135 // host. Currently Chrome, Firefox, and IE8 have this value set at 6. Safari | 139 // host. Currently Chrome, Firefox, and IE8 have this value set at 6. Safari |
| 136 // uses 4, and Fasterfox (a plugin for Firefox that supposedly configures it to | 140 // uses 4, and Fasterfox (a plugin for Firefox that supposedly configures it to |
| 137 // run faster) uses 8. We would like to see how much of an effect this value has | 141 // run faster) uses 8. We would like to see how much of an effect this value has |
| 138 // on browsing. Too large a value might cause us to run into SYN flood detection | 142 // on browsing. Too large a value might cause us to run into SYN flood detection |
| 139 // mechanisms. | 143 // mechanisms. |
| 140 void ChromeBrowserFieldTrials::ConnectionFieldTrial() { | 144 void ChromeBrowserFieldTrials::ConnectionFieldTrial() { |
| 141 const base::FieldTrial::Probability kConnectDivisor = 100; | 145 const base::FieldTrial::Probability kConnectDivisor = 100; |
| (...skipping 428 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 570 const base::FieldTrial::Probability kInfiniteCacheProbability = 1; | 574 const base::FieldTrial::Probability kInfiniteCacheProbability = 1; |
| 571 #endif | 575 #endif |
| 572 | 576 |
| 573 scoped_refptr<base::FieldTrial> trial( | 577 scoped_refptr<base::FieldTrial> trial( |
| 574 base::FieldTrialList::FactoryGetFieldTrial("InfiniteCache", kDivisor, | 578 base::FieldTrialList::FactoryGetFieldTrial("InfiniteCache", kDivisor, |
| 575 "No", 2013, 12, 31, NULL)); | 579 "No", 2013, 12, 31, NULL)); |
| 576 trial->UseOneTimeRandomization(); | 580 trial->UseOneTimeRandomization(); |
| 577 trial->AppendGroup("Yes", kInfiniteCacheProbability); | 581 trial->AppendGroup("Yes", kInfiniteCacheProbability); |
| 578 trial->AppendGroup("Control", kInfiniteCacheProbability); | 582 trial->AppendGroup("Control", kInfiniteCacheProbability); |
| 579 } | 583 } |
| OLD | NEW |