| 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/extensions/default_apps_trial.h" | 18 #include "chrome/browser/extensions/default_apps_trial.h" |
| 19 #include "chrome/browser/google/google_util.h" | 19 #include "chrome/browser/google/google_util.h" |
| 20 #include "chrome/browser/gpu_util.h" | 20 #include "chrome/browser/gpu_util.h" |
| 21 #include "chrome/browser/net/predictor.h" | 21 #include "chrome/browser/net/predictor.h" |
| 22 #include "chrome/browser/prerender/prerender_field_trial.h" | 22 #include "chrome/browser/prerender/prerender_field_trial.h" |
| 23 #include "chrome/browser/safe_browsing/safe_browsing_blocking_page.h" |
| 23 #include "chrome/common/chrome_switches.h" | 24 #include "chrome/common/chrome_switches.h" |
| 24 #include "chrome/common/chrome_version_info.h" | 25 #include "chrome/common/chrome_version_info.h" |
| 25 #include "chrome/common/metrics/variations/variations_util.h" | 26 #include "chrome/common/metrics/variations/variations_util.h" |
| 26 #include "net/http/http_network_layer.h" | 27 #include "net/http/http_network_layer.h" |
| 27 #include "net/http/http_stream_factory.h" | 28 #include "net/http/http_stream_factory.h" |
| 28 #include "net/socket/client_socket_pool_base.h" | 29 #include "net/socket/client_socket_pool_base.h" |
| 29 #include "net/socket/client_socket_pool_manager.h" | 30 #include "net/socket/client_socket_pool_manager.h" |
| 30 #include "net/spdy/spdy_session.h" | 31 #include "net/spdy/spdy_session.h" |
| 31 #include "net/spdy/spdy_session_pool.h" | 32 #include "net/spdy/spdy_session_pool.h" |
| 32 #include "ui/base/layout.h" | 33 #include "ui/base/layout.h" |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 117 SpdyFieldTrial(); | 118 SpdyFieldTrial(); |
| 118 ConnectBackupJobsFieldTrial(); | 119 ConnectBackupJobsFieldTrial(); |
| 119 WarmConnectionFieldTrial(); | 120 WarmConnectionFieldTrial(); |
| 120 PredictorFieldTrial(); | 121 PredictorFieldTrial(); |
| 121 DefaultAppsFieldTrial(); | 122 DefaultAppsFieldTrial(); |
| 122 AutoLaunchChromeFieldTrial(); | 123 AutoLaunchChromeFieldTrial(); |
| 123 gpu_util::InitializeCompositingFieldTrial(); | 124 gpu_util::InitializeCompositingFieldTrial(); |
| 124 SetupUniformityFieldTrials(); | 125 SetupUniformityFieldTrials(); |
| 125 AutocompleteFieldTrial::Activate(); | 126 AutocompleteFieldTrial::Activate(); |
| 126 DisableNewTabFieldTrialIfNecesssary(); | 127 DisableNewTabFieldTrialIfNecesssary(); |
| 128 SetUpSafeBrowsingInterstitialFieldTrial(); |
| 127 } | 129 } |
| 128 | 130 |
| 129 // This is an A/B test for the maximum number of persistent connections per | 131 // This is an A/B test for the maximum number of persistent connections per |
| 130 // host. Currently Chrome, Firefox, and IE8 have this value set at 6. Safari | 132 // host. Currently Chrome, Firefox, and IE8 have this value set at 6. Safari |
| 131 // uses 4, and Fasterfox (a plugin for Firefox that supposedly configures it to | 133 // uses 4, and Fasterfox (a plugin for Firefox that supposedly configures it to |
| 132 // run faster) uses 8. We would like to see how much of an effect this value has | 134 // run faster) uses 8. We would like to see how much of an effect this value has |
| 133 // on browsing. Too large a value might cause us to run into SYN flood detection | 135 // on browsing. Too large a value might cause us to run into SYN flood detection |
| 134 // mechanisms. | 136 // mechanisms. |
| 135 void ChromeBrowserFieldTrials::ConnectionFieldTrial() { | 137 void ChromeBrowserFieldTrials::ConnectionFieldTrial() { |
| 136 const base::FieldTrial::Probability kConnectDivisor = 100; | 138 const base::FieldTrial::Probability kConnectDivisor = 100; |
| (...skipping 438 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 575 if (trial) { | 577 if (trial) { |
| 576 bool using_hidpi_assets = false; | 578 bool using_hidpi_assets = false; |
| 577 #if defined(ENABLE_HIDPI) && defined(OS_WIN) | 579 #if defined(ENABLE_HIDPI) && defined(OS_WIN) |
| 578 // Mirrors logic in resource_bundle_win.cc. | 580 // Mirrors logic in resource_bundle_win.cc. |
| 579 using_hidpi_assets = ui::GetDPIScale() > 1.5; | 581 using_hidpi_assets = ui::GetDPIScale() > 1.5; |
| 580 #endif | 582 #endif |
| 581 if (ui::GetDisplayLayout() != ui::LAYOUT_DESKTOP || using_hidpi_assets) | 583 if (ui::GetDisplayLayout() != ui::LAYOUT_DESKTOP || using_hidpi_assets) |
| 582 trial->Disable(); | 584 trial->Disable(); |
| 583 } | 585 } |
| 584 } | 586 } |
| 587 |
| 588 void ChromeBrowserFieldTrials::SetUpSafeBrowsingInterstitialFieldTrial() { |
| 589 const base::FieldTrial::Probability kDivisor = 100; |
| 590 const base::FieldTrial::Probability kVersion2Probability = 50; // 50% prob. |
| 591 scoped_refptr<base::FieldTrial> trial( |
| 592 base::FieldTrialList::FactoryGetFieldTrial("SBInterstitial", kDivisor, |
| 593 "V1", 2012, 9, 19, NULL)); |
| 594 trial->UseOneTimeRandomization(); |
| 595 trial->AppendGroup("V2", kVersion2Probability); |
| 596 } |
| OLD | NEW |