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

Unified Diff: net/url_request/url_request_test_util.cc

Issue 1290243007: Shift URLRequestContextStorage over to taking scoped_ptrs. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@Paul_BuilderGrab
Patch Set: Sync'd to revision p349162. Created 5 years, 3 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 | « net/url_request/url_request_ftp_job_unittest.cc ('k') | net/websockets/websocket_test_util.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/url_request/url_request_test_util.cc
diff --git a/net/url_request/url_request_test_util.cc b/net/url_request/url_request_test_util.cc
index 269203489f9f8c64580acec3836c3647a933ac19..af8d139e64b2738aa08996e88cf80720fc43d720 100644
--- a/net/url_request/url_request_test_util.cc
+++ b/net/url_request/url_request_test_util.cc
@@ -79,9 +79,10 @@ void TestURLRequestContext::Init() {
if (!cert_verifier())
context_storage_.set_cert_verifier(CertVerifier::CreateDefault());
if (!transport_security_state())
- context_storage_.set_transport_security_state(new TransportSecurityState);
+ context_storage_.set_transport_security_state(
+ make_scoped_ptr(new TransportSecurityState()));
if (!ssl_config_service())
- context_storage_.set_ssl_config_service(new SSLConfigServiceDefaults);
+ context_storage_.set_ssl_config_service(new SSLConfigServiceDefaults());
if (!http_auth_handler_factory()) {
context_storage_.set_http_auth_handler_factory(
HttpAuthHandlerFactory::CreateDefault(host_resolver()));
@@ -90,10 +91,6 @@ void TestURLRequestContext::Init() {
context_storage_.set_http_server_properties(
scoped_ptr<HttpServerProperties>(new HttpServerPropertiesImpl()));
}
- if (!transport_security_state()) {
- context_storage_.set_transport_security_state(
- new TransportSecurityState());
- }
if (http_transaction_factory()) {
// Make sure we haven't been passed an object we're not going to use.
EXPECT_FALSE(client_socket_factory_);
@@ -111,9 +108,10 @@ void TestURLRequestContext::Init() {
params.network_delegate = network_delegate();
params.http_server_properties = http_server_properties();
params.net_log = net_log();
- context_storage_.set_http_transaction_factory(new HttpCache(
- new HttpNetworkSession(params),
- HttpCache::DefaultBackend::InMemory(0)));
+ context_storage_.set_http_transaction_factory(
+ make_scoped_ptr(new HttpCache(new HttpNetworkSession(params),
+ HttpCache::DefaultBackend::InMemory(0)))
+ .Pass());
}
// In-memory cookie store.
if (!cookie_store())
@@ -126,10 +124,14 @@ void TestURLRequestContext::Init() {
}
if (!http_user_agent_settings()) {
context_storage_.set_http_user_agent_settings(
- new StaticHttpUserAgentSettings("en-us,fr", std::string()));
+ make_scoped_ptr(
+ new StaticHttpUserAgentSettings("en-us,fr", std::string()))
+ .Pass());
+ }
+ if (!job_factory()) {
+ context_storage_.set_job_factory(
+ make_scoped_ptr(new URLRequestJobFactoryImpl()).Pass());
}
- if (!job_factory())
- context_storage_.set_job_factory(new URLRequestJobFactoryImpl);
}
TestURLRequestContextGetter::TestURLRequestContextGetter(
« no previous file with comments | « net/url_request/url_request_ftp_job_unittest.cc ('k') | net/websockets/websocket_test_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698