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 #ifndef COMPONENTS_CRONET_URL_REQUEST_CONTEXT_CONFIG_H_ | 5 #ifndef COMPONENTS_CRONET_URL_REQUEST_CONTEXT_CONFIG_H_ |
6 #define COMPONENTS_CRONET_URL_REQUEST_CONTEXT_CONFIG_H_ | 6 #define COMPONENTS_CRONET_URL_REQUEST_CONTEXT_CONFIG_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
132 const HttpCacheType http_cache; | 132 const HttpCacheType http_cache; |
133 // Max size of http cache in bytes. | 133 // Max size of http cache in bytes. |
134 const int http_cache_max_size; | 134 const int http_cache_max_size; |
135 // Disable caching for HTTP responses. Other information may be stored in | 135 // Disable caching for HTTP responses. Other information may be stored in |
136 // the cache. | 136 // the cache. |
137 const bool load_disable_cache; | 137 const bool load_disable_cache; |
138 // Storage path for http cache and cookie storage. | 138 // Storage path for http cache and cookie storage. |
139 const std::string storage_path; | 139 const std::string storage_path; |
140 // User-Agent request header field. | 140 // User-Agent request header field. |
141 const std::string user_agent; | 141 const std::string user_agent; |
142 // Experimental options encoded as a string in a JSON format containing | |
143 // experiments and their corresponding configuration options. The format | |
144 // is a JSON object with the name of the experiment as the key, and the | |
145 // configuration options as the value. An example: | |
146 // {"experiment1": {"option1": "option_value1", "option2": "option_value2", | |
147 // ...}, "experiment2: {"option3", "option_value3", ...}, ...} | |
148 const std::string experimental_options; | |
149 | 142 |
150 // Certificate verifier for testing. | 143 // Certificate verifier for testing. |
151 std::unique_ptr<net::CertVerifier> mock_cert_verifier; | 144 std::unique_ptr<net::CertVerifier> mock_cert_verifier; |
152 | 145 |
153 // Enable network quality estimator. | 146 // Enable network quality estimator. |
154 const bool enable_network_quality_estimator; | 147 const bool enable_network_quality_estimator; |
155 | 148 |
156 // Enable public key pinning bypass for local trust anchors. | 149 // Enable public key pinning bypass for local trust anchors. |
157 const bool bypass_public_key_pinning_for_local_trust_anchors; | 150 const bool bypass_public_key_pinning_for_local_trust_anchors; |
158 | 151 |
159 // Data to populte CertVerifierCache. | 152 // Data to populte CertVerifierCache. |
160 const std::string cert_verifier_data; | 153 const std::string cert_verifier_data; |
161 | 154 |
162 // App-provided list of servers that support QUIC. | 155 // App-provided list of servers that support QUIC. |
163 ScopedVector<QuicHint> quic_hints; | 156 ScopedVector<QuicHint> quic_hints; |
164 | 157 |
165 // The list of public key pins. | 158 // The list of public key pins. |
166 ScopedVector<Pkp> pkp_list; | 159 ScopedVector<Pkp> pkp_list; |
167 | 160 |
168 // Experimental options that are recognized by the config parser. | 161 // Experimental options that are recognized by the config parser. |
169 std::unique_ptr<base::DictionaryValue> effective_experimental_options; | 162 std::unique_ptr<base::DictionaryValue> effective_experimental_options; |
170 | 163 |
171 private: | 164 private: |
165 // Experimental options encoded as a string in a JSON format containing | |
166 // experiments and their corresponding configuration options. The format | |
167 // is a JSON object with the name of the experiment as the key, and the | |
168 // configuration options as the value. An example: | |
169 // {"experiment1": {"option1": "option_value1", "option2": "option_value2", | |
170 // ...}, "experiment2: {"option3", "option_value3", ...}, ...} | |
171 const std::string experimental_options; | |
xunjieli
2017/05/02 17:56:34
nice!
| |
172 | |
172 DISALLOW_COPY_AND_ASSIGN(URLRequestContextConfig); | 173 DISALLOW_COPY_AND_ASSIGN(URLRequestContextConfig); |
173 }; | 174 }; |
174 | 175 |
175 // Stores intermediate state for URLRequestContextConfig. Initializes with | 176 // Stores intermediate state for URLRequestContextConfig. Initializes with |
176 // (mostly) sane defaults, then the appropriate member variables can be | 177 // (mostly) sane defaults, then the appropriate member variables can be |
177 // modified, and it can be finalized with Build(). | 178 // modified, and it can be finalized with Build(). |
178 struct URLRequestContextConfigBuilder { | 179 struct URLRequestContextConfigBuilder { |
179 URLRequestContextConfigBuilder(); | 180 URLRequestContextConfigBuilder(); |
180 ~URLRequestContextConfigBuilder(); | 181 ~URLRequestContextConfigBuilder(); |
181 | 182 |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
226 // Data to populate CertVerifierCache. | 227 // Data to populate CertVerifierCache. |
227 std::string cert_verifier_data = ""; | 228 std::string cert_verifier_data = ""; |
228 | 229 |
229 private: | 230 private: |
230 DISALLOW_COPY_AND_ASSIGN(URLRequestContextConfigBuilder); | 231 DISALLOW_COPY_AND_ASSIGN(URLRequestContextConfigBuilder); |
231 }; | 232 }; |
232 | 233 |
233 } // namespace cronet | 234 } // namespace cronet |
234 | 235 |
235 #endif // COMPONENTS_CRONET_URL_REQUEST_CONTEXT_CONFIG_H_ | 236 #endif // COMPONENTS_CRONET_URL_REQUEST_CONTEXT_CONFIG_H_ |
OLD | NEW |