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/io_thread.h" | 5 #include "chrome/browser/io_thread.h" |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/base64.h" | 9 #include "base/base64.h" |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
56 #include "net/dns/host_resolver.h" | 56 #include "net/dns/host_resolver.h" |
57 #include "net/dns/mapped_host_resolver.h" | 57 #include "net/dns/mapped_host_resolver.h" |
58 #include "net/ftp/ftp_network_layer.h" | 58 #include "net/ftp/ftp_network_layer.h" |
59 #include "net/http/http_auth_filter.h" | 59 #include "net/http/http_auth_filter.h" |
60 #include "net/http/http_auth_handler_factory.h" | 60 #include "net/http/http_auth_handler_factory.h" |
61 #include "net/http/http_network_layer.h" | 61 #include "net/http/http_network_layer.h" |
62 #include "net/http/http_server_properties_impl.h" | 62 #include "net/http/http_server_properties_impl.h" |
63 #include "net/proxy/proxy_config_service.h" | 63 #include "net/proxy/proxy_config_service.h" |
64 #include "net/proxy/proxy_script_fetcher_impl.h" | 64 #include "net/proxy/proxy_script_fetcher_impl.h" |
65 #include "net/proxy/proxy_service.h" | 65 #include "net/proxy/proxy_service.h" |
| 66 #include "net/quic/crypto/crypto_protocol.h" |
66 #include "net/quic/quic_protocol.h" | 67 #include "net/quic/quic_protocol.h" |
67 #include "net/socket/tcp_client_socket.h" | 68 #include "net/socket/tcp_client_socket.h" |
68 #include "net/spdy/spdy_session.h" | 69 #include "net/spdy/spdy_session.h" |
69 #include "net/ssl/channel_id_service.h" | 70 #include "net/ssl/channel_id_service.h" |
70 #include "net/ssl/default_channel_id_store.h" | 71 #include "net/ssl/default_channel_id_store.h" |
71 #include "net/url_request/data_protocol_handler.h" | 72 #include "net/url_request/data_protocol_handler.h" |
72 #include "net/url_request/file_protocol_handler.h" | 73 #include "net/url_request/file_protocol_handler.h" |
73 #include "net/url_request/ftp_protocol_handler.h" | 74 #include "net/url_request/ftp_protocol_handler.h" |
74 #include "net/url_request/static_http_user_agent_settings.h" | 75 #include "net/url_request/static_http_user_agent_settings.h" |
75 #include "net/url_request/url_fetcher.h" | 76 #include "net/url_request/url_fetcher.h" |
(...skipping 961 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1037 globals.force_spdy_always.CopyToIfSet(¶ms->force_spdy_always); | 1038 globals.force_spdy_always.CopyToIfSet(¶ms->force_spdy_always); |
1038 params->forced_spdy_exclusions = globals.forced_spdy_exclusions; | 1039 params->forced_spdy_exclusions = globals.forced_spdy_exclusions; |
1039 globals.use_alternate_protocols.CopyToIfSet( | 1040 globals.use_alternate_protocols.CopyToIfSet( |
1040 ¶ms->use_alternate_protocols); | 1041 ¶ms->use_alternate_protocols); |
1041 globals.alternate_protocol_probability_threshold.CopyToIfSet( | 1042 globals.alternate_protocol_probability_threshold.CopyToIfSet( |
1042 ¶ms->alternate_protocol_probability_threshold); | 1043 ¶ms->alternate_protocol_probability_threshold); |
1043 globals.enable_websocket_over_spdy.CopyToIfSet( | 1044 globals.enable_websocket_over_spdy.CopyToIfSet( |
1044 ¶ms->enable_websocket_over_spdy); | 1045 ¶ms->enable_websocket_over_spdy); |
1045 | 1046 |
1046 globals.enable_quic.CopyToIfSet(¶ms->enable_quic); | 1047 globals.enable_quic.CopyToIfSet(¶ms->enable_quic); |
1047 globals.enable_quic_pacing.CopyToIfSet( | |
1048 ¶ms->enable_quic_pacing); | |
1049 globals.enable_quic_time_based_loss_detection.CopyToIfSet( | 1048 globals.enable_quic_time_based_loss_detection.CopyToIfSet( |
1050 ¶ms->enable_quic_time_based_loss_detection); | 1049 ¶ms->enable_quic_time_based_loss_detection); |
1051 globals.enable_quic_port_selection.CopyToIfSet( | 1050 globals.enable_quic_port_selection.CopyToIfSet( |
1052 ¶ms->enable_quic_port_selection); | 1051 ¶ms->enable_quic_port_selection); |
1053 globals.quic_max_packet_length.CopyToIfSet(¶ms->quic_max_packet_length); | 1052 globals.quic_max_packet_length.CopyToIfSet(¶ms->quic_max_packet_length); |
1054 globals.quic_user_agent_id.CopyToIfSet(¶ms->quic_user_agent_id); | 1053 globals.quic_user_agent_id.CopyToIfSet(¶ms->quic_user_agent_id); |
1055 globals.quic_supported_versions.CopyToIfSet( | 1054 globals.quic_supported_versions.CopyToIfSet( |
1056 ¶ms->quic_supported_versions); | 1055 ¶ms->quic_supported_versions); |
1057 params->quic_connection_options = globals.quic_connection_options; | 1056 params->quic_connection_options = globals.quic_connection_options; |
1058 | 1057 |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1151 | 1150 |
1152 // static | 1151 // static |
1153 void IOThread::ConfigureQuicGlobals( | 1152 void IOThread::ConfigureQuicGlobals( |
1154 const base::CommandLine& command_line, | 1153 const base::CommandLine& command_line, |
1155 base::StringPiece quic_trial_group, | 1154 base::StringPiece quic_trial_group, |
1156 const VariationParameters& quic_trial_params, | 1155 const VariationParameters& quic_trial_params, |
1157 IOThread::Globals* globals) { | 1156 IOThread::Globals* globals) { |
1158 bool enable_quic = ShouldEnableQuic(command_line, quic_trial_group); | 1157 bool enable_quic = ShouldEnableQuic(command_line, quic_trial_group); |
1159 globals->enable_quic.set(enable_quic); | 1158 globals->enable_quic.set(enable_quic); |
1160 if (enable_quic) { | 1159 if (enable_quic) { |
1161 globals->enable_quic_pacing.set( | |
1162 ShouldEnableQuicPacing(command_line, quic_trial_group, | |
1163 quic_trial_params)); | |
1164 globals->enable_quic_time_based_loss_detection.set( | 1160 globals->enable_quic_time_based_loss_detection.set( |
1165 ShouldEnableQuicTimeBasedLossDetection(command_line, quic_trial_group, | 1161 ShouldEnableQuicTimeBasedLossDetection(command_line, quic_trial_group, |
1166 quic_trial_params)); | 1162 quic_trial_params)); |
1167 globals->enable_quic_port_selection.set( | 1163 globals->enable_quic_port_selection.set( |
1168 ShouldEnableQuicPortSelection(command_line)); | 1164 ShouldEnableQuicPortSelection(command_line)); |
1169 globals->quic_connection_options = | 1165 globals->quic_connection_options = |
1170 GetQuicConnectionOptions(command_line, quic_trial_params); | 1166 GetQuicConnectionOptions(command_line, quic_trial_params); |
| 1167 if (ShouldEnableQuicPacing(command_line, quic_trial_group, |
| 1168 quic_trial_params)) { |
| 1169 globals->quic_connection_options.push_back(net::kPACE); |
| 1170 } |
1171 } | 1171 } |
1172 | 1172 |
1173 size_t max_packet_length = GetQuicMaxPacketLength(command_line, | 1173 size_t max_packet_length = GetQuicMaxPacketLength(command_line, |
1174 quic_trial_group, | 1174 quic_trial_group, |
1175 quic_trial_params); | 1175 quic_trial_params); |
1176 if (max_packet_length != 0) { | 1176 if (max_packet_length != 0) { |
1177 globals->quic_max_packet_length.set(max_packet_length); | 1177 globals->quic_max_packet_length.set(max_packet_length); |
1178 } | 1178 } |
1179 | 1179 |
1180 std::string quic_user_agent_id = | 1180 std::string quic_user_agent_id = |
(...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1389 net::QuicVersionVector supported_versions = net::QuicSupportedVersions(); | 1389 net::QuicVersionVector supported_versions = net::QuicSupportedVersions(); |
1390 for (size_t i = 0; i < supported_versions.size(); ++i) { | 1390 for (size_t i = 0; i < supported_versions.size(); ++i) { |
1391 net::QuicVersion version = supported_versions[i]; | 1391 net::QuicVersion version = supported_versions[i]; |
1392 if (net::QuicVersionToString(version) == quic_version) { | 1392 if (net::QuicVersionToString(version) == quic_version) { |
1393 return version; | 1393 return version; |
1394 } | 1394 } |
1395 } | 1395 } |
1396 | 1396 |
1397 return net::QUIC_VERSION_UNSUPPORTED; | 1397 return net::QUIC_VERSION_UNSUPPORTED; |
1398 } | 1398 } |
OLD | NEW |