| 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 427f8dd4cb94fac88e23626cce5c860fb926f5b8..8e20aee2a800a277d80b317a473aaa6c2b96ec31 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,9 +5,15 @@
|
| #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"
|
| @@ -15,10 +21,7 @@
|
| #include "content/public/browser/web_contents_observer.h"
|
| #include "content/public/browser/web_contents_user_data.h"
|
| #include "ui/base/page_transition_types.h"
|
| -
|
| -namespace base {
|
| -class GURL;
|
| -} // namespace base
|
| +#include "url/gurl.h"
|
|
|
| namespace content {
|
| class WebContents;
|
| @@ -33,6 +36,9 @@
|
| 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
|
| @@ -57,11 +63,12 @@
|
| SubresourceFilterClient* client);
|
| ~ContentSubresourceFilterDriverFactory() override;
|
|
|
| - // 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,
|
| + // 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,
|
| safe_browsing::SBThreatType threat_type,
|
| safe_browsing::ThreatPatternType threat_type_metadata);
|
|
|
| @@ -76,6 +83,8 @@
|
|
|
| // ContentSubresourceFilterThrottleManager::Delegate:
|
| void OnFirstSubresourceLoadDisallowed() override;
|
| + void WillProcessResponse(
|
| + content::NavigationHandle* navigation_handle) override;
|
|
|
| ContentSubresourceFilterThrottleManager* throttle_manager() {
|
| return throttle_manager_.get();
|
| @@ -96,15 +105,18 @@
|
| // Checks base on the value of |url| and current activation scope if
|
| // activation signal should be sent.
|
| void ComputeActivationForMainFrameNavigation(
|
| - content::NavigationHandle* navigation_handle,
|
| - ActivationList matched_list);
|
| + content::NavigationHandle* navigation_handle);
|
|
|
| // 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,
|
| - ActivationList matched_list) const;
|
| + const Configuration::ActivationConditions& conditions) const;
|
| +
|
| + bool DidURLMatchActivationList(const GURL& url,
|
| + ActivationList activation_list) const;
|
| +
|
| + void AddActivationListMatch(const GURL& url, ActivationList match_type);
|
|
|
| // Must outlive this class.
|
| SubresourceFilterClient* client_;
|
| @@ -131,6 +143,8 @@
|
| // throttles are not invoked).
|
| Configuration::ActivationOptions activation_options_;
|
|
|
| + URLToActivationListsMap activation_list_matches_;
|
| +
|
| DISALLOW_COPY_AND_ASSIGN(ContentSubresourceFilterDriverFactory);
|
| };
|
|
|
|
|