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

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

Issue 2580903002: Clean up ContentSubresourceFilterDriverFactory. (Closed)
Patch Set: Created 4 years 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
« no previous file with comments | « no previous file | components/subresource_filter/content/browser/content_subresource_filter_driver_factory.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 ddf2207d0e4107a29294ba58a1b6ada243b4f2d7..ad4863bebc547f3f314e37b9202e7eb86693d937 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
@@ -39,9 +39,6 @@ using URLToActivationListsMap =
// 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 {
@@ -57,11 +54,6 @@ class ContentSubresourceFilterDriverFactory
std::unique_ptr<SubresourceFilterClient> client);
~ContentSubresourceFilterDriverFactory() override;
- ContentSubresourceFilterDriver* DriverFromFrameHost(
- content::RenderFrameHost* render_frame_host);
-
- bool IsWhitelisted(const GURL& url) const;
-
// Whitelists the host of |url|, so that page loads with the main-frame
// document being loaded from this host will be exempted from subresource
// filtering for the lifetime of this WebContents.
@@ -77,21 +69,11 @@ class ContentSubresourceFilterDriverFactory
safe_browsing::SBThreatType threat_type,
safe_browsing::ThreatPatternType threat_type_metadata);
- // Reloads the page and inserts the url to the whitelist.
+ // Reloads the page and inserts the host of its URL to the whitelist.
void OnReloadRequested();
- const HostPathSet& whitelisted_set() const { return whitelisted_hosts_; }
-
- ActivationState activation_state() { return activation_state_; }
-
- const URLToActivationListsMap& safe_browsing_blacklisted_patterns_set()
- const {
- return activation_list_matches_;
- }
-
private:
friend class ContentSubresourceFilterDriverFactoryTest;
- friend class SubresourceFilterNavigationThrottleTest;
friend class safe_browsing::SafeBrowsingServiceTest;
typedef std::map<content::RenderFrameHost*,
@@ -104,9 +86,13 @@ class ContentSubresourceFilterDriverFactory
void CreateDriverForFrameHostIfNeeded(
content::RenderFrameHost* render_frame_host);
+ ContentSubresourceFilterDriver* DriverFromFrameHost(
+ content::RenderFrameHost* render_frame_host);
void OnFirstSubresourceLoadDisallowed();
+ bool IsWhitelisted(const GURL& url) const;
+
// content::WebContentsObserver:
void DidStartNavigation(
content::NavigationHandle* navigation_handle) override;
@@ -136,8 +122,6 @@ class ContentSubresourceFilterDriverFactory
void AddActivationListMatch(const GURL& url, ActivationList match_type);
void RecordRedirectChainMatchPattern() const;
- static const char kWebContentsUserDataKey[];
-
FrameHostToOwnedDriverMap frame_drivers_;
std::unique_ptr<SubresourceFilterClient> client_;
« no previous file with comments | « no previous file | components/subresource_filter/content/browser/content_subresource_filter_driver_factory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698