| 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 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 72 cache_params.max_size = http_cache_max_size; | 72 cache_params.max_size = http_cache_max_size; |
| 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 | |
| 83 } | 82 } |
| 84 | 83 |
| 85 // static | 84 // static |
| 86 void URLRequestContextConfig::RegisterJSONConverter( | 85 void URLRequestContextConfig::RegisterJSONConverter( |
| 87 base::JSONValueConverter<URLRequestContextConfig>* converter) { | 86 base::JSONValueConverter<URLRequestContextConfig>* converter) { |
| 88 converter->RegisterStringField(REQUEST_CONTEXT_CONFIG_USER_AGENT, | 87 converter->RegisterStringField(REQUEST_CONTEXT_CONFIG_USER_AGENT, |
| 89 &URLRequestContextConfig::user_agent); | 88 &URLRequestContextConfig::user_agent); |
| 90 converter->RegisterStringField(REQUEST_CONTEXT_CONFIG_STORAGE_PATH, | 89 converter->RegisterStringField(REQUEST_CONTEXT_CONFIG_STORAGE_PATH, |
| 91 &URLRequestContextConfig::storage_path); | 90 &URLRequestContextConfig::storage_path); |
| 92 converter->RegisterBoolField(REQUEST_CONTEXT_CONFIG_ENABLE_QUIC, | 91 converter->RegisterBoolField(REQUEST_CONTEXT_CONFIG_ENABLE_QUIC, |
| (...skipping 18 matching lines...) Expand all Loading... |
| 111 &URLRequestContextConfig::data_reduction_primary_proxy); | 110 &URLRequestContextConfig::data_reduction_primary_proxy); |
| 112 converter->RegisterStringField( | 111 converter->RegisterStringField( |
| 113 REQUEST_CONTEXT_CONFIG_DATA_REDUCTION_FALLBACK_PROXY, | 112 REQUEST_CONTEXT_CONFIG_DATA_REDUCTION_FALLBACK_PROXY, |
| 114 &URLRequestContextConfig::data_reduction_fallback_proxy); | 113 &URLRequestContextConfig::data_reduction_fallback_proxy); |
| 115 converter->RegisterStringField( | 114 converter->RegisterStringField( |
| 116 REQUEST_CONTEXT_CONFIG_DATA_REDUCTION_SECURE_PROXY_CHECK_URL, | 115 REQUEST_CONTEXT_CONFIG_DATA_REDUCTION_SECURE_PROXY_CHECK_URL, |
| 117 &URLRequestContextConfig::data_reduction_secure_proxy_check_url); | 116 &URLRequestContextConfig::data_reduction_secure_proxy_check_url); |
| 118 converter->RegisterStringField( | 117 converter->RegisterStringField( |
| 119 REQUEST_CONTEXT_CONFIG_DATA_REDUCTION_PROXY_KEY, | 118 REQUEST_CONTEXT_CONFIG_DATA_REDUCTION_PROXY_KEY, |
| 120 &URLRequestContextConfig::data_reduction_proxy_key); | 119 &URLRequestContextConfig::data_reduction_proxy_key); |
| 120 |
| 121 // For Testing |
| 122 converter->RegisterStringField( |
| 123 REQUEST_CONTEXT_CONFIG_MOCK_CERTS_FOR_TESTING, |
| 124 &URLRequestContextConfig::mock_certs_for_testing); |
| 121 } | 125 } |
| 122 | 126 |
| 123 } // namespace cronet | 127 } // namespace cronet |
| OLD | NEW |