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

Unified Diff: android_webview/browser/net/aw_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: include nit 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: android_webview/browser/net/aw_url_request_context_getter.cc
diff --git a/android_webview/browser/net/aw_url_request_context_getter.cc b/android_webview/browser/net/aw_url_request_context_getter.cc
index 6ec1aad7db56be9a00b7ec48b95294e4e9187db7..7a5f18d09e3a951fad024f85fe498b3a47727799 100644
--- a/android_webview/browser/net/aw_url_request_context_getter.cc
+++ b/android_webview/browser/net/aw_url_request_context_getter.cc
@@ -99,23 +99,22 @@ net::URLRequestContext* AwURLRequestContextGetter::GetURLRequestContext() {
set_protocol = job_factory->SetProtocolHandler(
chrome::kDataScheme, new net::DataProtocolHandler());
DCHECK(set_protocol);
- DCHECK(blob_protocol_handler_);
set_protocol = job_factory->SetProtocolHandler(
- chrome::kBlobScheme, blob_protocol_handler_.release());
+ chrome::kBlobScheme, protocol_handlers_[chrome::kBlobScheme].release());
DCHECK(set_protocol);
- DCHECK(file_system_protocol_handler_);
set_protocol = job_factory->SetProtocolHandler(
- chrome::kFileSystemScheme, file_system_protocol_handler_.release());
+ chrome::kFileSystemScheme,
+ protocol_handlers_[chrome::kFileSystemScheme].release());
DCHECK(set_protocol);
- DCHECK(chrome_protocol_handler_);
set_protocol = job_factory->SetProtocolHandler(
- chrome::kChromeUIScheme, chrome_protocol_handler_.release());
+ chrome::kChromeUIScheme,
+ protocol_handlers_[chrome::kChromeUIScheme].release());
DCHECK(set_protocol);
- DCHECK(chrome_devtools_protocol_handler_);
set_protocol = job_factory->SetProtocolHandler(
chrome::kChromeDevToolsScheme,
- chrome_devtools_protocol_handler_.release());
+ protocol_handlers_[chrome::kChromeDevToolsScheme].release());
DCHECK(set_protocol);
+ protocol_handlers_.clear();
// Create a chain of URLRequestJobFactories. Keep |job_factory_| pointed
// at the beginning of the chain.
job_factory_ = CreateAndroidJobFactoryAndCookieMonster(
@@ -124,9 +123,6 @@ net::URLRequestContext* AwURLRequestContextGetter::GetURLRequestContext() {
job_factory_.Pass(),
scoped_ptr<net::URLRequestJobFactory::ProtocolHandler>(
new AwRequestInterceptor())));
- job_factory_.reset(new net::ProtocolInterceptJobFactory(
- job_factory_.Pass(),
- developer_protocol_handler_.Pass()));
Charlie Reis 2013/03/02 04:41:09 Was this intentionally removed? The others seem t
dhollowa 2013/03/04 18:39:35 Yes, this was intentional. Jam asked that I remov
url_request_context_->set_job_factory(job_factory_.get());
}
return url_request_context_.get();
@@ -138,21 +134,8 @@ AwURLRequestContextGetter::GetNetworkTaskRunner() const {
}
void AwURLRequestContextGetter::SetProtocolHandlers(
- 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) {
- 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();
+ content::ProtocolHandlerMap* protocol_handlers) {
+ std::swap(protocol_handlers_, *protocol_handlers);
}
} // namespace android_webview

Powered by Google App Engine
This is Rietveld 408576698