Index: content/browser/frame_host/mixed_content_navigation_throttle.h |
diff --git a/content/browser/frame_host/mixed_content_navigation_throttle.h b/content/browser/frame_host/mixed_content_navigation_throttle.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..b0a6a93bf7187b2be4c9a89bd960ab1c9bf3894a |
--- /dev/null |
+++ b/content/browser/frame_host/mixed_content_navigation_throttle.h |
@@ -0,0 +1,54 @@ |
+// Copyright 2016 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#ifndef CONTENT_BROWSER_FRAME_HOST_MIXED_CONTENT_NAVIGATION_THROTTLE_H_ |
+#define CONTENT_BROWSER_FRAME_HOST_MIXED_CONTENT_NAVIGATION_THROTTLE_H_ |
+ |
+#include "base/gtest_prod_util.h" |
+#include "base/macros.h" |
+#include "content/common/content_export.h" |
+#include "content/public/browser/navigation_handle.h" |
+#include "content/public/browser/navigation_throttle.h" |
+ |
+namespace content { |
+ |
+class FrameTreeNode; |
+ |
+using ThrottleCheckResult = NavigationThrottle::ThrottleCheckResult; |
+ |
+// Responsible for browser process side mixed-content security. It checks only |
+// for frame-level resource loads (aka navigation loads); fetching of |
+// sub-resources are checked in the renderer process by MixedContentChecker. |
+// Changes to this class might need to be reflected on its renderer counterpart. |
+// |
+// Current mixed content draft that drives this implementation: |
+// https://w3c.github.io/webappsec-mixed-content/ |
+class MixedContentNavigationThrottle : public NavigationThrottle { |
+ public: |
+ MixedContentNavigationThrottle(NavigationHandle* navigation_handle); |
+ ~MixedContentNavigationThrottle() override; |
+ |
+ ThrottleCheckResult WillStartRequest() override; |
+ |
+ ThrottleCheckResult WillRedirectRequest() override; |
+ |
+ ThrottleCheckResult WillProcessResponse() override; |
+ |
+ private: |
+ FRIEND_TEST_ALL_PREFIXES(MixedContentNavigationThrottleTest, IsMixedContent); |
+ |
+ // Returns the parent frame where mixed content exists for the provided data |
+ // or null if there is no mixed content. |
+ FrameTreeNode* InWhichFrameIsContentMixed(FrameTreeNode* node, |
+ const GURL& url); |
+ |
+ static bool CONTENT_EXPORT IsMixedContentForTesting(const GURL& origin_url, |
+ const GURL& url); |
+ |
+ DISALLOW_COPY_AND_ASSIGN(MixedContentNavigationThrottle); |
+}; |
+ |
+} // namespace content |
+ |
+#endif // CONTENT_BROWSER_FRAME_HOST_MIXED_CONTENT_NAVIGATION_THROTTLE_H_ |