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

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: Minor changes from nasko@'s comments Created 3 years, 10 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 74e0b202c6f005ffc79bb32c909b01bb847c83f2..811e553cd40d6308ace833b52fb4f4d4ad588739 100644
--- a/content/browser/frame_host/navigation_handle_impl.cc
+++ b/content/browser/frame_host/navigation_handle_impl.cc
@@ -16,6 +16,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/navigation_controller_impl.h"
#include "content/browser/frame_host/navigation_entry_impl.h"
#include "content/browser/frame_host/navigator.h"
@@ -34,7 +35,6 @@
#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"
@@ -864,11 +864,20 @@ void NavigationHandleImpl::RunCompleteCallback(
void NavigationHandleImpl::RegisterNavigationThrottles() {
// Register the navigation throttles. The vector returned by
- // GetNavigationThrottles is not assigned to throttles_ directly because it
- // would overwrite any throttles previously added with
+ // CreateThrottlesForNavigation is not assigned to throttles_ directly because
+ // it would overwrite any throttles previously added with
// RegisterThrottleForTesting.
+ // TODO(carlosk, arthursonzogni): should simplify this to either use
+ // |throttles_| directly (except for the case described above) or
+ // |throttles_to_register| for registering all throttles.
std::vector<std::unique_ptr<NavigationThrottle>> throttles_to_register =
GetDelegate()->CreateThrottlesForNavigation(this);
+
+ std::unique_ptr<NavigationThrottle> mixed_content_throttle =
+ MixedContentNavigationThrottle::CreateThrottleForNavigation(this);
+ if (mixed_content_throttle)
+ throttles_to_register.push_back(std::move(mixed_content_throttle));
+
std::unique_ptr<NavigationThrottle> devtools_throttle =
RenderFrameDevToolsAgentHost::CreateThrottleForNavigation(this);
if (devtools_throttle)

Powered by Google App Engine
This is Rietveld 408576698