Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(213)

Unified Diff: components/cronet/url_request_context_config.h

Issue 2567093002: [cronet] Add a Builder class for UrlRequestContextConfig (Closed)
Patch Set: Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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..0676b0aa031d7e9d30129d195598cf84b47a24a9 100644
--- a/components/cronet/url_request_context_config.h
+++ b/components/cronet/url_request_context_config.h
@@ -176,6 +176,62 @@ struct URLRequestContextConfig {
DISALLOW_COPY_AND_ASSIGN(URLRequestContextConfig);
};
+// Intermediate state for URLRequestContextConfig
mef 2016/12/20 19:32:04 Full sentence, better description to explain the u
lilyhoughton 2016/12/20 21:31:40 Done.
+struct URLRequestContextConfigBuilder {
+ URLRequestContextConfigBuilder();
+ ~URLRequestContextConfigBuilder();
+
+ std::unique_ptr<URLRequestContextConfig> Build();
mef 2016/12/20 19:32:04 Need comments for public methods.
lilyhoughton 2016/12/20 21:31:40 Done.
+
+ // 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 =
+ 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;
+
+ // 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 populte CertVerifierCache.
mef 2016/12/20 19:32:05 nit: populate (sp)
lilyhoughton 2016/12/20 21:31:40 Done.
+ std::string cert_verifier_data = "";
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(URLRequestContextConfigBuilder);
+};
+
} // namespace cronet
#endif // COMPONENTS_CRONET_URL_REQUEST_CONTEXT_CONFIG_H_

Powered by Google App Engine
This is Rietveld 408576698