OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 "components/network_session_configurator/network_session_configurator.h
" | 5 #include "components/network_session_configurator/network_session_configurator.h
" |
6 | 6 |
7 #include <map> | 7 #include <map> |
8 | 8 |
9 #include "base/metrics/field_trial.h" | 9 #include "base/metrics/field_trial.h" |
10 #include "base/strings/string_number_conversions.h" | 10 #include "base/strings/string_number_conversions.h" |
(...skipping 328 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
339 "migrate_sessions_on_network_change"), | 339 "migrate_sessions_on_network_change"), |
340 "true"); | 340 "true"); |
341 } | 341 } |
342 | 342 |
343 bool ShouldQuicMigrateSessionsEarly( | 343 bool ShouldQuicMigrateSessionsEarly( |
344 const VariationParameters& quic_trial_params) { | 344 const VariationParameters& quic_trial_params) { |
345 return base::LowerCaseEqualsASCII( | 345 return base::LowerCaseEqualsASCII( |
346 GetVariationParam(quic_trial_params, "migrate_sessions_early"), "true"); | 346 GetVariationParam(quic_trial_params, "migrate_sessions_early"), "true"); |
347 } | 347 } |
348 | 348 |
| 349 bool ShouldQuicRaceCertVerification( |
| 350 const VariationParameters& quic_trial_params) { |
| 351 return base::LowerCaseEqualsASCII( |
| 352 GetVariationParam(quic_trial_params, "race_cert_verification"), "true"); |
| 353 } |
| 354 |
349 size_t GetQuicMaxPacketLength(const base::CommandLine& command_line, | 355 size_t GetQuicMaxPacketLength(const base::CommandLine& command_line, |
350 const VariationParameters& quic_trial_params) { | 356 const VariationParameters& quic_trial_params) { |
351 if (command_line.HasSwitch(switches::kQuicMaxPacketLength)) { | 357 if (command_line.HasSwitch(switches::kQuicMaxPacketLength)) { |
352 unsigned value; | 358 unsigned value; |
353 if (!base::StringToUint( | 359 if (!base::StringToUint( |
354 command_line.GetSwitchValueASCII(switches::kQuicMaxPacketLength), | 360 command_line.GetSwitchValueASCII(switches::kQuicMaxPacketLength), |
355 &value)) { | 361 &value)) { |
356 return 0; | 362 return 0; |
357 } | 363 } |
358 return value; | 364 return value; |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
448 idle_connection_timeout_seconds; | 454 idle_connection_timeout_seconds; |
449 } | 455 } |
450 params->quic_disable_preconnect_if_0rtt = | 456 params->quic_disable_preconnect_if_0rtt = |
451 ShouldQuicDisablePreConnectIfZeroRtt(quic_trial_params); | 457 ShouldQuicDisablePreConnectIfZeroRtt(quic_trial_params); |
452 params->quic_host_whitelist = | 458 params->quic_host_whitelist = |
453 GetQuicHostWhitelist(command_line, quic_trial_params); | 459 GetQuicHostWhitelist(command_line, quic_trial_params); |
454 params->quic_migrate_sessions_on_network_change = | 460 params->quic_migrate_sessions_on_network_change = |
455 ShouldQuicMigrateSessionsOnNetworkChange(quic_trial_params); | 461 ShouldQuicMigrateSessionsOnNetworkChange(quic_trial_params); |
456 params->quic_migrate_sessions_early = | 462 params->quic_migrate_sessions_early = |
457 ShouldQuicMigrateSessionsEarly(quic_trial_params); | 463 ShouldQuicMigrateSessionsEarly(quic_trial_params); |
| 464 params->quic_race_cert_verification = |
| 465 ShouldQuicRaceCertVerification(quic_trial_params); |
458 } | 466 } |
459 | 467 |
460 size_t max_packet_length = | 468 size_t max_packet_length = |
461 GetQuicMaxPacketLength(command_line, quic_trial_params); | 469 GetQuicMaxPacketLength(command_line, quic_trial_params); |
462 if (max_packet_length != 0) { | 470 if (max_packet_length != 0) { |
463 params->quic_max_packet_length = max_packet_length; | 471 params->quic_max_packet_length = max_packet_length; |
464 } | 472 } |
465 | 473 |
466 params->quic_user_agent_id = quic_user_agent_id; | 474 params->quic_user_agent_id = quic_user_agent_id; |
467 | 475 |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
557 const std::string& quic_user_agent_id, | 565 const std::string& quic_user_agent_id, |
558 net::HttpNetworkSession::Params* params) { | 566 net::HttpNetworkSession::Params* params) { |
559 const base::CommandLine& command_line = | 567 const base::CommandLine& command_line = |
560 *base::CommandLine::ForCurrentProcess(); | 568 *base::CommandLine::ForCurrentProcess(); |
561 ParseFieldTrialsAndCommandLineInternal( | 569 ParseFieldTrialsAndCommandLineInternal( |
562 command_line, is_spdy_allowed_by_policy, is_quic_allowed_by_policy, | 570 command_line, is_spdy_allowed_by_policy, is_quic_allowed_by_policy, |
563 quic_user_agent_id, params); | 571 quic_user_agent_id, params); |
564 } | 572 } |
565 | 573 |
566 } // namespace network_session_configurator | 574 } // namespace network_session_configurator |
OLD | NEW |