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

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: 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: 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..7ba2d599b0635536cc3803840c8113b97e6a3ba6 100644
--- a/android_webview/browser/net/aw_url_request_context_getter.cc
+++ b/android_webview/browser/net/aw_url_request_context_getter.cc
@@ -101,21 +101,24 @@ net::URLRequestContext* AwURLRequestContextGetter::GetURLRequestContext() {
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(
@@ -139,20 +142,10 @@ 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();
+ content::ProtocolHandlerMap* protocol_handlers) {
developer_protocol_handler_ = developer_protocol_handler.Pass();
- chrome_protocol_handler_ = chrome_protocol_handler.Pass();
- chrome_devtools_protocol_handler_ = chrome_devtools_protocol_handler.Pass();
+ std::swap(protocol_handlers_, *protocol_handlers);
}
} // namespace android_webview

Powered by Google App Engine
This is Rietveld 408576698