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

Unified Diff: content/browser/loader/navigation_resource_throttle.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: MixedContent::ContextType comes from the renderer; lessen Blink public code; fixed build. Created 3 years, 11 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/navigation_resource_throttle.cc
diff --git a/content/browser/loader/navigation_resource_throttle.cc b/content/browser/loader/navigation_resource_throttle.cc
index 5ce1654f7660b3a0cd17866eef12273dee66d62c..8be8ee1cfc0c23214f137d59ccbf976be431bf9b 100644
--- a/content/browser/loader/navigation_resource_throttle.cc
+++ b/content/browser/loader/navigation_resource_throttle.cc
@@ -99,7 +99,8 @@ void CheckWillStartRequestOnUIThread(
bool has_user_gesture,
ui::PageTransition transition,
bool is_external_protocol,
- RequestContextType request_context_type) {
+ RequestContextType request_context_type,
+ blink::WebMixedContent::ContextType mixed_content_context_type) {
DCHECK_CURRENTLY_ON(BrowserThread::UI);
NavigationHandleImpl* navigation_handle =
FindNavigationHandle(render_process_id, render_frame_host_id, callback);
@@ -109,6 +110,7 @@ void CheckWillStartRequestOnUIThread(
navigation_handle->WillStartRequest(
method, resource_request_body, sanitized_referrer, has_user_gesture,
transition, is_external_protocol, request_context_type,
+ mixed_content_context_type,
base::Bind(&SendCheckResultToIOThread, callback));
}
@@ -178,10 +180,12 @@ void WillProcessResponseOnUIThread(
NavigationResourceThrottle::NavigationResourceThrottle(
net::URLRequest* request,
ResourceDispatcherHostDelegate* resource_dispatcher_host_delegate,
- RequestContextType request_context_type)
+ RequestContextType request_context_type,
+ blink::WebMixedContent::ContextType mixed_content_context_type)
: request_(request),
resource_dispatcher_host_delegate_(resource_dispatcher_host_delegate),
request_context_type_(request_context_type),
+ mixed_content_context_type_(mixed_content_context_type),
in_cross_site_transition_(false),
on_transfer_done_result_(NavigationThrottle::DEFER),
weak_ptr_factory_(this) {}
@@ -214,7 +218,8 @@ void NavigationResourceThrottle::WillStartRequest(bool* defer) {
request_->url(), Referrer(GURL(request_->referrer()),
info->GetReferrerPolicy())),
info->HasUserGesture(), info->GetPageTransition(),
- is_external_protocol, request_context_type_));
+ is_external_protocol, request_context_type_,
+ mixed_content_context_type_));
*defer = true;
}

Powered by Google App Engine
This is Rietveld 408576698