summaryrefslogtreecommitdiffstats
path: root/content/shell/browser/shell_url_request_context_getter.cc
diff options
context:
space:
mode:
authorhanxi <hanxi@chromium.org>2014-10-09 06:27:11 -0700
committerCommit bot <commit-bot@chromium.org>2014-10-09 13:27:32 +0000
commit3328d99286e14e8c31b922c995fb7de7804bba69 (patch)
tree48663f478ded6b62f3999937e879dddb930cdd4a /content/shell/browser/shell_url_request_context_getter.cc
parent3c200fad33da10ca7b7bda1bba471d80ac570649 (diff)
downloadchromium_src-3328d99286e14e8c31b922c995fb7de7804bba69.zip
chromium_src-3328d99286e14e8c31b922c995fb7de7804bba69.tar.gz
chromium_src-3328d99286e14e8c31b922c995fb7de7804bba69.tar.bz2
Fix bug: AppShell: CHECK failure in PeerConnection init.
The bug was caused due to a missing step to reset the url_request_getter in resource_context_ after initializing a url_request_context_getter in extensions::ShellBrowserContext, refer to CL (https://codereview.chromium.org/615583003/). To fix this bug, a refactor is done in this CL, including: - ExtensionURLRequestContextGetter was originally implemented in the wrong directory. It's only used by app_shell, hence it belongs in extensions/shell/browser. Rename and move ExtensionURLRequestContextGetter to extensions::ShellURLRequestContextGetter and put it in extensions/shell/browser. Also share code as much as possible with content::ShellURLRequestContextGetter; - Rename and move ExtensionNetworkDelegate to extensions::ShellNetworkDelegate and live in extensions/shell/browser; - Reuse content/shell/common/shell_switches.h for kDumpRenderTree. BUG=420698 Review URL: https://codereview.chromium.org/631203003 Cr-Commit-Position: refs/heads/master@{#298862}
Diffstat (limited to 'content/shell/browser/shell_url_request_context_getter.cc')
-rw-r--r--content/shell/browser/shell_url_request_context_getter.cc6
1 files changed, 5 insertions, 1 deletions
diff --git a/content/shell/browser/shell_url_request_context_getter.cc b/content/shell/browser/shell_url_request_context_getter.cc
index c606d13..4788d28 100644
--- a/content/shell/browser/shell_url_request_context_getter.cc
+++ b/content/shell/browser/shell_url_request_context_getter.cc
@@ -91,6 +91,10 @@ ShellURLRequestContextGetter::ShellURLRequestContextGetter(
ShellURLRequestContextGetter::~ShellURLRequestContextGetter() {
}
+net::NetworkDelegate* ShellURLRequestContextGetter::CreateNetworkDelegate() {
+ return new ShellNetworkDelegate;
+}
+
net::URLRequestContext* ShellURLRequestContextGetter::GetURLRequestContext() {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
@@ -99,7 +103,7 @@ net::URLRequestContext* ShellURLRequestContextGetter::GetURLRequestContext() {
url_request_context_.reset(new net::URLRequestContext());
url_request_context_->set_net_log(net_log_);
- network_delegate_.reset(new ShellNetworkDelegate);
+ network_delegate_.reset(CreateNetworkDelegate());
if (command_line.HasSwitch(switches::kDumpRenderTree))
ShellNetworkDelegate::SetAcceptAllCookies(false);
url_request_context_->set_network_delegate(network_delegate_.get());