Chromium Code Reviews| 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..415a4a3d9dd64cb50f619d9c0b86fa58dbcb3087 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 we don't block unittests from |
|
clamy
2016/08/25 23:14:04
nit: s/we don't block unittests/unittests are not
ananta
2016/08/25 23:39:20
Done.
|
| + // 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; |
|
clamy
2016/08/25 23:14:04
nit: The child_id != -1 below also checks if this
ananta
2016/08/25 23:39:20
Done.
|
| + if (is_renderer && IsBrowserSideNavigationEnabled() && |
| + IsResourceTypeFrame(resource_type) && child_id != -1) { |
| DCHECK(request->url().SchemeIs(url::kBlobScheme)); |
| return handler; |
| } |