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

Side by Side Diff: components/cronet/url_request_context_config.cc

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 unified diff | Download patch
OLDNEW
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 #include "components/cronet/url_request_context_config.h" 5 #include "components/cronet/url_request_context_config.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/json/json_reader.h" 9 #include "base/json/json_reader.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 374 matching lines...) Expand 10 before | Expand all | Expand 10 after
385 cert_verifier = base::MakeUnique<net::CachingCertVerifier>( 385 cert_verifier = base::MakeUnique<net::CachingCertVerifier>(
386 std::move(mock_cert_verifier)); 386 std::move(mock_cert_verifier));
387 } else { 387 } else {
388 // net::CertVerifier::CreateDefault() returns a CachingCertVerifier. 388 // net::CertVerifier::CreateDefault() returns a CachingCertVerifier.
389 cert_verifier = net::CertVerifier::CreateDefault(); 389 cert_verifier = net::CertVerifier::CreateDefault();
390 } 390 }
391 context_builder->SetCertVerifier(std::move(cert_verifier)); 391 context_builder->SetCertVerifier(std::move(cert_verifier));
392 // TODO(mef): Use |config| to set cookies. 392 // TODO(mef): Use |config| to set cookies.
393 } 393 }
394 394
395 URLRequestContextConfigBuilder::URLRequestContextConfigBuilder() {}
396 URLRequestContextConfigBuilder::~URLRequestContextConfigBuilder() {}
397
398 std::unique_ptr<URLRequestContextConfig>
399 URLRequestContextConfigBuilder::Build() {
400 std::unique_ptr<URLRequestContextConfig> config(new URLRequestContextConfig(
mef 2016/12/20 19:32:04 nit: base::MakeUnique<T> is preferred: https://cs.
lilyhoughton 2016/12/20 21:31:40 Done.
401 enable_quic, quic_user_agent_id, enable_spdy, enable_sdch, http_cache,
402 http_cache_max_size, load_disable_cache, storage_path, user_agent,
403 experimental_options, data_reduction_proxy_key,
404 data_reduction_primary_proxy, data_reduction_fallback_proxy,
405 data_reduction_secure_proxy_check_url, std::move(mock_cert_verifier),
mef 2016/12/20 19:32:04 It seems that calling Build() more than once would
lilyhoughton 2016/12/20 21:31:40 Done, documented in comment for |Build()| in .h
406 enable_network_quality_estimator,
407 bypass_public_key_pinning_for_local_trust_anchors, cert_verifier_data));
408 return config;
409 }
410
395 } // namespace cronet 411 } // namespace cronet
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698