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_main.h" | 5 #include "chrome/browser/chrome_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 815 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
826 trial->AppendGroup("cwndMin10", kSpdyCwndMin10); | 826 trial->AppendGroup("cwndMin10", kSpdyCwndMin10); |
827 | 827 |
828 if (parsed_command_line().HasSwitch(switches::kMaxSpdyConcurrentStreams)) { | 828 if (parsed_command_line().HasSwitch(switches::kMaxSpdyConcurrentStreams)) { |
829 int value = 0; | 829 int value = 0; |
830 base::StringToInt(parsed_command_line().GetSwitchValueASCII( | 830 base::StringToInt(parsed_command_line().GetSwitchValueASCII( |
831 switches::kMaxSpdyConcurrentStreams), | 831 switches::kMaxSpdyConcurrentStreams), |
832 &value); | 832 &value); |
833 if (value > 0) | 833 if (value > 0) |
834 net::SpdySession::set_max_concurrent_streams(value); | 834 net::SpdySession::set_max_concurrent_streams(value); |
835 } | 835 } |
| 836 |
| 837 if (parsed_command_line().HasSwitch(switches::kEnableSpdy3)) { |
| 838 net::HttpStreamFactory::EnableSPDY3(); |
| 839 } else if (parsed_command_line().HasSwitch( |
| 840 switches::kEnableSpdyFlowControl)) { |
| 841 net::HttpStreamFactory::EnableFlowControl(); |
| 842 } else { |
| 843 const base::FieldTrial::Probability kSpdyDivisor = 100; |
| 844 base::FieldTrial::Probability flow_control_probability = 5; |
| 845 base::FieldTrial::Probability spdy3_probability = 0; |
| 846 |
| 847 // After October 30, 2012 builds, it will always be in default group |
| 848 // (disable_spdy_protocol_test). |
| 849 scoped_refptr<base::FieldTrial> trial( |
| 850 new base::FieldTrial( |
| 851 "SpdyProtocolTest", kSpdyDivisor, "disable_spdy_protocol_test", |
| 852 2012, 10, 30)); |
| 853 |
| 854 int spdy3_grp = trial->AppendGroup("spdy3", spdy3_probability); |
| 855 int flow_control_grp = trial->AppendGroup( |
| 856 "flow_control", flow_control_probability); |
| 857 |
| 858 int trial_grp = trial->group(); |
| 859 if (trial_grp == spdy3_grp) { |
| 860 net::HttpStreamFactory::EnableSPDY3(); |
| 861 } else if (trial_grp == flow_control_grp) { |
| 862 net::HttpStreamFactory::EnableFlowControl(); |
| 863 } |
| 864 } |
836 } | 865 } |
837 | 866 |
838 // If --socket-reuse-policy is not specified, run an A/B test for choosing the | 867 // If --socket-reuse-policy is not specified, run an A/B test for choosing the |
839 // warmest socket. | 868 // warmest socket. |
840 void ChromeBrowserMainParts::WarmConnectionFieldTrial() { | 869 void ChromeBrowserMainParts::WarmConnectionFieldTrial() { |
841 const CommandLine& command_line = parsed_command_line(); | 870 const CommandLine& command_line = parsed_command_line(); |
842 if (command_line.HasSwitch(switches::kSocketReusePolicy)) { | 871 if (command_line.HasSwitch(switches::kSocketReusePolicy)) { |
843 std::string socket_reuse_policy_str = command_line.GetSwitchValueASCII( | 872 std::string socket_reuse_policy_str = command_line.GetSwitchValueASCII( |
844 switches::kSocketReusePolicy); | 873 switches::kSocketReusePolicy); |
845 int policy = -1; | 874 int policy = -1; |
(...skipping 1123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1969 if (base::win::GetVersion() <= base::win::VERSION_XP) | 1998 if (base::win::GetVersion() <= base::win::VERSION_XP) |
1970 uma_name += "_XP"; | 1999 uma_name += "_XP"; |
1971 | 2000 |
1972 uma_name += "_PreRead_"; | 2001 uma_name += "_PreRead_"; |
1973 uma_name += pre_read_percentage; | 2002 uma_name += pre_read_percentage; |
1974 AddPreReadHistogramTime(uma_name.c_str(), time); | 2003 AddPreReadHistogramTime(uma_name.c_str(), time); |
1975 } | 2004 } |
1976 #endif | 2005 #endif |
1977 #endif | 2006 #endif |
1978 } | 2007 } |
OLD | NEW |