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

Unified Diff: content/browser/loader/resource_dispatcher_host_impl.cc

Issue 2283473002: Fixes for the failing URLLoaderFactoryImplTest content_unittests with PlzNavigate enabled (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address comments Created 4 years, 4 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 | « content/browser/loader/DEPS ('k') | content/browser/loader/test_url_loader_client.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/loader/resource_dispatcher_host_impl.cc
diff --git a/content/browser/loader/resource_dispatcher_host_impl.cc b/content/browser/loader/resource_dispatcher_host_impl.cc
index 847f0fd5f9d82e6dd5d54a4e4db3d75360c35fde..0d23f6a44af363fc00f2b0aa09df6018c3020d89 100644
--- a/content/browser/loader/resource_dispatcher_host_impl.cc
+++ b/content/browser/loader/resource_dispatcher_host_impl.cc
@@ -1282,8 +1282,10 @@ void ResourceDispatcherHostImpl::BeginRequest(
bool is_navigation_stream_request =
IsBrowserSideNavigationEnabled() &&
IsResourceTypeFrame(request_data.resource_type);
- if (is_navigation_stream_request &&
- !request_data.resource_body_stream_url.SchemeIs(url::kBlobScheme)) {
+ // The process_type check is to ensure that unittests are not blocked from
+ // issuing http requests.
+ if ((process_type == PROCESS_TYPE_RENDERER) && is_navigation_stream_request
+ && !request_data.resource_body_stream_url.SchemeIs(url::kBlobScheme)) {
bad_message::ReceivedBadMessage(filter_, bad_message::RDH_INVALID_URL);
return;
}
@@ -1398,7 +1400,8 @@ void ResourceDispatcherHostImpl::ContinuePendingBeginRequest(
bool is_navigation_stream_request =
IsBrowserSideNavigationEnabled() &&
- IsResourceTypeFrame(request_data.resource_type);
+ IsResourceTypeFrame(request_data.resource_type) &&
+ process_type == PROCESS_TYPE_RENDERER;
ResourceContext* resource_context = NULL;
net::URLRequestContext* request_context = NULL;
@@ -1687,8 +1690,10 @@ ResourceDispatcherHostImpl::AddStandardHandlers(
// PlzNavigate: do not add ResourceThrottles for main resource requests from
// the renderer. Decisions about the navigation should have been done in the
// initial request.
- if (IsBrowserSideNavigationEnabled() && IsResourceTypeFrame(resource_type) &&
- child_id != -1) {
+ bool is_renderer =
+ filter_ ? (filter_->process_type() == PROCESS_TYPE_RENDERER) : false;
+ if (is_renderer && IsBrowserSideNavigationEnabled() &&
+ IsResourceTypeFrame(resource_type)) {
DCHECK(request->url().SchemeIs(url::kBlobScheme));
return handler;
}
« no previous file with comments | « content/browser/loader/DEPS ('k') | content/browser/loader/test_url_loader_client.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698