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 "net/url_request/url_request_context_builder.h" | 7 #include "net/url_request/url_request_context_builder.h" |
8 | 8 |
9 namespace cronet { | 9 namespace cronet { |
10 | 10 |
11 #define DEFINE_CONTEXT_CONFIG(x) const char REQUEST_CONTEXT_CONFIG_##x[] = #x; | 11 #define DEFINE_CONTEXT_CONFIG(x) const char REQUEST_CONTEXT_CONFIG_##x[] = #x; |
12 #include "components/cronet/url_request_context_config_list.h" | 12 #include "components/cronet/url_request_context_config_list.h" |
13 #undef DEFINE_CONTEXT_CONFIG | 13 #undef DEFINE_CONTEXT_CONFIG |
14 | 14 |
| 15 URLRequestContextConfig::QuicHint::QuicHint() { |
| 16 } |
| 17 |
| 18 URLRequestContextConfig::QuicHint::~QuicHint() { |
| 19 } |
| 20 |
| 21 // static |
| 22 void URLRequestContextConfig::QuicHint::RegisterJSONConverter( |
| 23 base::JSONValueConverter<URLRequestContextConfig::QuicHint>* converter) { |
| 24 converter->RegisterStringField(REQUEST_CONTEXT_CONFIG_QUIC_HINT_SERVER, |
| 25 &URLRequestContextConfig::QuicHint::server); |
| 26 converter->RegisterIntField( |
| 27 REQUEST_CONTEXT_CONFIG_QUIC_HINT_ALT_PORT, |
| 28 &URLRequestContextConfig::QuicHint::alternate_port); |
| 29 } |
| 30 |
15 URLRequestContextConfig::URLRequestContextConfig() { | 31 URLRequestContextConfig::URLRequestContextConfig() { |
16 } | 32 } |
17 | 33 |
18 URLRequestContextConfig::~URLRequestContextConfig() { | 34 URLRequestContextConfig::~URLRequestContextConfig() { |
19 } | 35 } |
20 | 36 |
21 void URLRequestContextConfig::ConfigureURLRequestContextBuilder( | 37 void URLRequestContextConfig::ConfigureURLRequestContextBuilder( |
22 net::URLRequestContextBuilder* context_builder) { | 38 net::URLRequestContextBuilder* context_builder) { |
23 std::string config_cache; | 39 std::string config_cache; |
24 if (http_cache != REQUEST_CONTEXT_CONFIG_HTTP_CACHE_DISABLED) { | 40 if (http_cache != REQUEST_CONTEXT_CONFIG_HTTP_CACHE_DISABLED) { |
(...skipping 22 matching lines...) Expand all Loading... |
47 converter->RegisterBoolField(REQUEST_CONTEXT_CONFIG_ENABLE_QUIC, | 63 converter->RegisterBoolField(REQUEST_CONTEXT_CONFIG_ENABLE_QUIC, |
48 &URLRequestContextConfig::enable_quic); | 64 &URLRequestContextConfig::enable_quic); |
49 converter->RegisterBoolField(REQUEST_CONTEXT_CONFIG_ENABLE_SPDY, | 65 converter->RegisterBoolField(REQUEST_CONTEXT_CONFIG_ENABLE_SPDY, |
50 &URLRequestContextConfig::enable_spdy); | 66 &URLRequestContextConfig::enable_spdy); |
51 converter->RegisterStringField(REQUEST_CONTEXT_CONFIG_HTTP_CACHE, | 67 converter->RegisterStringField(REQUEST_CONTEXT_CONFIG_HTTP_CACHE, |
52 &URLRequestContextConfig::http_cache); | 68 &URLRequestContextConfig::http_cache); |
53 converter->RegisterIntField(REQUEST_CONTEXT_CONFIG_HTTP_CACHE_MAX_SIZE, | 69 converter->RegisterIntField(REQUEST_CONTEXT_CONFIG_HTTP_CACHE_MAX_SIZE, |
54 &URLRequestContextConfig::http_cache_max_size); | 70 &URLRequestContextConfig::http_cache_max_size); |
55 converter->RegisterStringField(REQUEST_CONTEXT_CONFIG_STORAGE_PATH, | 71 converter->RegisterStringField(REQUEST_CONTEXT_CONFIG_STORAGE_PATH, |
56 &URLRequestContextConfig::storage_path); | 72 &URLRequestContextConfig::storage_path); |
| 73 converter->RegisterRepeatedMessage(REQUEST_CONTEXT_CONFIG_QUIC_HINTS, |
| 74 &URLRequestContextConfig::quic_hints); |
57 } | 75 } |
58 | 76 |
59 } // namespace cronet | 77 } // namespace cronet |
OLD | NEW |