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 "base/json/json_reader.h" | 7 #include "base/json/json_reader.h" |
| 8 #include "base/values.h" | 8 #include "base/values.h" |
| 9 #include "net/quic/quic_protocol.h" | 9 #include "net/quic/quic_protocol.h" |
| 10 #include "net/quic/quic_utils.h" | 10 #include "net/quic/quic_utils.h" |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 73 context_builder->EnableHttpCache(cache_params); | 73 context_builder->EnableHttpCache(cache_params); |
| 74 } else { | 74 } else { |
| 75 context_builder->DisableHttpCache(); | 75 context_builder->DisableHttpCache(); |
| 76 } | 76 } |
| 77 context_builder->set_user_agent(user_agent); | 77 context_builder->set_user_agent(user_agent); |
| 78 context_builder->SetSpdyAndQuicEnabled(enable_spdy, enable_quic); | 78 context_builder->SetSpdyAndQuicEnabled(enable_spdy, enable_quic); |
| 79 context_builder->set_quic_connection_options( | 79 context_builder->set_quic_connection_options( |
| 80 net::QuicUtils::ParseQuicConnectionOptions(quic_connection_options)); | 80 net::QuicUtils::ParseQuicConnectionOptions(quic_connection_options)); |
| 81 context_builder->set_sdch_enabled(enable_sdch); | 81 context_builder->set_sdch_enabled(enable_sdch); |
| 82 | 82 |
| 83 #if defined(CRONET_TEST) | |
| 84 // Used in testing to trust local certs. | |
| 85 // TODO(xunjieli): Figure out a reliable way to install a local CA cert. | |
|
Ryan Hamilton
2015/10/08 21:29:17
The easiest way to do this for testing is to simpl
xunjieli
2015/10/08 22:21:23
This is actually our production code. A block of M
| |
| 86 context_builder->set_ignore_certificate_errors(true); | |
| 87 #endif | |
| 83 } | 88 } |
| 84 | 89 |
| 85 // static | 90 // static |
| 86 void URLRequestContextConfig::RegisterJSONConverter( | 91 void URLRequestContextConfig::RegisterJSONConverter( |
| 87 base::JSONValueConverter<URLRequestContextConfig>* converter) { | 92 base::JSONValueConverter<URLRequestContextConfig>* converter) { |
| 88 converter->RegisterStringField(REQUEST_CONTEXT_CONFIG_USER_AGENT, | 93 converter->RegisterStringField(REQUEST_CONTEXT_CONFIG_USER_AGENT, |
| 89 &URLRequestContextConfig::user_agent); | 94 &URLRequestContextConfig::user_agent); |
| 90 converter->RegisterStringField(REQUEST_CONTEXT_CONFIG_STORAGE_PATH, | 95 converter->RegisterStringField(REQUEST_CONTEXT_CONFIG_STORAGE_PATH, |
| 91 &URLRequestContextConfig::storage_path); | 96 &URLRequestContextConfig::storage_path); |
| 92 converter->RegisterBoolField(REQUEST_CONTEXT_CONFIG_ENABLE_QUIC, | 97 converter->RegisterBoolField(REQUEST_CONTEXT_CONFIG_ENABLE_QUIC, |
| (...skipping 21 matching lines...) Expand all Loading... | |
| 114 &URLRequestContextConfig::data_reduction_fallback_proxy); | 119 &URLRequestContextConfig::data_reduction_fallback_proxy); |
| 115 converter->RegisterStringField( | 120 converter->RegisterStringField( |
| 116 REQUEST_CONTEXT_CONFIG_DATA_REDUCTION_SECURE_PROXY_CHECK_URL, | 121 REQUEST_CONTEXT_CONFIG_DATA_REDUCTION_SECURE_PROXY_CHECK_URL, |
| 117 &URLRequestContextConfig::data_reduction_secure_proxy_check_url); | 122 &URLRequestContextConfig::data_reduction_secure_proxy_check_url); |
| 118 converter->RegisterStringField( | 123 converter->RegisterStringField( |
| 119 REQUEST_CONTEXT_CONFIG_DATA_REDUCTION_PROXY_KEY, | 124 REQUEST_CONTEXT_CONFIG_DATA_REDUCTION_PROXY_KEY, |
| 120 &URLRequestContextConfig::data_reduction_proxy_key); | 125 &URLRequestContextConfig::data_reduction_proxy_key); |
| 121 } | 126 } |
| 122 | 127 |
| 123 } // namespace cronet | 128 } // namespace cronet |
| OLD | NEW |