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

Unified Diff: content/shell/browser/shell_browser_context.cc

Issue 615583003: Introduce NetworkDelegate's implementation in extensions. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 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/browser/shell_browser_context.cc
diff --git a/content/shell/browser/shell_browser_context.cc b/content/shell/browser/shell_browser_context.cc
index 9b0003bb5af73a4d8388024ca6f92a68c2500f90..6d0d60470e80405279de3338fbaa2b11a45090f4 100644
--- a/content/shell/browser/shell_browser_context.cc
+++ b/content/shell/browser/shell_browser_context.cc
@@ -133,11 +133,11 @@ net::URLRequestContextGetter* ShellBrowserContext::GetRequestContext() {
return GetDefaultStoragePartition(this)->GetURLRequestContext();
}
-net::URLRequestContextGetter* ShellBrowserContext::CreateRequestContext(
+content::ShellURLRequestContextGetter*
+ShellBrowserContext::CreateURLRequestContextGetter(
ProtocolHandlerMap* protocol_handlers,
URLRequestInterceptorScopedVector request_interceptors) {
- DCHECK(!url_request_getter_.get());
- url_request_getter_ = new ShellURLRequestContextGetter(
+ return new ShellURLRequestContextGetter(
ignore_certificate_errors_,
GetPath(),
BrowserThread::UnsafeGetMessageLoopForThread(BrowserThread::IO),
@@ -145,10 +145,30 @@ net::URLRequestContextGetter* ShellBrowserContext::CreateRequestContext(
protocol_handlers,
request_interceptors.Pass(),
net_log_);
+}
+
+net::URLRequestContextGetter* ShellBrowserContext::CreateRequestContext(
+ ProtocolHandlerMap* protocol_handlers,
+ URLRequestInterceptorScopedVector request_interceptors) {
+ DCHECK(!url_request_getter_.get());
+ url_request_getter_ = CreateURLRequestContextGetter(
+ protocol_handlers, request_interceptors.Pass());
resource_context_->set_url_request_context_getter(url_request_getter_.get());
return url_request_getter_.get();
}
+net::URLRequestContextGetter* ShellBrowserContext::CreateRequestContext(
+ ProtocolHandlerMap* protocol_handlers,
+ URLRequestInterceptorScopedVector request_interceptors,
+ net::NetworkDelegate* network_delegate) {
+ ShellURLRequestContextGetter* shell_request_context_getter =
+ reinterpret_cast<ShellURLRequestContextGetter*>(CreateRequestContext(
+ protocol_handlers, request_interceptors.Pass()));
+ shell_request_context_getter->set_network_delegate(network_delegate);
+ url_request_getter_ = shell_request_context_getter;
+ return url_request_getter_.get();
+}
+
net::URLRequestContextGetter*
ShellBrowserContext::GetRequestContextForRenderProcess(
int renderer_child_id) {

Powered by Google App Engine
This is Rietveld 408576698