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

Unified Diff: net/url_request/url_request_unittest.cc

Issue 1295523006: Using scoped_ptr for URLRequestJobFactoryImpl::SetProtocolHandler (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Removing un-modified file Created 5 years, 4 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_test_job.cc ('k') | remoting/host/token_validator_factory_impl_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/url_request/url_request_unittest.cc
diff --git a/net/url_request/url_request_unittest.cc b/net/url_request/url_request_unittest.cc
index 96067128c2663a0d255637e97c33a60044aa9392..8e6816e7fbaf30affea0ad7342f87f141f009d30 100644
--- a/net/url_request/url_request_unittest.cc
+++ b/net/url_request/url_request_unittest.cc
@@ -666,10 +666,12 @@ class URLRequestTest : public PlatformTest {
}
virtual void SetUpFactory() {
- job_factory_impl_->SetProtocolHandler("data", new DataProtocolHandler);
+ job_factory_impl_->SetProtocolHandler(
+ "data", make_scoped_ptr(new DataProtocolHandler));
#if !defined(DISABLE_FILE_SUPPORT)
job_factory_impl_->SetProtocolHandler(
- "file", new FileProtocolHandler(base::ThreadTaskRunnerHandle::Get()));
+ "file", make_scoped_ptr(new FileProtocolHandler(
+ base::ThreadTaskRunnerHandle::Get())));
#endif
}
@@ -685,8 +687,9 @@ class URLRequestTest : public PlatformTest {
// Adds the TestJobInterceptor to the default context.
TestJobInterceptor* AddTestInterceptor() {
TestJobInterceptor* protocol_handler_ = new TestJobInterceptor();
- job_factory_impl_->SetProtocolHandler("http", NULL);
- job_factory_impl_->SetProtocolHandler("http", protocol_handler_);
+ job_factory_impl_->SetProtocolHandler("http", nullptr);
+ job_factory_impl_->SetProtocolHandler("http",
+ make_scoped_ptr(protocol_handler_));
return protocol_handler_;
}
@@ -9086,7 +9089,8 @@ class URLRequestTestFTP : public URLRequestTest {
void SetUpFactory() override {
// Add FTP support to the default URLRequestContext.
job_factory_impl_->SetProtocolHandler(
- "ftp", new FtpProtocolHandler(&ftp_transaction_factory_));
+ "ftp",
+ make_scoped_ptr(new FtpProtocolHandler(&ftp_transaction_factory_)));
}
std::string GetTestFileContents() {
« no previous file with comments | « net/url_request/url_request_test_job.cc ('k') | remoting/host/token_validator_factory_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698