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 8e20aee2a800a277d80b317a473aaa6c2b96ec31..427f8dd4cb94fac88e23626cce5c860fb926f5b8 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 |
@@ -5,15 +5,9 @@ |
#ifndef COMPONENTS_SUBRESOURCE_FILTER_CONTENT_BROWSER_CONTENT_SUBRESOURCE_FILTER_DRIVER_FACTORY_H_ |
#define COMPONENTS_SUBRESOURCE_FILTER_CONTENT_BROWSER_CONTENT_SUBRESOURCE_FILTER_DRIVER_FACTORY_H_ |
-#include <map> |
#include <memory> |
-#include <set> |
-#include <string> |
-#include <utility> |
-#include <vector> |
#include "base/macros.h" |
-#include "base/time/time.h" |
#include "components/safe_browsing_db/util.h" |
#include "components/subresource_filter/content/browser/content_subresource_filter_throttle_manager.h" |
#include "components/subresource_filter/core/browser/subresource_filter_features.h" |
@@ -21,7 +15,10 @@ |
#include "content/public/browser/web_contents_observer.h" |
#include "content/public/browser/web_contents_user_data.h" |
#include "ui/base/page_transition_types.h" |
-#include "url/gurl.h" |
+ |
+namespace base { |
+class GURL; |
+} // namespace base |
namespace content { |
class WebContents; |
@@ -37,9 +34,6 @@ class SubresourceFilterClient; |
enum class ActivationLevel; |
enum class ActivationList; |
-using URLToActivationListsMap = |
- std::unordered_map<std::string, std::set<ActivationList>>; |
- |
// Controls the activation of subresource filtering for each page load in a |
// WebContents and is responsible for sending the activation signal to all the |
// per-frame SubresourceFilterAgents on the renderer side. |
@@ -63,12 +57,11 @@ class ContentSubresourceFilterDriverFactory |
SubresourceFilterClient* client); |
~ContentSubresourceFilterDriverFactory() override; |
- // Called when Safe Browsing detects that the |url| corresponding to the load |
- // of the main frame belongs to the blacklist with |threat_type|. If the |
- // blacklist is the Safe Browsing Social Engineering ads landing, then |url| |
- // and |redirects| are saved. |
- void OnMainResourceMatchedSafeBrowsingBlacklist( |
- const GURL& url, |
+ // Called when the Safe Browsing throttle has computed the threat type and |
+ // metadata for this navigation. Will be called once per navigation before |
+ // the ReadyToCommit stage. |
+ void OnSafeBrowsingMatchComputed( |
+ content::NavigationHandle* navigation_handle, |
safe_browsing::SBThreatType threat_type, |
safe_browsing::ThreatPatternType threat_type_metadata); |
@@ -83,8 +76,6 @@ class ContentSubresourceFilterDriverFactory |
// ContentSubresourceFilterThrottleManager::Delegate: |
void OnFirstSubresourceLoadDisallowed() override; |
- void WillProcessResponse( |
- content::NavigationHandle* navigation_handle) override; |
ContentSubresourceFilterThrottleManager* throttle_manager() { |
return throttle_manager_.get(); |
@@ -105,18 +96,15 @@ class ContentSubresourceFilterDriverFactory |
// Checks base on the value of |url| and current activation scope if |
// activation signal should be sent. |
void ComputeActivationForMainFrameNavigation( |
- content::NavigationHandle* navigation_handle); |
+ content::NavigationHandle* navigation_handle, |
+ ActivationList matched_list); |
// Returns whether a main-frame navigation to the given |url| satisfies the |
// activation |conditions| of a given configuration, except for |priority|. |
bool DoesMainFrameURLSatisfyActivationConditions( |
const GURL& url, |
- const Configuration::ActivationConditions& conditions) const; |
- |
- bool DidURLMatchActivationList(const GURL& url, |
- ActivationList activation_list) const; |
- |
- void AddActivationListMatch(const GURL& url, ActivationList match_type); |
+ const Configuration::ActivationConditions& conditions, |
+ ActivationList matched_list) const; |
// Must outlive this class. |
SubresourceFilterClient* client_; |
@@ -143,8 +131,6 @@ class ContentSubresourceFilterDriverFactory |
// throttles are not invoked). |
Configuration::ActivationOptions activation_options_; |
- URLToActivationListsMap activation_list_matches_; |
- |
DISALLOW_COPY_AND_ASSIGN(ContentSubresourceFilterDriverFactory); |
}; |