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

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

Issue 1905033002: PlzNavigate: Move navigation-level mixed content checks to the browser. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@console-security-message
Patch Set: Overall code cleanup to request reviewers to PTAL. Created 4 years, 5 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/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 b0969b5979c3686eba4063d994b5c8116a81687a..058d36c9c8deff00ed588ccbb2d06e9486a9eb76 100644
--- a/content/browser/loader/resource_dispatcher_host_impl.cc
+++ b/content/browser/loader/resource_dispatcher_host_impl.cc
@@ -1633,9 +1633,10 @@ ResourceDispatcherHostImpl::CreateResourceHandler(
handler.reset(new CrossSiteResourceHandler(std::move(handler), request));
}
- return AddStandardHandlers(request, request_data.resource_type,
- resource_context, filter_->appcache_service(),
- child_id, route_id, std::move(handler));
+ return AddStandardHandlers(
+ request, request_data.resource_type, resource_context,
+ request_data.fetch_request_context_type, filter_->appcache_service(),
+ child_id, route_id, std::move(handler));
}
std::unique_ptr<ResourceHandler>
@@ -1643,6 +1644,7 @@ ResourceDispatcherHostImpl::AddStandardHandlers(
net::URLRequest* request,
ResourceType resource_type,
ResourceContext* resource_context,
+ RequestContextType fetch_request_context_type,
AppCacheService* appcache_service,
int child_id,
int route_id,
@@ -1669,8 +1671,10 @@ ResourceDispatcherHostImpl::AddStandardHandlers(
// Add a NavigationResourceThrottle for navigations.
// PlzNavigate: the throttle is unnecessary as communication with the UI
// thread is handled by the NavigationURLloader.
- if (!IsBrowserSideNavigationEnabled() && IsResourceTypeFrame(resource_type))
- throttles.push_back(new NavigationResourceThrottle(request, delegate()));
+ if (!IsBrowserSideNavigationEnabled() && IsResourceTypeFrame(resource_type)) {
+ throttles.push_back(new NavigationResourceThrottle(
+ request, delegate(), fetch_request_context_type));
+ }
if (delegate_) {
delegate_->RequestBeginning(request,
@@ -2253,15 +2257,18 @@ void ResourceDispatcherHostImpl::BeginNavigationRequest(
std::unique_ptr<ResourceHandler> handler(
new NavigationResourceHandler(new_request.get(), loader, delegate()));
+ // TODO(carlosk): set the RequestContextType in a more correct way, if needed.
+ // Source of inspiration: determineRequestContextFromNavigationType in
+ // FrameLoader.cpp.
// TODO(davidben): Pass in the appropriate appcache_service. Also fix the
// dependency on child_id/route_id. Those are used by the ResourceScheduler;
// currently it's a no-op.
- handler =
- AddStandardHandlers(new_request.get(), resource_type, resource_context,
- nullptr, // appcache_service
- -1, // child_id
- -1, // route_id
- std::move(handler));
+ handler = AddStandardHandlers(new_request.get(), resource_type,
+ resource_context, REQUEST_CONTEXT_TYPE_LOCATION,
+ nullptr, // appcache_service
+ -1, // child_id
+ -1, // route_id
+ std::move(handler));
BeginRequestInternal(std::move(new_request), std::move(handler));
}

Powered by Google App Engine
This is Rietveld 408576698