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

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: Addressed all jam@ latest comments. 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/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 eba07da522c327c1ceb5d2da68d6918584214342..aa2cd527020da875dea0ab1a36c9c05e9e39f663 100644
--- a/content/browser/frame_host/navigation_handle_impl.cc
+++ b/content/browser/frame_host/navigation_handle_impl.cc
@@ -14,6 +14,7 @@
#include "content/browser/frame_host/ancestor_throttle.h"
#include "content/browser/frame_host/debug_urls.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/loader/resource_dispatcher_host_impl.h"
@@ -30,6 +31,7 @@
#include "content/public/common/url_constants.h"
#include "net/base/net_errors.h"
#include "net/url_request/redirect_info.h"
+#include "third_party/WebKit/public/platform/WebMixedContentContextType.h"
#include "url/gurl.h"
#include "url/url_constants.h"
@@ -92,6 +94,7 @@ NavigationHandleImpl::NavigationHandleImpl(
navigation_start_(navigation_start),
pending_nav_entry_id_(pending_nav_entry_id),
request_context_type_(REQUEST_CONTEXT_TYPE_UNSPECIFIED),
+ mixed_content_context_type_(blink::WebMixedContentContextType::Blockable),
should_replace_current_entry_(false),
is_download_(false),
is_stream_(false),
@@ -315,6 +318,7 @@ NavigationHandleImpl::CallWillStartRequestForTesting(
WillStartRequest(method, resource_request_body, sanitized_referrer,
has_user_gesture, transition, is_external_protocol,
REQUEST_CONTEXT_TYPE_LOCATION,
+ blink::WebMixedContentContextType::Blockable,
base::Bind(&UpdateThrottleCheckResult, &result));
// Reset the callback to ensure it will not be called later.
@@ -422,6 +426,7 @@ void NavigationHandleImpl::WillStartRequest(
ui::PageTransition transition,
bool is_external_protocol,
RequestContextType request_context_type,
+ blink::WebMixedContentContextType mixed_content_context_type,
const ThrottleChecksFinishedCallback& callback) {
if (method != "POST")
DCHECK(!resource_request_body);
@@ -435,6 +440,7 @@ void NavigationHandleImpl::WillStartRequest(
transition_ = transition;
is_external_protocol_ = is_external_protocol;
request_context_type_ = request_context_type;
+ mixed_content_context_type_ = mixed_content_context_type;
state_ = WILL_SEND_REQUEST;
complete_callback_ = callback;
@@ -783,6 +789,10 @@ void NavigationHandleImpl::RegisterNavigationThrottles() {
// GetNavigationThrottles is not assigned to throttles_ directly because it
// would overwrite any throttle previously added with
// RegisterThrottleForTesting.
+ if (IsBrowserSideNavigationEnabled()) {
+ throttles_.insert(throttles_.end(),
+ new MixedContentNavigationThrottle(this));
+ }
ScopedVector<NavigationThrottle> throttles_to_register =
GetDelegate()->CreateThrottlesForNavigation(this);
std::unique_ptr<NavigationThrottle> devtools_throttle =

Powered by Google App Engine
This is Rietveld 408576698