| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/browser_main.h" | 5 #include "chrome/browser/browser_main.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 224 // This will be called after the command-line has been mutated by about:flags | 224 // This will be called after the command-line has been mutated by about:flags |
| 225 void BrowserMainParts::SetupFieldTrials() { | 225 void BrowserMainParts::SetupFieldTrials() { |
| 226 // Note: make sure to call ConnectionFieldTrial() before | 226 // Note: make sure to call ConnectionFieldTrial() before |
| 227 // ProxyConnectionsFieldTrial(). | 227 // ProxyConnectionsFieldTrial(). |
| 228 ConnectionFieldTrial(); | 228 ConnectionFieldTrial(); |
| 229 SocketTimeoutFieldTrial(); | 229 SocketTimeoutFieldTrial(); |
| 230 ProxyConnectionsFieldTrial(); | 230 ProxyConnectionsFieldTrial(); |
| 231 PrefetchAndPrerenderFieldTrial(); | 231 PrefetchAndPrerenderFieldTrial(); |
| 232 SpdyFieldTrial(); | 232 SpdyFieldTrial(); |
| 233 ConnectBackupJobsFieldTrial(); | 233 ConnectBackupJobsFieldTrial(); |
| 234 SSLFalseStartFieldTrial(); |
| 234 } | 235 } |
| 235 | 236 |
| 236 // This is an A/B test for the maximum number of persistent connections per | 237 // This is an A/B test for the maximum number of persistent connections per |
| 237 // host. Currently Chrome, Firefox, and IE8 have this value set at 6. Safari | 238 // host. Currently Chrome, Firefox, and IE8 have this value set at 6. Safari |
| 238 // uses 4, and Fasterfox (a plugin for Firefox that supposedly configures it to | 239 // uses 4, and Fasterfox (a plugin for Firefox that supposedly configures it to |
| 239 // run faster) uses 8. We would like to see how much of an effect this value has | 240 // run faster) uses 8. We would like to see how much of an effect this value has |
| 240 // on browsing. Too large a value might cause us to run into SYN flood detection | 241 // on browsing. Too large a value might cause us to run into SYN flood detection |
| 241 // mechanisms. | 242 // mechanisms. |
| 242 void BrowserMainParts::ConnectionFieldTrial() { | 243 void BrowserMainParts::ConnectionFieldTrial() { |
| 243 const base::FieldTrial::Probability kConnectDivisor = 100; | 244 const base::FieldTrial::Probability kConnectDivisor = 100; |
| (...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 422 if (parsed_command_line().HasSwitch(switches::kMaxSpdyConcurrentStreams)) { | 423 if (parsed_command_line().HasSwitch(switches::kMaxSpdyConcurrentStreams)) { |
| 423 int value = 0; | 424 int value = 0; |
| 424 base::StringToInt(parsed_command_line().GetSwitchValueASCII( | 425 base::StringToInt(parsed_command_line().GetSwitchValueASCII( |
| 425 switches::kMaxSpdyConcurrentStreams), | 426 switches::kMaxSpdyConcurrentStreams), |
| 426 &value); | 427 &value); |
| 427 if (value > 0) | 428 if (value > 0) |
| 428 net::SpdySession::set_max_concurrent_streams(value); | 429 net::SpdySession::set_max_concurrent_streams(value); |
| 429 } | 430 } |
| 430 } | 431 } |
| 431 | 432 |
| 433 void BrowserMainParts::SSLFalseStartFieldTrial() { |
| 434 if (parsed_command_line().HasSwitch(switches::kDisableSSLFalseStart)) { |
| 435 net::SSLConfigService::DisableFalseStart(); |
| 436 return; |
| 437 } |
| 438 |
| 439 const base::FieldTrial::Probability kDivisor = 100; |
| 440 base::FieldTrial::Probability falsestart_probability = 50; // 50/50 trial |
| 441 |
| 442 // After July 30, 2011 builds, it will always be in default group. |
| 443 scoped_refptr<base::FieldTrial> trial( |
| 444 new base::FieldTrial( |
| 445 "SSLFalseStart", kDivisor, "FalseStart_enabled", 2011, 7, 30)); |
| 446 |
| 447 int disabled_group = trial->AppendGroup("FalseStart_disabled", |
| 448 falsestart_probability); |
| 449 |
| 450 int trial_grp = trial->group(); |
| 451 if (trial_grp == disabled_group) |
| 452 net::SSLConfigService::DisableFalseStart(); |
| 453 } |
| 454 |
| 432 // Parse the --prerender= command line switch, which controls both prerendering | 455 // Parse the --prerender= command line switch, which controls both prerendering |
| 433 // and prefetching. If the switch is unset, or is set to "auto", then the user | 456 // and prefetching. If the switch is unset, or is set to "auto", then the user |
| 434 // is assigned to a field trial. | 457 // is assigned to a field trial. |
| 435 void BrowserMainParts::PrefetchAndPrerenderFieldTrial() { | 458 void BrowserMainParts::PrefetchAndPrerenderFieldTrial() { |
| 436 enum PrerenderOption { | 459 enum PrerenderOption { |
| 437 PRERENDER_OPTION_AUTO, | 460 PRERENDER_OPTION_AUTO, |
| 438 PRERENDER_OPTION_DISABLED, | 461 PRERENDER_OPTION_DISABLED, |
| 439 PRERENDER_OPTION_ENABLED, | 462 PRERENDER_OPTION_ENABLED, |
| 440 PRERENDER_OPTION_PREFETCH_ONLY, | 463 PRERENDER_OPTION_PREFETCH_ONLY, |
| 441 }; | 464 }; |
| (...skipping 1409 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1851 #if defined(OS_CHROMEOS) | 1874 #if defined(OS_CHROMEOS) |
| 1852 // To be precise, logout (browser shutdown) is not yet done, but the | 1875 // To be precise, logout (browser shutdown) is not yet done, but the |
| 1853 // remaining work is negligible, hence we say LogoutDone here. | 1876 // remaining work is negligible, hence we say LogoutDone here. |
| 1854 chromeos::BootTimesLoader::Get()->AddLogoutTimeMarker("LogoutDone", | 1877 chromeos::BootTimesLoader::Get()->AddLogoutTimeMarker("LogoutDone", |
| 1855 false); | 1878 false); |
| 1856 chromeos::BootTimesLoader::Get()->WriteLogoutTimes(); | 1879 chromeos::BootTimesLoader::Get()->WriteLogoutTimes(); |
| 1857 #endif | 1880 #endif |
| 1858 TRACE_EVENT_END("BrowserMain", 0, 0); | 1881 TRACE_EVENT_END("BrowserMain", 0, 0); |
| 1859 return result_code; | 1882 return result_code; |
| 1860 } | 1883 } |
| OLD | NEW |