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 807 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
818 trial->AppendGroup("cwndMin10", kSpdyCwndMin10); | 818 trial->AppendGroup("cwndMin10", kSpdyCwndMin10); |
819 | 819 |
820 if (parsed_command_line().HasSwitch(switches::kMaxSpdyConcurrentStreams)) { | 820 if (parsed_command_line().HasSwitch(switches::kMaxSpdyConcurrentStreams)) { |
821 int value = 0; | 821 int value = 0; |
822 base::StringToInt(parsed_command_line().GetSwitchValueASCII( | 822 base::StringToInt(parsed_command_line().GetSwitchValueASCII( |
823 switches::kMaxSpdyConcurrentStreams), | 823 switches::kMaxSpdyConcurrentStreams), |
824 &value); | 824 &value); |
825 if (value > 0) | 825 if (value > 0) |
826 net::SpdySession::set_max_concurrent_streams(value); | 826 net::SpdySession::set_max_concurrent_streams(value); |
827 } | 827 } |
828 | |
829 if (parsed_command_line().HasSwitch(switches::kEnableSpdy3)) { | |
830 net::HttpStreamFactory::EnableSPDY3(); | |
831 } else if (parsed_command_line().HasSwitch( | |
832 switches::kEnableSpdyFlowControl)) { | |
833 net::HttpStreamFactory::EnableFlowControl(); | |
834 } else { | |
835 const base::FieldTrial::Probability kSpdyDivisor = 100; | |
836 base::FieldTrial::Probability flow_control_probability = 5; | |
837 base::FieldTrial::Probability spdy3_probability = 5; | |
838 | |
839 // After October 30, 2012 builds, it will always be in default group | |
840 // (disable_spdy_protocol_test). | |
841 scoped_refptr<base::FieldTrial> trial( | |
842 new base::FieldTrial( | |
843 "SpdyProtocolTest", kSpdyDivisor, "disable_spdy_protocol_test", | |
844 2012, 10, 30)); | |
Ryan Hamilton
2012/03/22 16:30:21
October seems like a long time from now, so this i
ramant (doing other things)
2012/03/22 16:38:24
Just to be on safe side, set the probability to 0.
| |
845 | |
846 int spdy3_grp = trial->AppendGroup("spdy3", spdy3_probability); | |
847 int flow_control_grp = trial->AppendGroup( | |
848 "flow_control", flow_control_probability); | |
849 | |
850 int trial_grp = trial->group(); | |
851 if (trial_grp == spdy3_grp) { | |
852 net::HttpStreamFactory::EnableSPDY3(); | |
853 } else if (trial_grp == flow_control_grp) { | |
854 net::HttpStreamFactory::EnableFlowControl(); | |
855 } | |
856 } | |
828 } | 857 } |
829 | 858 |
830 // If --socket-reuse-policy is not specified, run an A/B test for choosing the | 859 // If --socket-reuse-policy is not specified, run an A/B test for choosing the |
831 // warmest socket. | 860 // warmest socket. |
832 void ChromeBrowserMainParts::WarmConnectionFieldTrial() { | 861 void ChromeBrowserMainParts::WarmConnectionFieldTrial() { |
833 const CommandLine& command_line = parsed_command_line(); | 862 const CommandLine& command_line = parsed_command_line(); |
834 if (command_line.HasSwitch(switches::kSocketReusePolicy)) { | 863 if (command_line.HasSwitch(switches::kSocketReusePolicy)) { |
835 std::string socket_reuse_policy_str = command_line.GetSwitchValueASCII( | 864 std::string socket_reuse_policy_str = command_line.GetSwitchValueASCII( |
836 switches::kSocketReusePolicy); | 865 switches::kSocketReusePolicy); |
837 int policy = -1; | 866 int policy = -1; |
(...skipping 1105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1943 if (base::win::GetVersion() <= base::win::VERSION_XP) | 1972 if (base::win::GetVersion() <= base::win::VERSION_XP) |
1944 uma_name += "_XP"; | 1973 uma_name += "_XP"; |
1945 | 1974 |
1946 uma_name += "_PreRead_"; | 1975 uma_name += "_PreRead_"; |
1947 uma_name += pre_read_percentage; | 1976 uma_name += pre_read_percentage; |
1948 AddPreReadHistogramTime(uma_name.c_str(), time); | 1977 AddPreReadHistogramTime(uma_name.c_str(), time); |
1949 } | 1978 } |
1950 #endif | 1979 #endif |
1951 #endif | 1980 #endif |
1952 } | 1981 } |
OLD | NEW |