diff options
Diffstat (limited to 'chrome/browser')
5 files changed, 29 insertions, 25 deletions
diff --git a/chrome/browser/extensions/api/web_request/web_request_api_unittest.cc b/chrome/browser/extensions/api/web_request/web_request_api_unittest.cc index 2006e6f..5cfdd3b 100644 --- a/chrome/browser/extensions/api/web_request/web_request_api_unittest.cc +++ b/chrome/browser/extensions/api/web_request/web_request_api_unittest.cc @@ -238,8 +238,9 @@ TEST_F(ExtensionWebRequestTest, BlockingEventPrecedenceRedirect) { ipc_sender_factory.GetWeakPtr()); net::URLRequestJobFactoryImpl job_factory; - job_factory.SetProtocolHandler(url::kAboutScheme, - new about_handler::AboutProtocolHandler()); + job_factory.SetProtocolHandler( + url::kAboutScheme, + make_scoped_ptr(new about_handler::AboutProtocolHandler())); context_->set_job_factory(&job_factory); GURL redirect_url("about:redirected"); diff --git a/chrome/browser/extensions/extension_resource_protocols.cc b/chrome/browser/extensions/extension_resource_protocols.cc index c24b53f..d40de60 100644 --- a/chrome/browser/extensions/extension_resource_protocols.cc +++ b/chrome/browser/extensions/extension_resource_protocols.cc @@ -94,7 +94,7 @@ ExtensionResourceProtocolHandler::MaybeCreateJob( } // namespace -net::URLRequestJobFactory::ProtocolHandler* +scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> CreateExtensionResourceProtocolHandler() { - return new ExtensionResourceProtocolHandler(); + return make_scoped_ptr(new ExtensionResourceProtocolHandler()); } diff --git a/chrome/browser/extensions/extension_resource_protocols.h b/chrome/browser/extensions/extension_resource_protocols.h index cf6c1e4..85933a7 100644 --- a/chrome/browser/extensions/extension_resource_protocols.h +++ b/chrome/browser/extensions/extension_resource_protocols.h @@ -5,10 +5,11 @@ #ifndef CHROME_BROWSER_EXTENSIONS_EXTENSION_RESOURCE_PROTOCOLS_H_ #define CHROME_BROWSER_EXTENSIONS_EXTENSION_RESOURCE_PROTOCOLS_H_ +#include "base/memory/scoped_ptr.h" #include "net/url_request/url_request_job_factory.h" // Creates the handlers for the chrome-extension-resource:// scheme. -net::URLRequestJobFactory::ProtocolHandler* +scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> CreateExtensionResourceProtocolHandler(); #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_RESOURCE_PROTOCOLS_H_ diff --git a/chrome/browser/io_thread.cc b/chrome/browser/io_thread.cc index 1df1aff..3b513e2 100644 --- a/chrome/browser/io_thread.cc +++ b/chrome/browser/io_thread.cc @@ -849,21 +849,21 @@ void IOThread::Init() { tracked_objects::ScopedTracker tracking_profile16( FROM_HERE_WITH_EXPLICIT_FUNCTION( "466432 IOThread::InitAsync::SetProtocolHandler")); - job_factory->SetProtocolHandler(url::kDataScheme, - new net::DataProtocolHandler()); + job_factory->SetProtocolHandler( + url::kDataScheme, make_scoped_ptr(new net::DataProtocolHandler())); job_factory->SetProtocolHandler( url::kFileScheme, - new net::FileProtocolHandler( - content::BrowserThread::GetBlockingPool()-> - GetTaskRunnerWithShutdownBehavior( - base::SequencedWorkerPool::SKIP_ON_SHUTDOWN))); + make_scoped_ptr(new net::FileProtocolHandler( + content::BrowserThread::GetBlockingPool() + ->GetTaskRunnerWithShutdownBehavior( + base::SequencedWorkerPool::SKIP_ON_SHUTDOWN)))); #if !defined(DISABLE_FTP_SUPPORT) globals_->proxy_script_fetcher_ftp_transaction_factory.reset( new net::FtpNetworkLayer(globals_->host_resolver.get())); job_factory->SetProtocolHandler( url::kFtpScheme, - new net::FtpProtocolHandler( - globals_->proxy_script_fetcher_ftp_transaction_factory.get())); + make_scoped_ptr(new net::FtpProtocolHandler( + globals_->proxy_script_fetcher_ftp_transaction_factory.get()))); #endif globals_->proxy_script_fetcher_url_request_job_factory = job_factory.Pass(); diff --git a/chrome/browser/profiles/profile_io_data.cc b/chrome/browser/profiles/profile_io_data.cc index bd766ae..911d5b9 100644 --- a/chrome/browser/profiles/profile_io_data.cc +++ b/chrome/browser/profiles/profile_io_data.cc @@ -741,7 +741,7 @@ void ProfileIOData::InstallProtocolHandlers( it != protocol_handlers->end(); ++it) { bool set_protocol = job_factory->SetProtocolHandler( - it->first, it->second.release()); + it->first, make_scoped_ptr(it->second.release())); DCHECK(set_protocol); } protocol_handlers->clear(); @@ -1160,10 +1160,10 @@ scoped_ptr<net::URLRequestJobFactory> ProfileIOData::SetUpJobFactoryDefaults( // ProfileIOData::IsHandledProtocol(). bool set_protocol = job_factory->SetProtocolHandler( url::kFileScheme, - new net::FileProtocolHandler( - content::BrowserThread::GetBlockingPool()-> - GetTaskRunnerWithShutdownBehavior( - base::SequencedWorkerPool::SKIP_ON_SHUTDOWN))); + make_scoped_ptr(new net::FileProtocolHandler( + content::BrowserThread::GetBlockingPool() + ->GetTaskRunnerWithShutdownBehavior( + base::SequencedWorkerPool::SKIP_ON_SHUTDOWN)))); DCHECK(set_protocol); #if defined(ENABLE_EXTENSIONS) @@ -1181,13 +1181,14 @@ scoped_ptr<net::URLRequestJobFactory> ProfileIOData::SetUpJobFactoryDefaults( DCHECK(set_protocol); #endif set_protocol = job_factory->SetProtocolHandler( - url::kDataScheme, new net::DataProtocolHandler()); + url::kDataScheme, make_scoped_ptr(new net::DataProtocolHandler())); DCHECK(set_protocol); #if defined(OS_CHROMEOS) if (profile_params_) { set_protocol = job_factory->SetProtocolHandler( content::kExternalFileScheme, - new chromeos::ExternalFileProtocolHandler(profile_params_->profile)); + make_scoped_ptr(new chromeos::ExternalFileProtocolHandler( + profile_params_->profile))); DCHECK(set_protocol); } #endif // defined(OS_CHROMEOS) @@ -1195,18 +1196,19 @@ scoped_ptr<net::URLRequestJobFactory> ProfileIOData::SetUpJobFactoryDefaults( set_protocol = job_factory->SetProtocolHandler( url::kContentScheme, content::ContentProtocolHandler::Create( - content::BrowserThread::GetBlockingPool()-> - GetTaskRunnerWithShutdownBehavior( + content::BrowserThread::GetBlockingPool() + ->GetTaskRunnerWithShutdownBehavior( base::SequencedWorkerPool::SKIP_ON_SHUTDOWN))); #endif - job_factory->SetProtocolHandler(url::kAboutScheme, - new about_handler::AboutProtocolHandler()); + job_factory->SetProtocolHandler( + url::kAboutScheme, + make_scoped_ptr(new about_handler::AboutProtocolHandler())); #if !defined(DISABLE_FTP_SUPPORT) DCHECK(ftp_transaction_factory); job_factory->SetProtocolHandler( url::kFtpScheme, - new net::FtpProtocolHandler(ftp_transaction_factory)); + make_scoped_ptr(new net::FtpProtocolHandler(ftp_transaction_factory))); #endif // !defined(DISABLE_FTP_SUPPORT) #if defined(DEBUG_DEVTOOLS) |