| 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"; |
| 37 const char kQuicMaxNumberOfLossyConnections[] = | 38 const char kQuicMaxNumberOfLossyConnections[] = |
| 38 "max_number_of_lossy_connections"; | 39 "max_number_of_lossy_connections"; |
| 39 const char kQuicPacketLossThreshold[] = "packet_loss_threshold"; | 40 const char kQuicPacketLossThreshold[] = "packet_loss_threshold"; |
| 40 const char kQuicIdleConnectionTimeoutSeconds[] = | 41 const char kQuicIdleConnectionTimeoutSeconds[] = |
| 41 "idle_connection_timeout_seconds"; | 42 "idle_connection_timeout_seconds"; |
| 42 const char kQuicHostWhitelist[] = "host_whitelist"; | 43 const char kQuicHostWhitelist[] = "host_whitelist"; |
| 43 const char kQuicCloseSessionsOnIpChange[] = "close_sessions_on_ip_change"; | 44 const char kQuicCloseSessionsOnIpChange[] = "close_sessions_on_ip_change"; |
| 44 const char kQuicMigrateSessionsOnNetworkChange[] = | 45 const char kQuicMigrateSessionsOnNetworkChange[] = |
| 45 "migrate_sessions_on_network_change"; | 46 "migrate_sessions_on_network_change"; |
| 46 const char kQuicPreferAes[] = "prefer_aes"; | 47 const char kQuicPreferAes[] = "prefer_aes"; |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 101 net::kMaxQuicServersToPersist); | 102 net::kMaxQuicServersToPersist); |
| 102 } | 103 } |
| 103 | 104 |
| 104 int quic_max_server_configs_stored_in_properties = 0; | 105 int quic_max_server_configs_stored_in_properties = 0; |
| 105 if (quic_args->GetInteger(kQuicMaxServerConfigsStoredInProperties, | 106 if (quic_args->GetInteger(kQuicMaxServerConfigsStoredInProperties, |
| 106 &quic_max_server_configs_stored_in_properties)) { | 107 &quic_max_server_configs_stored_in_properties)) { |
| 107 context_builder->set_quic_max_server_configs_stored_in_properties( | 108 context_builder->set_quic_max_server_configs_stored_in_properties( |
| 108 static_cast<size_t>(quic_max_server_configs_stored_in_properties)); | 109 static_cast<size_t>(quic_max_server_configs_stored_in_properties)); |
| 109 } | 110 } |
| 110 | 111 |
| 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 |
| 111 int quic_max_number_of_lossy_connections = 0; | 117 int quic_max_number_of_lossy_connections = 0; |
| 112 if (quic_args->GetInteger(kQuicMaxNumberOfLossyConnections, | 118 if (quic_args->GetInteger(kQuicMaxNumberOfLossyConnections, |
| 113 &quic_max_number_of_lossy_connections)) { | 119 &quic_max_number_of_lossy_connections)) { |
| 114 context_builder->set_quic_max_number_of_lossy_connections( | 120 context_builder->set_quic_max_number_of_lossy_connections( |
| 115 quic_max_number_of_lossy_connections); | 121 quic_max_number_of_lossy_connections); |
| 116 } | 122 } |
| 117 | 123 |
| 118 double quic_packet_loss_threshold = 0.0; | 124 double quic_packet_loss_threshold = 0.0; |
| 119 if (quic_args->GetDouble(kQuicPacketLossThreshold, | 125 if (quic_args->GetDouble(kQuicPacketLossThreshold, |
| 120 &quic_packet_loss_threshold)) { | 126 &quic_packet_loss_threshold)) { |
| (...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 292 | 298 |
| 293 ParseAndSetExperimentalOptions(experimental_options, context_builder, net_log, | 299 ParseAndSetExperimentalOptions(experimental_options, context_builder, net_log, |
| 294 file_task_runner); | 300 file_task_runner); |
| 295 | 301 |
| 296 if (mock_cert_verifier) | 302 if (mock_cert_verifier) |
| 297 context_builder->SetCertVerifier(std::move(mock_cert_verifier)); | 303 context_builder->SetCertVerifier(std::move(mock_cert_verifier)); |
| 298 // TODO(mef): Use |config| to set cookies. | 304 // TODO(mef): Use |config| to set cookies. |
| 299 } | 305 } |
| 300 | 306 |
| 301 } // namespace cronet | 307 } // namespace cronet |
| OLD | NEW |