Chromium Code Reviews| 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 23 matching lines...) Expand all Loading... | |
| 34 // Name of disk cache directory. | 34 // Name of disk cache directory. |
| 35 const char kDiskCacheDirectoryName[] = "disk_cache"; | 35 const char kDiskCacheDirectoryName[] = "disk_cache"; |
| 36 // TODO(xunjieli): Refactor constants in io_thread.cc. | 36 // TODO(xunjieli): Refactor constants in io_thread.cc. |
| 37 const char kQuicFieldTrialName[] = "QUIC"; | 37 const char kQuicFieldTrialName[] = "QUIC"; |
| 38 const char kQuicConnectionOptions[] = "connection_options"; | 38 const char kQuicConnectionOptions[] = "connection_options"; |
| 39 const char kQuicStoreServerConfigsInProperties[] = | 39 const char kQuicStoreServerConfigsInProperties[] = |
| 40 "store_server_configs_in_properties"; | 40 "store_server_configs_in_properties"; |
| 41 const char kQuicMaxServerConfigsStoredInProperties[] = | 41 const char kQuicMaxServerConfigsStoredInProperties[] = |
| 42 "max_server_configs_stored_in_properties"; | 42 "max_server_configs_stored_in_properties"; |
| 43 const char kQuicDelayTcpRace[] = "delay_tcp_race"; | 43 const char kQuicDelayTcpRace[] = "delay_tcp_race"; |
| 44 const char kQuicMaxNumberOfLossyConnections[] = | |
| 45 "max_number_of_lossy_connections"; | |
| 46 const char kQuicPacketLossThreshold[] = "packet_loss_threshold"; | |
| 47 const char kQuicIdleConnectionTimeoutSeconds[] = | 44 const char kQuicIdleConnectionTimeoutSeconds[] = |
| 48 "idle_connection_timeout_seconds"; | 45 "idle_connection_timeout_seconds"; |
| 49 const char kQuicHostWhitelist[] = "host_whitelist"; | 46 const char kQuicHostWhitelist[] = "host_whitelist"; |
| 50 const char kQuicCloseSessionsOnIpChange[] = "close_sessions_on_ip_change"; | 47 const char kQuicCloseSessionsOnIpChange[] = "close_sessions_on_ip_change"; |
| 51 const char kQuicMigrateSessionsOnNetworkChange[] = | 48 const char kQuicMigrateSessionsOnNetworkChange[] = |
| 52 "migrate_sessions_on_network_change"; | 49 "migrate_sessions_on_network_change"; |
| 53 const char kQuicPreferAes[] = "prefer_aes"; | 50 const char kQuicPreferAes[] = "prefer_aes"; |
| 54 const char kQuicUserAgentId[] = "user_agent_id"; | 51 const char kQuicUserAgentId[] = "user_agent_id"; |
| 55 const char kQuicMigrateSessionsEarly[] = "migrate_sessions_early"; | 52 const char kQuicMigrateSessionsEarly[] = "migrate_sessions_early"; |
| 56 const char kQuicDisableBidirectionalStreams[] = | 53 const char kQuicDisableBidirectionalStreams[] = |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 150 &quic_max_number_of_lossy_connections)) { | 147 &quic_max_number_of_lossy_connections)) { |
| 151 context_builder->set_quic_max_number_of_lossy_connections( | 148 context_builder->set_quic_max_number_of_lossy_connections( |
| 152 quic_max_number_of_lossy_connections); | 149 quic_max_number_of_lossy_connections); |
| 153 } | 150 } |
| 154 | 151 |
| 155 double quic_packet_loss_threshold = 0.0; | 152 double quic_packet_loss_threshold = 0.0; |
| 156 if (quic_args->GetDouble(kQuicPacketLossThreshold, | 153 if (quic_args->GetDouble(kQuicPacketLossThreshold, |
| 157 &quic_packet_loss_threshold)) { | 154 &quic_packet_loss_threshold)) { |
| 158 context_builder->set_quic_packet_loss_threshold( | 155 context_builder->set_quic_packet_loss_threshold( |
| 159 quic_packet_loss_threshold); | 156 quic_packet_loss_threshold); |
| 160 } | 157 } |
|
xunjieli
2016/09/12 17:14:46
line 145 - line 157 are no longer relevant?
xunjieli
2016/09/12 17:17:43
Might be also worth removing URLRequestContextBuil
Ryan Hamilton
2016/09/12 17:49:27
Done.
Ryan Hamilton
2016/09/12 17:49:27
Good point. Done
| |
| 161 | 158 |
| 162 int quic_idle_connection_timeout_seconds = 0; | 159 int quic_idle_connection_timeout_seconds = 0; |
| 163 if (quic_args->GetInteger(kQuicIdleConnectionTimeoutSeconds, | 160 if (quic_args->GetInteger(kQuicIdleConnectionTimeoutSeconds, |
| 164 &quic_idle_connection_timeout_seconds)) { | 161 &quic_idle_connection_timeout_seconds)) { |
| 165 context_builder->set_quic_idle_connection_timeout_seconds( | 162 context_builder->set_quic_idle_connection_timeout_seconds( |
| 166 quic_idle_connection_timeout_seconds); | 163 quic_idle_connection_timeout_seconds); |
| 167 } | 164 } |
| 168 | 165 |
| 169 std::string quic_host_whitelist; | 166 std::string quic_host_whitelist; |
| 170 if (quic_args->GetString(kQuicHostWhitelist, &quic_host_whitelist)) { | 167 if (quic_args->GetString(kQuicHostWhitelist, &quic_host_whitelist)) { |
| (...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 403 std::move(mock_cert_verifier)); | 400 std::move(mock_cert_verifier)); |
| 404 } else { | 401 } else { |
| 405 // net::CertVerifier::CreateDefault() returns a CachingCertVerifier. | 402 // net::CertVerifier::CreateDefault() returns a CachingCertVerifier. |
| 406 cert_verifier = net::CertVerifier::CreateDefault(); | 403 cert_verifier = net::CertVerifier::CreateDefault(); |
| 407 } | 404 } |
| 408 context_builder->SetCertVerifier(std::move(cert_verifier)); | 405 context_builder->SetCertVerifier(std::move(cert_verifier)); |
| 409 // TODO(mef): Use |config| to set cookies. | 406 // TODO(mef): Use |config| to set cookies. |
| 410 } | 407 } |
| 411 | 408 |
| 412 } // namespace cronet | 409 } // namespace cronet |
| OLD | NEW |