| 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 <utility> | 7 #include <utility> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/base64.h" | 10 #include "base/base64.h" |
| (...skipping 1203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1214 globals.quic_close_sessions_on_ip_change.CopyToIfSet( | 1214 globals.quic_close_sessions_on_ip_change.CopyToIfSet( |
| 1215 ¶ms->quic_close_sessions_on_ip_change); | 1215 ¶ms->quic_close_sessions_on_ip_change); |
| 1216 globals.quic_idle_connection_timeout_seconds.CopyToIfSet( | 1216 globals.quic_idle_connection_timeout_seconds.CopyToIfSet( |
| 1217 ¶ms->quic_idle_connection_timeout_seconds); | 1217 ¶ms->quic_idle_connection_timeout_seconds); |
| 1218 globals.quic_disable_preconnect_if_0rtt.CopyToIfSet( | 1218 globals.quic_disable_preconnect_if_0rtt.CopyToIfSet( |
| 1219 ¶ms->quic_disable_preconnect_if_0rtt); | 1219 ¶ms->quic_disable_preconnect_if_0rtt); |
| 1220 if (!globals.quic_host_whitelist.empty()) | 1220 if (!globals.quic_host_whitelist.empty()) |
| 1221 params->quic_host_whitelist = globals.quic_host_whitelist; | 1221 params->quic_host_whitelist = globals.quic_host_whitelist; |
| 1222 globals.quic_migrate_sessions_on_network_change.CopyToIfSet( | 1222 globals.quic_migrate_sessions_on_network_change.CopyToIfSet( |
| 1223 ¶ms->quic_migrate_sessions_on_network_change); | 1223 ¶ms->quic_migrate_sessions_on_network_change); |
| 1224 globals.quic_migrate_sessions_early.CopyToIfSet( |
| 1225 ¶ms->quic_migrate_sessions_early); |
| 1224 globals.origin_to_force_quic_on.CopyToIfSet( | 1226 globals.origin_to_force_quic_on.CopyToIfSet( |
| 1225 ¶ms->origin_to_force_quic_on); | 1227 ¶ms->origin_to_force_quic_on); |
| 1226 params->enable_user_alternate_protocol_ports = | 1228 params->enable_user_alternate_protocol_ports = |
| 1227 globals.enable_user_alternate_protocol_ports; | 1229 globals.enable_user_alternate_protocol_ports; |
| 1228 params->enable_token_binding = globals.enable_token_binding; | 1230 params->enable_token_binding = globals.enable_token_binding; |
| 1229 } | 1231 } |
| 1230 | 1232 |
| 1231 base::TimeTicks IOThread::creation_time() const { | 1233 base::TimeTicks IOThread::creation_time() const { |
| 1232 return creation_time_; | 1234 return creation_time_; |
| 1233 } | 1235 } |
| (...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1360 if (idle_connection_timeout_seconds != 0) { | 1362 if (idle_connection_timeout_seconds != 0) { |
| 1361 globals->quic_idle_connection_timeout_seconds.set( | 1363 globals->quic_idle_connection_timeout_seconds.set( |
| 1362 idle_connection_timeout_seconds); | 1364 idle_connection_timeout_seconds); |
| 1363 } | 1365 } |
| 1364 globals->quic_disable_preconnect_if_0rtt.set( | 1366 globals->quic_disable_preconnect_if_0rtt.set( |
| 1365 ShouldQuicDisablePreConnectIfZeroRtt(quic_trial_params)); | 1367 ShouldQuicDisablePreConnectIfZeroRtt(quic_trial_params)); |
| 1366 globals->quic_host_whitelist = | 1368 globals->quic_host_whitelist = |
| 1367 GetQuicHostWhitelist(command_line, quic_trial_params); | 1369 GetQuicHostWhitelist(command_line, quic_trial_params); |
| 1368 globals->quic_migrate_sessions_on_network_change.set( | 1370 globals->quic_migrate_sessions_on_network_change.set( |
| 1369 ShouldQuicMigrateSessionsOnNetworkChange(quic_trial_params)); | 1371 ShouldQuicMigrateSessionsOnNetworkChange(quic_trial_params)); |
| 1372 globals->quic_migrate_sessions_early.set( |
| 1373 ShouldQuicMigrateSessionsEarly(quic_trial_params)); |
| 1370 } | 1374 } |
| 1371 | 1375 |
| 1372 size_t max_packet_length = GetQuicMaxPacketLength(command_line, | 1376 size_t max_packet_length = GetQuicMaxPacketLength(command_line, |
| 1373 quic_trial_params); | 1377 quic_trial_params); |
| 1374 if (max_packet_length != 0) { | 1378 if (max_packet_length != 0) { |
| 1375 globals->quic_max_packet_length.set(max_packet_length); | 1379 globals->quic_max_packet_length.set(max_packet_length); |
| 1376 } | 1380 } |
| 1377 | 1381 |
| 1378 std::string quic_user_agent_id = chrome::GetChannelString(); | 1382 std::string quic_user_agent_id = chrome::GetChannelString(); |
| 1379 if (!quic_user_agent_id.empty()) | 1383 if (!quic_user_agent_id.empty()) |
| (...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1659 } | 1663 } |
| 1660 | 1664 |
| 1661 bool IOThread::ShouldQuicMigrateSessionsOnNetworkChange( | 1665 bool IOThread::ShouldQuicMigrateSessionsOnNetworkChange( |
| 1662 const VariationParameters& quic_trial_params) { | 1666 const VariationParameters& quic_trial_params) { |
| 1663 return base::LowerCaseEqualsASCII( | 1667 return base::LowerCaseEqualsASCII( |
| 1664 GetVariationParam(quic_trial_params, | 1668 GetVariationParam(quic_trial_params, |
| 1665 "migrate_sessions_on_network_change"), | 1669 "migrate_sessions_on_network_change"), |
| 1666 "true"); | 1670 "true"); |
| 1667 } | 1671 } |
| 1668 | 1672 |
| 1673 bool IOThread::ShouldQuicMigrateSessionsEarly( |
| 1674 const VariationParameters& quic_trial_params) { |
| 1675 return base::LowerCaseEqualsASCII( |
| 1676 GetVariationParam(quic_trial_params, "migrate_sessions_early"), "true"); |
| 1677 } |
| 1678 |
| 1669 size_t IOThread::GetQuicMaxPacketLength( | 1679 size_t IOThread::GetQuicMaxPacketLength( |
| 1670 const base::CommandLine& command_line, | 1680 const base::CommandLine& command_line, |
| 1671 const VariationParameters& quic_trial_params) { | 1681 const VariationParameters& quic_trial_params) { |
| 1672 if (command_line.HasSwitch(switches::kQuicMaxPacketLength)) { | 1682 if (command_line.HasSwitch(switches::kQuicMaxPacketLength)) { |
| 1673 unsigned value; | 1683 unsigned value; |
| 1674 if (!base::StringToUint( | 1684 if (!base::StringToUint( |
| 1675 command_line.GetSwitchValueASCII(switches::kQuicMaxPacketLength), | 1685 command_line.GetSwitchValueASCII(switches::kQuicMaxPacketLength), |
| 1676 &value)) { | 1686 &value)) { |
| 1677 return 0; | 1687 return 0; |
| 1678 } | 1688 } |
| (...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1838 std::move(job_factory); | 1848 std::move(job_factory); |
| 1839 | 1849 |
| 1840 context->set_job_factory( | 1850 context->set_job_factory( |
| 1841 globals->proxy_script_fetcher_url_request_job_factory.get()); | 1851 globals->proxy_script_fetcher_url_request_job_factory.get()); |
| 1842 | 1852 |
| 1843 // TODO(rtenneti): We should probably use HttpServerPropertiesManager for the | 1853 // TODO(rtenneti): We should probably use HttpServerPropertiesManager for the |
| 1844 // system URLRequestContext too. There's no reason this should be tied to a | 1854 // system URLRequestContext too. There's no reason this should be tied to a |
| 1845 // profile. | 1855 // profile. |
| 1846 return context; | 1856 return context; |
| 1847 } | 1857 } |
| OLD | NEW |