diff options
Diffstat (limited to 'ios')
-rw-r--r-- | ios/crnet/crnet_environment.mm | 6 | ||||
-rw-r--r-- | ios/net/protocol_handler_util_unittest.mm | 6 | ||||
-rw-r--r-- | ios/web/net/request_tracker_impl_unittest.mm | 2 | ||||
-rw-r--r-- | ios/web/shell/shell_url_request_context_getter.cc | 4 | ||||
-rw-r--r-- | ios/web/webui/url_data_manager_ios_backend.cc | 9 | ||||
-rw-r--r-- | ios/web/webui/url_data_manager_ios_backend.h | 4 |
6 files changed, 17 insertions, 14 deletions
diff --git a/ios/crnet/crnet_environment.mm b/ios/crnet/crnet_environment.mm index cdc4546..3eb873a 100644 --- a/ios/crnet/crnet_environment.mm +++ b/ios/crnet/crnet_environment.mm @@ -456,9 +456,11 @@ void CrNetEnvironment::InitializeOnNetworkThread() { net::URLRequestJobFactoryImpl* job_factory = new net::URLRequestJobFactoryImpl; - job_factory->SetProtocolHandler("data", new net::DataProtocolHandler); job_factory->SetProtocolHandler( - "file", new net::FileProtocolHandler(file_thread_->task_runner())); + "data", make_scoped_ptr(new net::DataProtocolHandler)); + job_factory->SetProtocolHandler( + "file", make_scoped_ptr( + new net::FileProtocolHandler(file_thread_->task_runner()))); main_context_->set_job_factory(job_factory); main_context_->set_net_log(net_log_.get()); diff --git a/ios/net/protocol_handler_util_unittest.mm b/ios/net/protocol_handler_util_unittest.mm index da39df6..1193dc7 100644 --- a/ios/net/protocol_handler_util_unittest.mm +++ b/ios/net/protocol_handler_util_unittest.mm @@ -110,8 +110,10 @@ class ProtocolHandlerUtilTest : public testing::Test, public: ProtocolHandlerUtilTest() : request_context_(new TestURLRequestContext) { // Ownership of the protocol handlers is transferred to the factory. - job_factory_.SetProtocolHandler("http", new NetProtocolHandler); - job_factory_.SetProtocolHandler("data", new DataProtocolHandler); + job_factory_.SetProtocolHandler("http", + make_scoped_ptr(new NetProtocolHandler)); + job_factory_.SetProtocolHandler("data", + make_scoped_ptr(new DataProtocolHandler)); request_context_->set_job_factory(&job_factory_); } diff --git a/ios/web/net/request_tracker_impl_unittest.mm b/ios/web/net/request_tracker_impl_unittest.mm index 893f9ab..64da31f 100644 --- a/ios/web/net/request_tracker_impl_unittest.mm +++ b/ios/web/net/request_tracker_impl_unittest.mm @@ -224,7 +224,7 @@ class RequestTrackerTest : public PlatformTest { net::TestJobInterceptor* AddInterceptorToRequest(size_t i) { // |interceptor| will be deleted from |job_factory_|'s destructor. net::TestJobInterceptor* protocol_handler = new net::TestJobInterceptor(); - job_factory_.SetProtocolHandler("http", protocol_handler); + job_factory_.SetProtocolHandler("http", make_scoped_ptr(protocol_handler)); contexts_[i]->set_job_factory(&job_factory_); return protocol_handler; } diff --git a/ios/web/shell/shell_url_request_context_getter.cc b/ios/web/shell/shell_url_request_context_getter.cc index 8cffb68..5d8c660 100644 --- a/ios/web/shell/shell_url_request_context_getter.cc +++ b/ios/web/shell/shell_url_request_context_getter.cc @@ -141,8 +141,8 @@ net::URLRequestContext* ShellURLRequestContextGetter::GetURLRequestContext() { scoped_ptr<net::URLRequestJobFactoryImpl> job_factory( new net::URLRequestJobFactoryImpl()); - bool set_protocol = - job_factory->SetProtocolHandler("data", new net::DataProtocolHandler); + bool set_protocol = job_factory->SetProtocolHandler( + "data", make_scoped_ptr(new net::DataProtocolHandler)); DCHECK(set_protocol); storage_->set_job_factory(job_factory.release()); diff --git a/ios/web/webui/url_data_manager_ios_backend.cc b/ios/web/webui/url_data_manager_ios_backend.cc index 8d1a464..cc3e3e9 100644 --- a/ios/web/webui/url_data_manager_ios_backend.cc +++ b/ios/web/webui/url_data_manager_ios_backend.cc @@ -415,12 +415,11 @@ URLDataManagerIOSBackend::~URLDataManagerIOSBackend() { } // static -net::URLRequestJobFactory::ProtocolHandler* -URLDataManagerIOSBackend::CreateProtocolHandler( - BrowserState* browser_state) { +scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> +URLDataManagerIOSBackend::CreateProtocolHandler(BrowserState* browser_state) { DCHECK(browser_state); - return new ChromeProtocolHandler(browser_state, - browser_state->IsOffTheRecord()); + return make_scoped_ptr(new ChromeProtocolHandler( + browser_state, browser_state->IsOffTheRecord())); } void URLDataManagerIOSBackend::AddDataSource(URLDataSourceIOSImpl* source) { diff --git a/ios/web/webui/url_data_manager_ios_backend.h b/ios/web/webui/url_data_manager_ios_backend.h index d505238..1ad5c84 100644 --- a/ios/web/webui/url_data_manager_ios_backend.h +++ b/ios/web/webui/url_data_manager_ios_backend.h @@ -39,8 +39,8 @@ class URLDataManagerIOSBackend : public base::SupportsUserData::Data { // Invoked to create the protocol handler for chrome://. |is_incognito| should // be set for incognito browser states. Called on the UI thread. - static net::URLRequestJobFactory::ProtocolHandler* CreateProtocolHandler( - BrowserState* browser_state); + static scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> + CreateProtocolHandler(BrowserState* browser_state); // Adds a DataSource to the collection of data sources. void AddDataSource(URLDataSourceIOSImpl* source); |