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

Unified Diff: components/cronet/ios/cronet_environment.mm

Issue 2567093002: [cronet] Add a Builder class for UrlRequestContextConfig (Closed)
Patch Set: try fixing build (per #19) Created 3 years, 11 months 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
« no previous file with comments | « no previous file | components/cronet/url_request_context_config.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/cronet/ios/cronet_environment.mm
diff --git a/components/cronet/ios/cronet_environment.mm b/components/cronet/ios/cronet_environment.mm
index 65a59172b507af83ad38b88b1913b9d0abc85c5b..03f36dd71d260cf001a662f8a05a5d4d00765468 100644
--- a/components/cronet/ios/cronet_environment.mm
+++ b/components/cronet/ios/cronet_environment.mm
@@ -272,28 +272,18 @@ void CronetEnvironment::InitializeOnNetworkThread() {
return;
cache_path = cache_path.Append(FILE_PATH_LITERAL("cronet"));
- std::unique_ptr<URLRequestContextConfig> config(new URLRequestContextConfig(
- quic_enabled_, // Enable QUIC.
- quic_enabled_ && quic_user_agent_id_.empty()
- ? getDefaultQuicUserAgentId()
- : quic_user_agent_id_, // QUIC User Agent ID.
- http2_enabled_, // Enable SPDY.
- false, // Enable SDCH
- URLRequestContextConfig::DISK, // Type of http cache.
- 0, // Max size of http cache in bytes.
- false, // Disable caching for HTTP responses.
- cache_path.value(), // Storage path for http cache and cookie storage.
- user_agent_, // User-Agent request header field.
- "{}", // JSON encoded experimental options.
- "", // Data reduction proxy key.
- "", // Data reduction proxy.
- "", // Fallback data reduction proxy.
- "", // Data reduction proxy secure proxy check URL.
- std::move(mock_cert_verifier_), // MockCertVerifier to use for testing
- // purposes.
- false, // Enable network quality estimator.
- true, // Enable bypassing of public key pinning for local trust anchors
- "")); // Certificate verifier cache data.
+ URLRequestContextConfigBuilder context_config_builder;
+ context_config_builder.enable_quic = quic_enabled_; // Enable QUIC.
+ context_config_builder.enable_spdy = http2_enabled_; // Enable HTTP/2.
+ context_config_builder.http_cache = URLRequestContextConfig::DISK;
+ context_config_builder.storage_path =
+ cache_path.value(); // Storage path for http cache and cookie storage.
+ context_config_builder.user_agent =
+ user_agent_; // User-Agent request header field.
+ context_config_builder.mock_cert_verifier = std::move(
+ mock_cert_verifier_); // MockCertVerifier to use for testing purposes.
+ std::unique_ptr<URLRequestContextConfig> config =
+ context_config_builder.Build();
net::URLRequestContextBuilder context_builder;
« no previous file with comments | « no previous file | components/cronet/url_request_context_config.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698