| 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" |
| (...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 120 ConnectBackupJobsFieldTrial(); | 120 ConnectBackupJobsFieldTrial(); |
| 121 WarmConnectionFieldTrial(); | 121 WarmConnectionFieldTrial(); |
| 122 PredictorFieldTrial(); | 122 PredictorFieldTrial(); |
| 123 DefaultAppsFieldTrial(); | 123 DefaultAppsFieldTrial(); |
| 124 AutoLaunchChromeFieldTrial(); | 124 AutoLaunchChromeFieldTrial(); |
| 125 gpu_util::InitializeCompositingFieldTrial(); | 125 gpu_util::InitializeCompositingFieldTrial(); |
| 126 SetupUniformityFieldTrials(); | 126 SetupUniformityFieldTrials(); |
| 127 AutocompleteFieldTrial::Activate(); | 127 AutocompleteFieldTrial::Activate(); |
| 128 DisableNewTabFieldTrialIfNecesssary(); | 128 DisableNewTabFieldTrialIfNecesssary(); |
| 129 SetUpSafeBrowsingInterstitialFieldTrial(); | 129 SetUpSafeBrowsingInterstitialFieldTrial(); |
| 130 SetUpChannelIDFieldTrial(); | |
| 131 SetUpInfiniteCacheFieldTrial(); | 130 SetUpInfiniteCacheFieldTrial(); |
| 132 } | 131 } |
| 133 | 132 |
| 134 // This is an A/B test for the maximum number of persistent connections per | 133 // 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 | 134 // 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 | 135 // 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 | 136 // 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 | 137 // on browsing. Too large a value might cause us to run into SYN flood detection |
| 139 // mechanisms. | 138 // mechanisms. |
| 140 void ChromeBrowserFieldTrials::ConnectionFieldTrial() { | 139 void ChromeBrowserFieldTrials::ConnectionFieldTrial() { |
| (...skipping 394 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 535 void ChromeBrowserFieldTrials::SetUpSafeBrowsingInterstitialFieldTrial() { | 534 void ChromeBrowserFieldTrials::SetUpSafeBrowsingInterstitialFieldTrial() { |
| 536 const base::FieldTrial::Probability kDivisor = 100; | 535 const base::FieldTrial::Probability kDivisor = 100; |
| 537 const base::FieldTrial::Probability kVersion2Probability = 50; // 50% prob. | 536 const base::FieldTrial::Probability kVersion2Probability = 50; // 50% prob. |
| 538 scoped_refptr<base::FieldTrial> trial( | 537 scoped_refptr<base::FieldTrial> trial( |
| 539 base::FieldTrialList::FactoryGetFieldTrial("SBInterstitial", kDivisor, | 538 base::FieldTrialList::FactoryGetFieldTrial("SBInterstitial", kDivisor, |
| 540 "V1", 2012, 9, 19, NULL)); | 539 "V1", 2012, 9, 19, NULL)); |
| 541 trial->UseOneTimeRandomization(); | 540 trial->UseOneTimeRandomization(); |
| 542 trial->AppendGroup("V2", kVersion2Probability); | 541 trial->AppendGroup("V2", kVersion2Probability); |
| 543 } | 542 } |
| 544 | 543 |
| 545 void ChromeBrowserFieldTrials::SetUpChannelIDFieldTrial() { | |
| 546 chrome::VersionInfo::Channel channel = chrome::VersionInfo::GetChannel(); | |
| 547 if (channel == chrome::VersionInfo::CHANNEL_CANARY) { | |
| 548 net::SSLConfigService::EnableChannelIDTrial(); | |
| 549 } else if (channel == chrome::VersionInfo::CHANNEL_DEV && | |
| 550 base::FieldTrialList::IsOneTimeRandomizationEnabled()) { | |
| 551 const base::FieldTrial::Probability kDivisor = 100; | |
| 552 // 10% probability of being in the enabled group. | |
| 553 const base::FieldTrial::Probability kEnableProbability = 10; | |
| 554 scoped_refptr<base::FieldTrial> trial = | |
| 555 base::FieldTrialList::FactoryGetFieldTrial( | |
| 556 "ChannelID", kDivisor, "disable", 2012, 11, 5, NULL); | |
| 557 trial->UseOneTimeRandomization(); | |
| 558 int enable_group = trial->AppendGroup("enable", kEnableProbability); | |
| 559 if (trial->group() == enable_group) | |
| 560 net::SSLConfigService::EnableChannelIDTrial(); | |
| 561 } | |
| 562 } | |
| 563 | |
| 564 void ChromeBrowserFieldTrials::SetUpInfiniteCacheFieldTrial() { | 544 void ChromeBrowserFieldTrials::SetUpInfiniteCacheFieldTrial() { |
| 565 const base::FieldTrial::Probability kDivisor = 100; | 545 const base::FieldTrial::Probability kDivisor = 100; |
| 566 | 546 |
| 567 #if (defined(OS_CHROMEOS) || defined(OS_ANDROID) || defined(OS_IOS)) | 547 #if (defined(OS_CHROMEOS) || defined(OS_ANDROID) || defined(OS_IOS)) |
| 568 const base::FieldTrial::Probability kInfiniteCacheProbability = 0; | 548 const base::FieldTrial::Probability kInfiniteCacheProbability = 0; |
| 569 #else | 549 #else |
| 570 const base::FieldTrial::Probability kInfiniteCacheProbability = 1; | 550 const base::FieldTrial::Probability kInfiniteCacheProbability = 1; |
| 571 #endif | 551 #endif |
| 572 | 552 |
| 573 scoped_refptr<base::FieldTrial> trial( | 553 scoped_refptr<base::FieldTrial> trial( |
| 574 base::FieldTrialList::FactoryGetFieldTrial("InfiniteCache", kDivisor, | 554 base::FieldTrialList::FactoryGetFieldTrial("InfiniteCache", kDivisor, |
| 575 "No", 2013, 12, 31, NULL)); | 555 "No", 2013, 12, 31, NULL)); |
| 576 trial->UseOneTimeRandomization(); | 556 trial->UseOneTimeRandomization(); |
| 577 trial->AppendGroup("Yes", kInfiniteCacheProbability); | 557 trial->AppendGroup("Yes", kInfiniteCacheProbability); |
| 578 trial->AppendGroup("Control", kInfiniteCacheProbability); | 558 trial->AppendGroup("Control", kInfiniteCacheProbability); |
| 579 } | 559 } |
| OLD | NEW |