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

Unified Diff: components/subresource_filter/content/browser/content_subresource_filter_driver_factory.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: adressing engedy@ comments Created 4 years, 5 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/content_subresource_filter_driver_factory.h
diff --git a/components/subresource_filter/content/browser/content_subresource_filter_driver_factory.h b/components/subresource_filter/content/browser/content_subresource_filter_driver_factory.h
index 29a7e73d22e7fb92f6ef44911b5ccbdde2575381..17398a18cc726e967a6539b90a84775dba069a6b 100644
--- a/components/subresource_filter/content/browser/content_subresource_filter_driver_factory.h
+++ b/components/subresource_filter/content/browser/content_subresource_filter_driver_factory.h
@@ -33,6 +33,9 @@ class ContentSubresourceFilterDriver;
// Controls the activation of subresource filtering for each page load in a
// WebContents and manufactures the per-frame ContentSubresourceFilterDrivers.
+// TODO(melandory): Once https://crbug.com/621856 is fixed this class should
+// take care of passing the activation information not only to the main frame,
+// but also to the subframes.
class ContentSubresourceFilterDriverFactory
: public base::SupportsUserData::Data,
public content::WebContentsObserver {
@@ -49,19 +52,26 @@ class ContentSubresourceFilterDriverFactory
const GURL& url,
const std::vector<GURL>& redirect_urls,
safe_browsing::ThreatPatternType threat_type);
- const OriginSet& activation_set() { return activate_on_origins_; }
- bool ShouldActivateForURL(const GURL& url);
+ const OriginSet& activation_set() const { return activate_on_origins_; }
+ bool ShouldActivateForURL(const GURL& url) const;
+ void AddOriginOfURLToActivationSet(const GURL& url);
+
+ ContentSubresourceFilterDriver* DriverFromFrameHost(
+ content::RenderFrameHost* render_frame_host);
private:
+ friend class SubresourceFilterNavigationThrottleTest;
+
typedef std::map<content::RenderFrameHost*,
std::unique_ptr<ContentSubresourceFilterDriver>>
FrameHostToOwnedDriverMap;
+ void SetDriverForFrameHostForTesting(
+ content::RenderFrameHost* render_frame_host,
+ std::unique_ptr<ContentSubresourceFilterDriver> driver);
+
void CreateDriverForFrameHostIfNeeded(
content::RenderFrameHost* render_frame_host);
- ContentSubresourceFilterDriver* DriverFromFrameHost(
- content::RenderFrameHost* render_frame_host);
-
// content::WebContentsObserver:
void RenderFrameCreated(content::RenderFrameHost* render_frame_host) override;
void RenderFrameDeleted(content::RenderFrameHost* render_frame_host) override;

Powered by Google App Engine
This is Rietveld 408576698