Chromium Code Reviews| Index: components/cronet/url_request_context_config.h |
| diff --git a/components/cronet/url_request_context_config.h b/components/cronet/url_request_context_config.h |
| index f01564e2094b7cbfb9e1adc6bdf1949f63ec0045..80cf7ac86fb37e0c6641895144ade95cb4fce8c0 100644 |
| --- a/components/cronet/url_request_context_config.h |
| +++ b/components/cronet/url_request_context_config.h |
| @@ -176,6 +176,67 @@ struct URLRequestContextConfig { |
| DISALLOW_COPY_AND_ASSIGN(URLRequestContextConfig); |
| }; |
| +// Stores intermediate state for URLRequestContextConfig. Initializes with |
| +// (mostly) sane defaults, then the appropriate member variables can be |
| +// modified, and it can be finalized with Build(). |
| +struct URLRequestContextConfigBuilder { |
| + URLRequestContextConfigBuilder(); |
| + ~URLRequestContextConfigBuilder(); |
| + |
| + // Finalize state into a URLRequestContextConfig. Must only be called once, |
| + // as once |mock_cert_verifier| is moved into a URLRequestContextConfig, it |
| + // cannot be used again. |
| + std::unique_ptr<URLRequestContextConfig> Build(); |
| + |
| + // Enable QUIC. |
| + bool enable_quic = false; |
| + // QUIC User Agent ID. |
| + std::string quic_user_agent_id = ""; |
| + // Enable SPDY. |
| + bool enable_spdy = false; |
| + // Enable SDCH. |
| + bool enable_sdch = false; |
| + // Type of http cache. |
| + 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.
|
| + URLRequestContextConfig::DISK; |
| + // Max size of http cache in bytes. |
| + int http_cache_max_size = 0; |
| + // Disable caching for HTTP responses. Other information may be stored in |
| + // the cache. |
| + bool load_disable_cache = false; |
| + // Storage path for http cache and cookie storage. |
| + std::string storage_path = ""; |
| + // User-Agent request header field. |
| + std::string user_agent = ""; |
| + // Experimental options encoded as a string in a JSON format containing |
| + // experiments and their corresponding configuration options. The format |
| + // is a JSON object with the name of the experiment as the key, and the |
| + // configuration options as the value. An example: |
| + // {"experiment1": {"option1": "option_value1", "option2": "option_value2", |
| + // ...}, "experiment2: {"option3", "option_value3", ...}, ...} |
| + std::string experimental_options = "{}"; |
| + // Enable Data Reduction Proxy with authentication key. |
| + std::string data_reduction_proxy_key = ""; |
| + std::string data_reduction_primary_proxy = ""; |
| + std::string data_reduction_fallback_proxy = ""; |
| + std::string data_reduction_secure_proxy_check_url = ""; |
| + |
| + // Certificate verifier for testing. |
| + 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
|
| + |
| + // Enable network quality estimator. |
| + bool enable_network_quality_estimator = false; |
| + |
| + // Enable public key pinning bypass for local trust anchors. |
| + bool bypass_public_key_pinning_for_local_trust_anchors = true; |
| + |
| + // Data to populate CertVerifierCache. |
| + std::string cert_verifier_data = ""; |
| + |
| + private: |
| + DISALLOW_COPY_AND_ASSIGN(URLRequestContextConfigBuilder); |
| +}; |
| + |
| } // namespace cronet |
| #endif // COMPONENTS_CRONET_URL_REQUEST_CONTEXT_CONFIG_H_ |