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/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 840 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
851 if (parsed_command_line().HasSwitch(switches::kUseSpdy)) { | 851 if (parsed_command_line().HasSwitch(switches::kUseSpdy)) { |
852 std::string spdy_mode = | 852 std::string spdy_mode = |
853 parsed_command_line().GetSwitchValueASCII(switches::kUseSpdy); | 853 parsed_command_line().GetSwitchValueASCII(switches::kUseSpdy); |
854 net::HttpNetworkLayer::EnableSpdy(spdy_mode); | 854 net::HttpNetworkLayer::EnableSpdy(spdy_mode); |
855 } else { | 855 } else { |
856 #if !defined(OS_CHROMEOS) | 856 #if !defined(OS_CHROMEOS) |
857 bool is_spdy_trial = false; | 857 bool is_spdy_trial = false; |
858 const base::FieldTrial::Probability kSpdyDivisor = 100; | 858 const base::FieldTrial::Probability kSpdyDivisor = 100; |
859 base::FieldTrial::Probability npnhttp_probability = 5; | 859 base::FieldTrial::Probability npnhttp_probability = 5; |
860 | 860 |
861 // After June 30, 2011 builds, it will always be in default group. | 861 // After June 30, 2013 builds, it will always be in default group. |
862 scoped_refptr<base::FieldTrial> trial( | 862 scoped_refptr<base::FieldTrial> trial( |
863 new base::FieldTrial( | 863 new base::FieldTrial( |
864 "SpdyImpact", kSpdyDivisor, "npn_with_spdy", 2011, 6, 30)); | 864 "SpdyImpact", kSpdyDivisor, "npn_with_spdy", 2013, 6, 30)); |
865 | 865 |
866 // npn with spdy support is the default. | 866 // npn with spdy support is the default. |
867 int npn_spdy_grp = trial->kDefaultGroupNumber; | 867 int npn_spdy_grp = trial->kDefaultGroupNumber; |
868 | 868 |
869 // npn with only http support, no spdy. | 869 // npn with only http support, no spdy. |
870 int npn_http_grp = trial->AppendGroup("npn_with_http", npnhttp_probability); | 870 int npn_http_grp = trial->AppendGroup("npn_with_http", npnhttp_probability); |
871 | 871 |
872 int trial_grp = trial->group(); | 872 int trial_grp = trial->group(); |
873 if (trial_grp == npn_http_grp) { | 873 if (trial_grp == npn_http_grp) { |
874 is_spdy_trial = true; | 874 is_spdy_trial = true; |
(...skipping 10 matching lines...) Expand all Loading... |
885 #endif // !defined(OS_CHROMEOS) | 885 #endif // !defined(OS_CHROMEOS) |
886 } | 886 } |
887 | 887 |
888 // Setup SPDY CWND Field trial. | 888 // Setup SPDY CWND Field trial. |
889 const base::FieldTrial::Probability kSpdyCwndDivisor = 100; | 889 const base::FieldTrial::Probability kSpdyCwndDivisor = 100; |
890 const base::FieldTrial::Probability kSpdyCwnd16 = 20; // fixed at 16 | 890 const base::FieldTrial::Probability kSpdyCwnd16 = 20; // fixed at 16 |
891 const base::FieldTrial::Probability kSpdyCwnd10 = 20; // fixed at 10 | 891 const base::FieldTrial::Probability kSpdyCwnd10 = 20; // fixed at 10 |
892 const base::FieldTrial::Probability kSpdyCwndMin16 = 20; // no less than 16 | 892 const base::FieldTrial::Probability kSpdyCwndMin16 = 20; // no less than 16 |
893 const base::FieldTrial::Probability kSpdyCwndMin10 = 20; // no less than 10 | 893 const base::FieldTrial::Probability kSpdyCwndMin10 = 20; // no less than 10 |
894 | 894 |
895 // After June 30, 2011 builds, it will always be in default group | 895 // After June 30, 2013 builds, it will always be in default group |
896 // (cwndDynamic). | 896 // (cwndDynamic). |
897 scoped_refptr<base::FieldTrial> trial( | 897 scoped_refptr<base::FieldTrial> trial( |
898 new base::FieldTrial( | 898 new base::FieldTrial( |
899 "SpdyCwnd", kSpdyCwndDivisor, "cwndDynamic", 2011, 6, 30)); | 899 "SpdyCwnd", kSpdyCwndDivisor, "cwndDynamic", 2013, 6, 30)); |
900 | 900 |
901 trial->AppendGroup("cwnd10", kSpdyCwnd10); | 901 trial->AppendGroup("cwnd10", kSpdyCwnd10); |
902 trial->AppendGroup("cwnd16", kSpdyCwnd16); | 902 trial->AppendGroup("cwnd16", kSpdyCwnd16); |
903 trial->AppendGroup("cwndMin16", kSpdyCwndMin16); | 903 trial->AppendGroup("cwndMin16", kSpdyCwndMin16); |
904 trial->AppendGroup("cwndMin10", kSpdyCwndMin10); | 904 trial->AppendGroup("cwndMin10", kSpdyCwndMin10); |
905 | 905 |
906 if (parsed_command_line().HasSwitch(switches::kMaxSpdyConcurrentStreams)) { | 906 if (parsed_command_line().HasSwitch(switches::kMaxSpdyConcurrentStreams)) { |
907 int value = 0; | 907 int value = 0; |
908 base::StringToInt(parsed_command_line().GetSwitchValueASCII( | 908 base::StringToInt(parsed_command_line().GetSwitchValueASCII( |
909 switches::kMaxSpdyConcurrentStreams), | 909 switches::kMaxSpdyConcurrentStreams), |
(...skipping 1132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2042 if (env->GetVar(chrome::kPreReadEnvironmentVariable, &pre_read) && | 2042 if (env->GetVar(chrome::kPreReadEnvironmentVariable, &pre_read) && |
2043 (pre_read == "0" || pre_read == "1")) { | 2043 (pre_read == "0" || pre_read == "1")) { |
2044 std::string uma_name(name); | 2044 std::string uma_name(name); |
2045 uma_name += "_PreRead"; | 2045 uma_name += "_PreRead"; |
2046 uma_name += pre_read == "1" ? "Enabled" : "Disabled"; | 2046 uma_name += pre_read == "1" ? "Enabled" : "Disabled"; |
2047 AddPreReadHistogramTime(uma_name.c_str(), time); | 2047 AddPreReadHistogramTime(uma_name.c_str(), time); |
2048 } | 2048 } |
2049 #endif | 2049 #endif |
2050 #endif | 2050 #endif |
2051 } | 2051 } |
OLD | NEW |