Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(112)

Side by Side Diff: chrome/browser/io_thread.cc

Issue 1327923002: Migrates QUIC sessions to a new network when old network is (about to be) disconnected. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@home
Patch Set: Added read/write socket error tests. Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 1160 matching lines...) Expand 10 before | Expand all | Expand 10 after
1171 globals.quic_user_agent_id.CopyToIfSet(&params->quic_user_agent_id); 1171 globals.quic_user_agent_id.CopyToIfSet(&params->quic_user_agent_id);
1172 globals.quic_supported_versions.CopyToIfSet( 1172 globals.quic_supported_versions.CopyToIfSet(
1173 &params->quic_supported_versions); 1173 &params->quic_supported_versions);
1174 params->quic_connection_options = globals.quic_connection_options; 1174 params->quic_connection_options = globals.quic_connection_options;
1175 globals.quic_close_sessions_on_ip_change.CopyToIfSet( 1175 globals.quic_close_sessions_on_ip_change.CopyToIfSet(
1176 &params->quic_close_sessions_on_ip_change); 1176 &params->quic_close_sessions_on_ip_change);
1177 globals.quic_idle_connection_timeout_seconds.CopyToIfSet( 1177 globals.quic_idle_connection_timeout_seconds.CopyToIfSet(
1178 &params->quic_idle_connection_timeout_seconds); 1178 &params->quic_idle_connection_timeout_seconds);
1179 globals.quic_disable_preconnect_if_0rtt.CopyToIfSet( 1179 globals.quic_disable_preconnect_if_0rtt.CopyToIfSet(
1180 &params->quic_disable_preconnect_if_0rtt); 1180 &params->quic_disable_preconnect_if_0rtt);
1181 1181 globals.quic_migrate_sessions_on_network_change.CopyToIfSet(
1182 &params->quic_migrate_sessions_on_network_change);
1182 globals.origin_to_force_quic_on.CopyToIfSet( 1183 globals.origin_to_force_quic_on.CopyToIfSet(
1183 &params->origin_to_force_quic_on); 1184 &params->origin_to_force_quic_on);
1184 params->enable_user_alternate_protocol_ports = 1185 params->enable_user_alternate_protocol_ports =
1185 globals.enable_user_alternate_protocol_ports; 1186 globals.enable_user_alternate_protocol_ports;
1186 } 1187 }
1187 1188
1188 base::TimeTicks IOThread::creation_time() const { 1189 base::TimeTicks IOThread::creation_time() const {
1189 return creation_time_; 1190 return creation_time_;
1190 } 1191 }
1191 1192
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after
1310 globals->quic_close_sessions_on_ip_change.set( 1311 globals->quic_close_sessions_on_ip_change.set(
1311 ShouldQuicCloseSessionsOnIpChange(quic_trial_params)); 1312 ShouldQuicCloseSessionsOnIpChange(quic_trial_params));
1312 int idle_connection_timeout_seconds = GetQuicIdleConnectionTimeoutSeconds( 1313 int idle_connection_timeout_seconds = GetQuicIdleConnectionTimeoutSeconds(
1313 quic_trial_params); 1314 quic_trial_params);
1314 if (idle_connection_timeout_seconds != 0) { 1315 if (idle_connection_timeout_seconds != 0) {
1315 globals->quic_idle_connection_timeout_seconds.set( 1316 globals->quic_idle_connection_timeout_seconds.set(
1316 idle_connection_timeout_seconds); 1317 idle_connection_timeout_seconds);
1317 } 1318 }
1318 globals->quic_disable_preconnect_if_0rtt.set( 1319 globals->quic_disable_preconnect_if_0rtt.set(
1319 ShouldQuicDisablePreConnectIfZeroRtt(quic_trial_params)); 1320 ShouldQuicDisablePreConnectIfZeroRtt(quic_trial_params));
1321 globals->quic_migrate_sessions_on_network_change.set(
1322 ShouldQuicMigrateSessionsOnNetworkChange(quic_trial_params));
1320 } 1323 }
1321 1324
1322 size_t max_packet_length = GetQuicMaxPacketLength(command_line, 1325 size_t max_packet_length = GetQuicMaxPacketLength(command_line,
1323 quic_trial_params); 1326 quic_trial_params);
1324 if (max_packet_length != 0) { 1327 if (max_packet_length != 0) {
1325 globals->quic_max_packet_length.set(max_packet_length); 1328 globals->quic_max_packet_length.set(max_packet_length);
1326 } 1329 }
1327 1330
1328 std::string quic_user_agent_id = chrome::GetChannelString(); 1331 std::string quic_user_agent_id = chrome::GetChannelString();
1329 if (!quic_user_agent_id.empty()) 1332 if (!quic_user_agent_id.empty())
(...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after
1567 return value; 1570 return value;
1568 } 1571 }
1569 return 0; 1572 return 0;
1570 } 1573 }
1571 1574
1572 bool IOThread::ShouldQuicDisablePreConnectIfZeroRtt( 1575 bool IOThread::ShouldQuicDisablePreConnectIfZeroRtt(
1573 const VariationParameters& quic_trial_params) { 1576 const VariationParameters& quic_trial_params) {
1574 return base::LowerCaseEqualsASCII( 1577 return base::LowerCaseEqualsASCII(
1575 GetVariationParam(quic_trial_params, "disable_preconnect_if_0rtt"), 1578 GetVariationParam(quic_trial_params, "disable_preconnect_if_0rtt"),
1576 "true"); 1579 "true");
1580
1581 bool IOThread::ShouldQuicMigrateSessionsOnNetworkChange(
1582 const VariationParameters& quic_trial_params) {
1583 return base::LowerCaseEqualsASCII(
1584 GetVariationParam(quic_trial_params,
1585 "migrate_sessions_on_network_change"),
1586 "true");
1587 return false;
1577 } 1588 }
1578 1589
1579 size_t IOThread::GetQuicMaxPacketLength( 1590 size_t IOThread::GetQuicMaxPacketLength(
1580 const base::CommandLine& command_line, 1591 const base::CommandLine& command_line,
1581 const VariationParameters& quic_trial_params) { 1592 const VariationParameters& quic_trial_params) {
1582 if (command_line.HasSwitch(switches::kQuicMaxPacketLength)) { 1593 if (command_line.HasSwitch(switches::kQuicMaxPacketLength)) {
1583 unsigned value; 1594 unsigned value;
1584 if (!base::StringToUint( 1595 if (!base::StringToUint(
1585 command_line.GetSwitchValueASCII(switches::kQuicMaxPacketLength), 1596 command_line.GetSwitchValueASCII(switches::kQuicMaxPacketLength),
1586 &value)) { 1597 &value)) {
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after
1748 std::move(job_factory); 1759 std::move(job_factory);
1749 1760
1750 context->set_job_factory( 1761 context->set_job_factory(
1751 globals->proxy_script_fetcher_url_request_job_factory.get()); 1762 globals->proxy_script_fetcher_url_request_job_factory.get());
1752 1763
1753 // TODO(rtenneti): We should probably use HttpServerPropertiesManager for the 1764 // TODO(rtenneti): We should probably use HttpServerPropertiesManager for the
1754 // system URLRequestContext too. There's no reason this should be tied to a 1765 // system URLRequestContext too. There's no reason this should be tied to a
1755 // profile. 1766 // profile.
1756 return context; 1767 return context;
1757 } 1768 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698