| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/cronet/url_request_context_config.h" | 5 #include "components/cronet/url_request_context_config.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/json/json_reader.h" | 9 #include "base/json/json_reader.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 | 27 |
| 28 // Name of disk cache directory. | 28 // Name of disk cache directory. |
| 29 const char kDiskCacheDirectoryName[] = "disk_cache"; | 29 const char kDiskCacheDirectoryName[] = "disk_cache"; |
| 30 // TODO(xunjieli): Refactor constants in io_thread.cc. | 30 // TODO(xunjieli): Refactor constants in io_thread.cc. |
| 31 const char kQuicFieldTrialName[] = "QUIC"; | 31 const char kQuicFieldTrialName[] = "QUIC"; |
| 32 const char kQuicConnectionOptions[] = "connection_options"; | 32 const char kQuicConnectionOptions[] = "connection_options"; |
| 33 const char kQuicStoreServerConfigsInProperties[] = | 33 const char kQuicStoreServerConfigsInProperties[] = |
| 34 "store_server_configs_in_properties"; | 34 "store_server_configs_in_properties"; |
| 35 const char kQuicMaxServerConfigsStoredInProperties[] = | 35 const char kQuicMaxServerConfigsStoredInProperties[] = |
| 36 "max_server_configs_stored_in_properties"; | 36 "max_server_configs_stored_in_properties"; |
| 37 const char kQuicDelayTcpRace[] = "delay_tcp_race"; | |
| 38 const char kQuicMaxNumberOfLossyConnections[] = | 37 const char kQuicMaxNumberOfLossyConnections[] = |
| 39 "max_number_of_lossy_connections"; | 38 "max_number_of_lossy_connections"; |
| 40 const char kQuicPacketLossThreshold[] = "packet_loss_threshold"; | 39 const char kQuicPacketLossThreshold[] = "packet_loss_threshold"; |
| 41 const char kQuicIdleConnectionTimeoutSeconds[] = | 40 const char kQuicIdleConnectionTimeoutSeconds[] = |
| 42 "idle_connection_timeout_seconds"; | 41 "idle_connection_timeout_seconds"; |
| 43 const char kQuicHostWhitelist[] = "host_whitelist"; | 42 const char kQuicHostWhitelist[] = "host_whitelist"; |
| 44 const char kQuicCloseSessionsOnIpChange[] = "close_sessions_on_ip_change"; | 43 const char kQuicCloseSessionsOnIpChange[] = "close_sessions_on_ip_change"; |
| 45 const char kQuicMigrateSessionsOnNetworkChange[] = | 44 const char kQuicMigrateSessionsOnNetworkChange[] = |
| 46 "migrate_sessions_on_network_change"; | 45 "migrate_sessions_on_network_change"; |
| 47 const char kQuicPreferAes[] = "prefer_aes"; | 46 const char kQuicPreferAes[] = "prefer_aes"; |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 102 net::kMaxQuicServersToPersist); | 101 net::kMaxQuicServersToPersist); |
| 103 } | 102 } |
| 104 | 103 |
| 105 int quic_max_server_configs_stored_in_properties = 0; | 104 int quic_max_server_configs_stored_in_properties = 0; |
| 106 if (quic_args->GetInteger(kQuicMaxServerConfigsStoredInProperties, | 105 if (quic_args->GetInteger(kQuicMaxServerConfigsStoredInProperties, |
| 107 &quic_max_server_configs_stored_in_properties)) { | 106 &quic_max_server_configs_stored_in_properties)) { |
| 108 context_builder->set_quic_max_server_configs_stored_in_properties( | 107 context_builder->set_quic_max_server_configs_stored_in_properties( |
| 109 static_cast<size_t>(quic_max_server_configs_stored_in_properties)); | 108 static_cast<size_t>(quic_max_server_configs_stored_in_properties)); |
| 110 } | 109 } |
| 111 | 110 |
| 112 bool quic_delay_tcp_race = false; | |
| 113 if (quic_args->GetBoolean(kQuicDelayTcpRace, &quic_delay_tcp_race)) { | |
| 114 context_builder->set_quic_delay_tcp_race(quic_delay_tcp_race); | |
| 115 } | |
| 116 | |
| 117 int quic_max_number_of_lossy_connections = 0; | 111 int quic_max_number_of_lossy_connections = 0; |
| 118 if (quic_args->GetInteger(kQuicMaxNumberOfLossyConnections, | 112 if (quic_args->GetInteger(kQuicMaxNumberOfLossyConnections, |
| 119 &quic_max_number_of_lossy_connections)) { | 113 &quic_max_number_of_lossy_connections)) { |
| 120 context_builder->set_quic_max_number_of_lossy_connections( | 114 context_builder->set_quic_max_number_of_lossy_connections( |
| 121 quic_max_number_of_lossy_connections); | 115 quic_max_number_of_lossy_connections); |
| 122 } | 116 } |
| 123 | 117 |
| 124 double quic_packet_loss_threshold = 0.0; | 118 double quic_packet_loss_threshold = 0.0; |
| 125 if (quic_args->GetDouble(kQuicPacketLossThreshold, | 119 if (quic_args->GetDouble(kQuicPacketLossThreshold, |
| 126 &quic_packet_loss_threshold)) { | 120 &quic_packet_loss_threshold)) { |
| (...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 298 | 292 |
| 299 ParseAndSetExperimentalOptions(experimental_options, context_builder, net_log, | 293 ParseAndSetExperimentalOptions(experimental_options, context_builder, net_log, |
| 300 file_task_runner); | 294 file_task_runner); |
| 301 | 295 |
| 302 if (mock_cert_verifier) | 296 if (mock_cert_verifier) |
| 303 context_builder->SetCertVerifier(std::move(mock_cert_verifier)); | 297 context_builder->SetCertVerifier(std::move(mock_cert_verifier)); |
| 304 // TODO(mef): Use |config| to set cookies. | 298 // TODO(mef): Use |config| to set cookies. |
| 305 } | 299 } |
| 306 | 300 |
| 307 } // namespace cronet | 301 } // namespace cronet |
| OLD | NEW |