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

Unified Diff: content/shell/shell_url_request_context_getter.cc

Issue 11896113: Add chrome-search: access from Instant overlay (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address Charlie's comments. Created 7 years, 10 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
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()));

Powered by Google App Engine
This is Rietveld 408576698