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

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

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/ios/cronet_environment.mm
diff --git a/components/cronet/ios/cronet_environment.mm b/components/cronet/ios/cronet_environment.mm
index 62c8407aa863134ef03416e4a4c95733e2582e29..86dd72ea35d66a66dd95fb9a7fc46d55d9d54457 100644
--- a/components/cronet/ios/cronet_environment.mm
+++ b/components/cronet/ios/cronet_environment.mm
@@ -269,26 +269,17 @@ 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 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 SPDY
+ 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') | components/cronet/url_request_context_config.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698