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

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: comments 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..ef7db10274d4e360d0ad696323a9f98865a64143
--- /dev/null
+++ b/components/subresource_filter/content/browser/subresource_filter_navigation_throttle.h
@@ -0,0 +1,48 @@
+// 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
nasko 2016/06/28 22:12:36 "This class is responsible ...". Also, is it only
melandory 2016/07/01 07:10:49 Done.
+// happening after Safe Browsing detects that the page which is being load
nasko 2016/06/28 22:12:36 nit: "being loaded"
melandory 2016/07/01 07:10:49 Done.
+// 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