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 1089 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1100 globals.quic_delay_tcp_race.CopyToIfSet(¶ms->quic_delay_tcp_race); | 1100 globals.quic_delay_tcp_race.CopyToIfSet(¶ms->quic_delay_tcp_race); |
1101 globals.enable_quic_port_selection.CopyToIfSet( | 1101 globals.enable_quic_port_selection.CopyToIfSet( |
1102 ¶ms->enable_quic_port_selection); | 1102 ¶ms->enable_quic_port_selection); |
1103 globals.quic_max_packet_length.CopyToIfSet(¶ms->quic_max_packet_length); | 1103 globals.quic_max_packet_length.CopyToIfSet(¶ms->quic_max_packet_length); |
1104 globals.quic_user_agent_id.CopyToIfSet(¶ms->quic_user_agent_id); | 1104 globals.quic_user_agent_id.CopyToIfSet(¶ms->quic_user_agent_id); |
1105 globals.quic_supported_versions.CopyToIfSet( | 1105 globals.quic_supported_versions.CopyToIfSet( |
1106 ¶ms->quic_supported_versions); | 1106 ¶ms->quic_supported_versions); |
1107 params->quic_connection_options = globals.quic_connection_options; | 1107 params->quic_connection_options = globals.quic_connection_options; |
1108 globals.quic_close_sessions_on_ip_change.CopyToIfSet( | 1108 globals.quic_close_sessions_on_ip_change.CopyToIfSet( |
1109 ¶ms->quic_close_sessions_on_ip_change); | 1109 ¶ms->quic_close_sessions_on_ip_change); |
1110 | 1110 globals.quic_migrate_sessions_on_network_change.CopyToIfSet( |
1111 ¶ms->quic_migrate_sessions_on_network_change); | |
1111 globals.origin_to_force_quic_on.CopyToIfSet( | 1112 globals.origin_to_force_quic_on.CopyToIfSet( |
1112 ¶ms->origin_to_force_quic_on); | 1113 ¶ms->origin_to_force_quic_on); |
1113 params->enable_user_alternate_protocol_ports = | 1114 params->enable_user_alternate_protocol_ports = |
1114 globals.enable_user_alternate_protocol_ports; | 1115 globals.enable_user_alternate_protocol_ports; |
1115 } | 1116 } |
1116 | 1117 |
1117 base::TimeTicks IOThread::creation_time() const { | 1118 base::TimeTicks IOThread::creation_time() const { |
1118 return creation_time_; | 1119 return creation_time_; |
1119 } | 1120 } |
1120 | 1121 |
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1235 } | 1236 } |
1236 float packet_loss_threshold = GetQuicPacketLossThreshold(quic_trial_params); | 1237 float packet_loss_threshold = GetQuicPacketLossThreshold(quic_trial_params); |
1237 if (packet_loss_threshold != 0) | 1238 if (packet_loss_threshold != 0) |
1238 globals->quic_packet_loss_threshold.set(packet_loss_threshold); | 1239 globals->quic_packet_loss_threshold.set(packet_loss_threshold); |
1239 globals->enable_quic_port_selection.set( | 1240 globals->enable_quic_port_selection.set( |
1240 ShouldEnableQuicPortSelection(command_line)); | 1241 ShouldEnableQuicPortSelection(command_line)); |
1241 globals->quic_connection_options = | 1242 globals->quic_connection_options = |
1242 GetQuicConnectionOptions(command_line, quic_trial_params); | 1243 GetQuicConnectionOptions(command_line, quic_trial_params); |
1243 globals->quic_close_sessions_on_ip_change.set( | 1244 globals->quic_close_sessions_on_ip_change.set( |
1244 ShouldQuicCloseSessionsOnIpChange(quic_trial_params)); | 1245 ShouldQuicCloseSessionsOnIpChange(quic_trial_params)); |
1246 globals->quic_migrate_sessions_on_network_change.set( | |
1247 ShouldQuicMigrateSessionsOnNetworkChange(quic_trial_params)); | |
1245 } | 1248 } |
1246 | 1249 |
1247 size_t max_packet_length = GetQuicMaxPacketLength(command_line, | 1250 size_t max_packet_length = GetQuicMaxPacketLength(command_line, |
1248 quic_trial_params); | 1251 quic_trial_params); |
1249 if (max_packet_length != 0) { | 1252 if (max_packet_length != 0) { |
1250 globals->quic_max_packet_length.set(max_packet_length); | 1253 globals->quic_max_packet_length.set(max_packet_length); |
1251 } | 1254 } |
1252 | 1255 |
1253 std::string quic_user_agent_id = chrome::GetChannelString(); | 1256 std::string quic_user_agent_id = chrome::GetChannelString(); |
1254 if (!quic_user_agent_id.empty()) | 1257 if (!quic_user_agent_id.empty()) |
(...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1476 GetVariationParam(quic_trial_params, "delay_tcp_race"), "true"); | 1479 GetVariationParam(quic_trial_params, "delay_tcp_race"), "true"); |
1477 } | 1480 } |
1478 | 1481 |
1479 bool IOThread::ShouldQuicCloseSessionsOnIpChange( | 1482 bool IOThread::ShouldQuicCloseSessionsOnIpChange( |
1480 const VariationParameters& quic_trial_params) { | 1483 const VariationParameters& quic_trial_params) { |
1481 return base::LowerCaseEqualsASCII( | 1484 return base::LowerCaseEqualsASCII( |
1482 GetVariationParam(quic_trial_params, "close_sessions_on_ip_change"), | 1485 GetVariationParam(quic_trial_params, "close_sessions_on_ip_change"), |
1483 "true"); | 1486 "true"); |
1484 } | 1487 } |
1485 | 1488 |
1489 bool IOThread::ShouldQuicMigrateSessionsOnNetworkChange( | |
1490 const VariationParameters& quic_trial_params) { | |
1491 return base::LowerCaseEqualsASCII( | |
1492 GetVariationParam(quic_trial_params, | |
1493 "migrate_sessions_on_network_change"), | |
1494 "true"); | |
1495 #endif | |
Ryan Hamilton
2015/11/18 22:23:35
Does this build? Remove this?
Jana
2015/11/21 02:21:22
Yeah -- I fixed it later. I had tried just buildin
| |
1496 return false; | |
1497 } | |
1498 | |
1486 size_t IOThread::GetQuicMaxPacketLength( | 1499 size_t IOThread::GetQuicMaxPacketLength( |
1487 const base::CommandLine& command_line, | 1500 const base::CommandLine& command_line, |
1488 const VariationParameters& quic_trial_params) { | 1501 const VariationParameters& quic_trial_params) { |
1489 if (command_line.HasSwitch(switches::kQuicMaxPacketLength)) { | 1502 if (command_line.HasSwitch(switches::kQuicMaxPacketLength)) { |
1490 unsigned value; | 1503 unsigned value; |
1491 if (!base::StringToUint( | 1504 if (!base::StringToUint( |
1492 command_line.GetSwitchValueASCII(switches::kQuicMaxPacketLength), | 1505 command_line.GetSwitchValueASCII(switches::kQuicMaxPacketLength), |
1493 &value)) { | 1506 &value)) { |
1494 return 0; | 1507 return 0; |
1495 } | 1508 } |
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1654 globals->proxy_script_fetcher_url_request_job_factory = job_factory.Pass(); | 1667 globals->proxy_script_fetcher_url_request_job_factory = job_factory.Pass(); |
1655 | 1668 |
1656 context->set_job_factory( | 1669 context->set_job_factory( |
1657 globals->proxy_script_fetcher_url_request_job_factory.get()); | 1670 globals->proxy_script_fetcher_url_request_job_factory.get()); |
1658 | 1671 |
1659 // TODO(rtenneti): We should probably use HttpServerPropertiesManager for the | 1672 // TODO(rtenneti): We should probably use HttpServerPropertiesManager for the |
1660 // system URLRequestContext too. There's no reason this should be tied to a | 1673 // system URLRequestContext too. There's no reason this should be tied to a |
1661 // profile. | 1674 // profile. |
1662 return context; | 1675 return context; |
1663 } | 1676 } |
OLD | NEW |