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

Unified Diff: content/browser/frame_host/navigation_handle_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/frame_host/navigation_handle_impl.cc
diff --git a/content/browser/frame_host/navigation_handle_impl.cc b/content/browser/frame_host/navigation_handle_impl.cc
index d7dcbefabbf2f06121040f756c61a2c45587d524..54b794aae06a331e5c213c20dbabf12c015539a2 100644
--- a/content/browser/frame_host/navigation_handle_impl.cc
+++ b/content/browser/frame_host/navigation_handle_impl.cc
@@ -8,6 +8,7 @@
#include "base/logging.h"
#include "content/browser/frame_host/frame_tree_node.h"
+#include "content/browser/frame_host/mixed_content_navigation_throttle.h"
#include "content/browser/frame_host/navigator.h"
#include "content/browser/frame_host/navigator_delegate.h"
#include "content/browser/service_worker/service_worker_context_wrapper.h"
@@ -269,6 +270,7 @@ NavigationHandleImpl::CallWillStartRequestForTesting(
WillStartRequest(method, resource_request_body, sanitized_referrer,
has_user_gesture, transition, is_external_protocol,
+ REQUEST_CONTEXT_TYPE_LOCATION,
base::Bind(&UpdateThrottleCheckResult, &result));
// Reset the callback to ensure it will not be called later.
@@ -304,6 +306,7 @@ void NavigationHandleImpl::WillStartRequest(
bool has_user_gesture,
ui::PageTransition transition,
bool is_external_protocol,
+ RequestContextType fetch_request_context_type,
const ThrottleChecksFinishedCallback& callback) {
// |method != "POST"| should imply absence of |resource_request_body|.
if (method != "POST" && resource_request_body) {
@@ -319,10 +322,12 @@ void NavigationHandleImpl::WillStartRequest(
has_user_gesture_ = has_user_gesture;
transition_ = transition;
is_external_protocol_ = is_external_protocol;
-
+ fetch_request_context_type_ = fetch_request_context_type;
state_ = WILL_SEND_REQUEST;
complete_callback_ = callback;
+ throttles_.insert(throttles_.end(), new MixedContentNavigationThrottle(this));
+
// Register the navigation throttles. The ScopedVector returned by
// GetNavigationThrottles is not assigned to throttles_ directly because it
// would overwrite any throttle previously added with

Powered by Google App Engine
This is Rietveld 408576698