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 10 matching lines...) Expand all Loading... | |
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/browser/safe_browsing/safe_browsing_blocking_page.h" |
24 #include "chrome/browser/ui/sync/one_click_signin_helper.h" | 24 #include "chrome/browser/ui/sync/one_click_signin_helper.h" |
25 #include "chrome/common/chrome_switches.h" | 25 #include "chrome/common/chrome_switches.h" |
26 #include "chrome/common/chrome_version_info.h" | 26 #include "chrome/common/chrome_version_info.h" |
27 #include "chrome/common/metrics/variations/variations_util.h" | 27 #include "chrome/common/metrics/variations/variations_util.h" |
28 #include "net/http/http_stream_factory.h" | 28 #include "net/http/http_stream_factory.h" |
29 #include "net/socket/client_socket_pool_base.h" | 29 #include "net/socket/client_socket_pool_base.h" |
30 #include "net/socket/client_socket_pool_manager.h" | 30 #include "net/socket/client_socket_pool_manager.h" |
31 #include "net/socket/tcp_client_socket_win.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 |
35 #if defined(OS_WIN) | 36 #if defined(OS_WIN) |
36 #include "ui/base/win/dpi.h" // For DisableNewTabFieldTrialIfNecesssary. | 37 #include "ui/base/win/dpi.h" // For DisableNewTabFieldTrialIfNecesssary. |
37 #endif // defined(OS_WIN) | 38 #endif // defined(OS_WIN) |
38 | 39 |
39 namespace { | 40 namespace { |
40 | 41 |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
122 DefaultAppsFieldTrial(); | 123 DefaultAppsFieldTrial(); |
123 AutoLaunchChromeFieldTrial(); | 124 AutoLaunchChromeFieldTrial(); |
124 gpu_util::InitializeCompositingFieldTrial(); | 125 gpu_util::InitializeCompositingFieldTrial(); |
125 gpu_util::InitializeStage3DFieldTrial(); | 126 gpu_util::InitializeStage3DFieldTrial(); |
126 SetupUniformityFieldTrials(); | 127 SetupUniformityFieldTrials(); |
127 AutocompleteFieldTrial::Activate(); | 128 AutocompleteFieldTrial::Activate(); |
128 DisableNewTabFieldTrialIfNecesssary(); | 129 DisableNewTabFieldTrialIfNecesssary(); |
129 SetUpSafeBrowsingInterstitialFieldTrial(); | 130 SetUpSafeBrowsingInterstitialFieldTrial(); |
130 SetUpInfiniteCacheFieldTrial(); | 131 SetUpInfiniteCacheFieldTrial(); |
131 SetUpCacheSensitivityAnalysisFieldTrial(); | 132 SetUpCacheSensitivityAnalysisFieldTrial(); |
133 WindowsOverlappedTCPReadsFieldTrial(); | |
132 #if defined(ENABLE_ONE_CLICK_SIGNIN) | 134 #if defined(ENABLE_ONE_CLICK_SIGNIN) |
133 OneClickSigninHelper::InitializeFieldTrial(); | 135 OneClickSigninHelper::InitializeFieldTrial(); |
134 #endif | 136 #endif |
135 } | 137 } |
136 | 138 |
137 // This is an A/B test for the maximum number of persistent connections per | 139 // This is an A/B test for the maximum number of persistent connections per |
138 // host. Currently Chrome, Firefox, and IE8 have this value set at 6. Safari | 140 // host. Currently Chrome, Firefox, and IE8 have this value set at 6. Safari |
139 // uses 4, and Fasterfox (a plugin for Firefox that supposedly configures it to | 141 // uses 4, and Fasterfox (a plugin for Firefox that supposedly configures it to |
140 // run faster) uses 8. We would like to see how much of an effect this value has | 142 // run faster) uses 8. We would like to see how much of an effect this value has |
141 // on browsing. Too large a value might cause us to run into SYN flood detection | 143 // on browsing. Too large a value might cause us to run into SYN flood detection |
(...skipping 438 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
580 2012, 12, 31, NULL)); | 582 2012, 12, 31, NULL)); |
581 trial->AppendGroup("ControlA", sensitivity_analysis_probability); | 583 trial->AppendGroup("ControlA", sensitivity_analysis_probability); |
582 trial->AppendGroup("ControlB", sensitivity_analysis_probability); | 584 trial->AppendGroup("ControlB", sensitivity_analysis_probability); |
583 trial->AppendGroup("100A", sensitivity_analysis_probability); | 585 trial->AppendGroup("100A", sensitivity_analysis_probability); |
584 trial->AppendGroup("100B", sensitivity_analysis_probability); | 586 trial->AppendGroup("100B", sensitivity_analysis_probability); |
585 trial->AppendGroup("200A", sensitivity_analysis_probability); | 587 trial->AppendGroup("200A", sensitivity_analysis_probability); |
586 trial->AppendGroup("200B", sensitivity_analysis_probability); | 588 trial->AppendGroup("200B", sensitivity_analysis_probability); |
587 trial->AppendGroup("400A", sensitivity_analysis_probability); | 589 trial->AppendGroup("400A", sensitivity_analysis_probability); |
588 trial->AppendGroup("400B", sensitivity_analysis_probability); | 590 trial->AppendGroup("400B", sensitivity_analysis_probability); |
589 } | 591 } |
592 | |
593 void ChromeBrowserFieldTrials::WindowsOverlappedTCPReadsFieldTrial() { | |
594 #if defined(OS_WIN) | |
595 if (parsed_command_line_.HasSwitch(switches::kOverlappedRead)) { | |
596 std::string option = parsed_command_line_.GetSwitchValueASCII( | |
597 switches::kOverlappedRead); | |
598 if (LowerCaseEqualsASCII(option, "off")) { | |
599 net::TCPClientSocketWin::DisableOverlappedReads(); | |
600 } | |
601 } else { | |
602 base::FieldTrial::Probability kNBREAD_DIVISOR = 2; // 1 in 2 chance | |
603 base::FieldTrial::Probability kNBREAD_GROUP_PROBABILITY = 1; | |
Ryan Sleevi
2012/10/11 18:53:16
Because these are not declared const, please do no
| |
604 scoped_refptr<base::FieldTrial> nbread_trial( | |
605 base::FieldTrialList::FactoryGetFieldTrial("NBReadImpact", | |
606 kNBREAD_DIVISOR, "NBReadStandard", 2015, 1, 1, NULL)); | |
607 int overlapped_reads_disabled_group = | |
608 nbread_trial->AppendGroup("NBReadNonBlocking", | |
Ryan Sleevi
2012/10/11 18:53:16
The names of these probability groups are non-intu
| |
609 kNBREAD_GROUP_PROBABILITY); | |
610 int assigned_group = nbread_trial->group(); | |
611 if (assigned_group == overlapped_reads_disabled_group) { | |
612 net::TCPClientSocketWin::DisableOverlappedReads(); | |
613 } | |
614 } | |
Ryan Sleevi
2012/10/11 18:53:16
nit: Please follow the C++ Guide for horizontal wh
| |
615 #endif | |
616 } | |
617 | |
OLD | NEW |