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

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: Yet another rebase Created 7 years, 9 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
« no previous file with comments | « android_webview/browser/net/aw_url_request_context_getter.h ('k') | chrome/browser/browser_process_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 1b7177b641a846cb6198c2bd460a835ab24a48ec..9e7b8b0eaa0a688d12e264e163b0d037a46ab9fb 100644
--- a/android_webview/browser/net/aw_url_request_context_getter.cc
+++ b/android_webview/browser/net/aw_url_request_context_getter.cc
@@ -106,23 +106,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_ = CreateAndroidJobFactory(job_factory.Pass());
@@ -130,9 +129,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()));
url_request_context_->set_job_factory(job_factory_.get());
}
return url_request_context_.get();
@@ -144,21 +140,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
« no previous file with comments | « android_webview/browser/net/aw_url_request_context_getter.h ('k') | chrome/browser/browser_process_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698