| Index: content/shell/shell_url_request_context_getter.cc
|
| diff --git a/content/shell/shell_url_request_context_getter.cc b/content/shell/shell_url_request_context_getter.cc
|
| index c5ba28a5a4dd506a1ef4a0d1f8249f1d3cf512b0..74c8df4fe5adf45fbf866e8d12505322d4f660ea 100644
|
| --- a/content/shell/shell_url_request_context_getter.cc
|
| +++ b/content/shell/shell_url_request_context_getter.cc
|
| @@ -41,28 +41,18 @@ ShellURLRequestContextGetter::ShellURLRequestContextGetter(
|
| MessageLoop* io_loop,
|
| MessageLoop* file_loop,
|
| scoped_ptr<net::URLRequestJobFactory::ProtocolHandler>
|
| - blob_protocol_handler,
|
| - scoped_ptr<net::URLRequestJobFactory::ProtocolHandler>
|
| - file_system_protocol_handler,
|
| - scoped_ptr<net::URLRequestJobFactory::ProtocolHandler>
|
| developer_protocol_handler,
|
| - scoped_ptr<net::URLRequestJobFactory::ProtocolHandler>
|
| - chrome_protocol_handler,
|
| - scoped_ptr<net::URLRequestJobFactory::ProtocolHandler>
|
| - chrome_devtools_protocol_handler)
|
| + content::ProtocolHandlerMap* protocol_handlers)
|
| : ignore_certificate_errors_(ignore_certificate_errors),
|
| base_path_(base_path),
|
| io_loop_(io_loop),
|
| file_loop_(file_loop),
|
| - blob_protocol_handler_(blob_protocol_handler.Pass()),
|
| - file_system_protocol_handler_(file_system_protocol_handler.Pass()),
|
| - developer_protocol_handler_(developer_protocol_handler.Pass()),
|
| - chrome_protocol_handler_(chrome_protocol_handler.Pass()),
|
| - chrome_devtools_protocol_handler_(
|
| - chrome_devtools_protocol_handler.Pass()) {
|
| + developer_protocol_handler_(developer_protocol_handler.Pass()) {
|
| // Must first be created on the UI thread.
|
| DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
|
|
|
| + std::swap(protocol_handlers_, *protocol_handlers));
|
| +
|
| // We must create the proxy config service on the UI loop on Linux because it
|
| // must synchronously run on the glib message loop. This will be passed to
|
| // the URLRequestContextStorage on the IO thread in GetURLRequestContext().
|
| @@ -173,19 +163,8 @@ net::URLRequestContext* ShellURLRequestContextGetter::GetURLRequestContext() {
|
|
|
| scoped_ptr<net::URLRequestJobFactoryImpl> job_factory(
|
| new net::URLRequestJobFactoryImpl());
|
| - bool set_protocol = job_factory->SetProtocolHandler(
|
| - chrome::kBlobScheme, blob_protocol_handler_.release());
|
| - DCHECK(set_protocol);
|
| - set_protocol = job_factory->SetProtocolHandler(
|
| - chrome::kFileSystemScheme, file_system_protocol_handler_.release());
|
| - DCHECK(set_protocol);
|
| - set_protocol = job_factory->SetProtocolHandler(
|
| - chrome::kChromeUIScheme, chrome_protocol_handler_.release());
|
| - DCHECK(set_protocol);
|
| - set_protocol = job_factory->SetProtocolHandler(
|
| - chrome::kChromeDevToolsScheme,
|
| - chrome_devtools_protocol_handler_.release());
|
| - DCHECK(set_protocol);
|
| + ContentBrowserClient::InstallProtocolHandlers(job_factory.get(),
|
| + &protocol_handlers_);
|
| storage_->set_job_factory(new net::ProtocolInterceptJobFactory(
|
| job_factory.PassAs<net::URLRequestJobFactory>(),
|
| developer_protocol_handler_.Pass()));
|
|
|