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

Unified Diff: content/shell/browser/shell_url_request_context_getter.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_url_request_context_getter.cc
diff --git a/content/shell/browser/shell_url_request_context_getter.cc b/content/shell/browser/shell_url_request_context_getter.cc
index c606d13cba040da14893d3af6cbb154097a0c33b..cd65b7738e4bfb6315e908f82f3ad61c4a5f96c9 100644
--- a/content/shell/browser/shell_url_request_context_getter.cc
+++ b/content/shell/browser/shell_url_request_context_getter.cc
@@ -91,6 +91,15 @@ ShellURLRequestContextGetter::ShellURLRequestContextGetter(
ShellURLRequestContextGetter::~ShellURLRequestContextGetter() {
}
+void ShellURLRequestContextGetter::set_network_delegate(
+ net::NetworkDelegate* network_delegate) {
+ network_delegate_.reset(network_delegate);
+}
+
+net::NetworkDelegate* ShellURLRequestContextGetter::CreateNetworkDelegate() {
+ return new ShellNetworkDelegate();
+}
+
net::URLRequestContext* ShellURLRequestContextGetter::GetURLRequestContext() {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
@@ -99,7 +108,8 @@ net::URLRequestContext* ShellURLRequestContextGetter::GetURLRequestContext() {
url_request_context_.reset(new net::URLRequestContext());
url_request_context_->set_net_log(net_log_);
- network_delegate_.reset(new ShellNetworkDelegate);
+ if (!network_delegate_)
+ network_delegate_.reset(CreateNetworkDelegate());
if (command_line.HasSwitch(switches::kDumpRenderTree))
ShellNetworkDelegate::SetAcceptAllCookies(false);
url_request_context_->set_network_delegate(network_delegate_.get());

Powered by Google App Engine
This is Rietveld 408576698