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 #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 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 169 // App-provided list of servers that support QUIC. | 169 // App-provided list of servers that support QUIC. |
| 170 ScopedVector<QuicHint> quic_hints; | 170 ScopedVector<QuicHint> quic_hints; |
| 171 | 171 |
| 172 // The list of public key pins. | 172 // The list of public key pins. |
| 173 ScopedVector<Pkp> pkp_list; | 173 ScopedVector<Pkp> pkp_list; |
| 174 | 174 |
| 175 private: | 175 private: |
| 176 DISALLOW_COPY_AND_ASSIGN(URLRequestContextConfig); | 176 DISALLOW_COPY_AND_ASSIGN(URLRequestContextConfig); |
| 177 }; | 177 }; |
| 178 | 178 |
| 179 // Stores intermediate state for URLRequestContextConfig. Initializes with | |
| 180 // (mostly) sane defaults, then the appropriate member variables can be | |
| 181 // modified, and it can be finalized with Build(). | |
| 182 struct URLRequestContextConfigBuilder { | |
| 183 URLRequestContextConfigBuilder(); | |
| 184 ~URLRequestContextConfigBuilder(); | |
| 185 | |
| 186 // Finalize state into a URLRequestContextConfig. Must only be called once, | |
| 187 // as once |mock_cert_verifier| is moved into a URLRequestContextConfig, it | |
| 188 // cannot be used again. | |
| 189 std::unique_ptr<URLRequestContextConfig> Build(); | |
| 190 | |
| 191 // Enable QUIC. | |
| 192 bool enable_quic = false; | |
| 193 // QUIC User Agent ID. | |
| 194 std::string quic_user_agent_id = ""; | |
| 195 // Enable SPDY. | |
| 196 bool enable_spdy = false; | |
| 197 // Enable SDCH. | |
| 198 bool enable_sdch = false; | |
| 199 // Type of http cache. | |
| 200 URLRequestContextConfig::HttpCacheType http_cache = | |
|
mef
2017/01/10 17:36:18
We should make this and other values match default
lilyhoughton
2017/01/10 18:25:36
Done.
| |
| 201 URLRequestContextConfig::DISK; | |
| 202 // Max size of http cache in bytes. | |
| 203 int http_cache_max_size = 0; | |
| 204 // Disable caching for HTTP responses. Other information may be stored in | |
| 205 // the cache. | |
| 206 bool load_disable_cache = false; | |
| 207 // Storage path for http cache and cookie storage. | |
| 208 std::string storage_path = ""; | |
| 209 // User-Agent request header field. | |
| 210 std::string user_agent = ""; | |
| 211 // Experimental options encoded as a string in a JSON format containing | |
| 212 // experiments and their corresponding configuration options. The format | |
| 213 // is a JSON object with the name of the experiment as the key, and the | |
| 214 // configuration options as the value. An example: | |
| 215 // {"experiment1": {"option1": "option_value1", "option2": "option_value2", | |
| 216 // ...}, "experiment2: {"option3", "option_value3", ...}, ...} | |
| 217 std::string experimental_options = "{}"; | |
| 218 // Enable Data Reduction Proxy with authentication key. | |
| 219 std::string data_reduction_proxy_key = ""; | |
| 220 std::string data_reduction_primary_proxy = ""; | |
| 221 std::string data_reduction_fallback_proxy = ""; | |
| 222 std::string data_reduction_secure_proxy_check_url = ""; | |
| 223 | |
| 224 // Certificate verifier for testing. | |
| 225 std::unique_ptr<net::CertVerifier> mock_cert_verifier = nullptr; | |
|
mef
2017/01/10 20:26:59
I think you may need to #include "net/cert/cert_ve
| |
| 226 | |
| 227 // Enable network quality estimator. | |
| 228 bool enable_network_quality_estimator = false; | |
| 229 | |
| 230 // Enable public key pinning bypass for local trust anchors. | |
| 231 bool bypass_public_key_pinning_for_local_trust_anchors = true; | |
| 232 | |
| 233 // Data to populate CertVerifierCache. | |
| 234 std::string cert_verifier_data = ""; | |
| 235 | |
| 236 private: | |
| 237 DISALLOW_COPY_AND_ASSIGN(URLRequestContextConfigBuilder); | |
| 238 }; | |
| 239 | |
| 179 } // namespace cronet | 240 } // namespace cronet |
| 180 | 241 |
| 181 #endif // COMPONENTS_CRONET_URL_REQUEST_CONTEXT_CONFIG_H_ | 242 #endif // COMPONENTS_CRONET_URL_REQUEST_CONTEXT_CONFIG_H_ |
| OLD | NEW |