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

Unified Diff: components/subresource_filter/content/browser/subresource_filter_navigation_throttle.h

Issue 2060313002: Navigation throttle for the Safe Browsing Subresource Filter. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@pre-tab-activation
Patch Set: Comment to SubresourceFilterNavigationThrotle explaining its purpose. Created 4 years, 6 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: components/subresource_filter/content/browser/subresource_filter_navigation_throttle.h
diff --git a/components/subresource_filter/content/browser/subresource_filter_navigation_throttle.h b/components/subresource_filter/content/browser/subresource_filter_navigation_throttle.h
new file mode 100644
index 0000000000000000000000000000000000000000..84b541217d00b3c47b73f602a603fd0f86eaae09
--- /dev/null
+++ b/components/subresource_filter/content/browser/subresource_filter_navigation_throttle.h
@@ -0,0 +1,49 @@
+// 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 COMPONENTS_SUBRESOURCE_FILTER_CONTENT_BROWSER_SUBRESOURCE_FILTER_NAVIGATION_THROTTLE_
+#define COMPONENTS_SUBRESOURCE_FILTER_CONTENT_BROWSER_SUBRESOURCE_FILTER_NAVIGATION_THROTTLE_
+
+#include <memory>
+
+#include "base/macros.h"
+#include "content/public/browser/navigation_throttle.h"
+#include "url/gurl.h"
+
+namespace content {
+class NavigationHandle;
+}
+
+namespace subresource_filter {
+
+/* The class which is responsible for tracking the redirects, which are
engedy 2016/06/23 22:34:18 nit: //
melandory 2016/06/25 01:46:08 Done.
+ * happening after Safe Browsing detects that the page which is being load
+ * contains deceptive embedded content and appends such redirects to the per-tab
+ * list. After navigation is finished, SubresourceFilterNavigationThrottle
+ * passes information if deceptive embedded content should be filtered. This
+ * throttle is active only for main frame http or https navigations and doesn't
+ * act on subresources, but activates the subresource filter when necessary.
+ */
+class SubresourceFilterNavigationThrottle : public content::NavigationThrottle {
+ public:
+ static std::unique_ptr<content::NavigationThrottle> Create(
+ content::NavigationHandle* handle);
+ ~SubresourceFilterNavigationThrottle() override;
+
+ // content::NavigationThrottle implementation:
+ ThrottleCheckResult WillRedirectRequest() override;
+ ThrottleCheckResult WillProcessResponse() override;
+
+ private:
+ explicit SubresourceFilterNavigationThrottle(
+ content::NavigationHandle* navigation_handle);
+
+ GURL initial_url_;
+
+ DISALLOW_COPY_AND_ASSIGN(SubresourceFilterNavigationThrottle);
+};
+
+} // namespace subresource_filter
+
+#endif // COMPONENTS_SUBRESOURCE_FILTER_CONTENT_BROWSER_SUBRESOURCE_FILTER_NAVIGATION_THROTTLE_

Powered by Google App Engine
This is Rietveld 408576698