| Index: components/subresource_filter/content/browser/content_subresource_filter_driver_factory.cc
|
| diff --git a/components/subresource_filter/content/browser/content_subresource_filter_driver_factory.cc b/components/subresource_filter/content/browser/content_subresource_filter_driver_factory.cc
|
| index 3f2947d3de54ff8681b5daa2e7df7374ad504b4d..1889213bb947842d69d3b004fc557a92ef8d4794 100644
|
| --- a/components/subresource_filter/content/browser/content_subresource_filter_driver_factory.cc
|
| +++ b/components/subresource_filter/content/browser/content_subresource_filter_driver_factory.cc
|
| @@ -74,15 +74,10 @@ bool ContentSubresourceFilterDriverFactory::IsWhitelisted(
|
| return whitelisted_set().find(url.host()) != whitelisted_set().end();
|
| }
|
|
|
| -bool ContentSubresourceFilterDriverFactory::IsBlacklisted(
|
| - const GURL& url) const {
|
| - return activation_set().find(url.host()) != activation_set().end();
|
| +bool ContentSubresourceFilterDriverFactory::IsHit(const GURL& url) const {
|
| + return hits_set().find(url.host() + url.path()) != hits_set().end();
|
| }
|
|
|
| -bool ContentSubresourceFilterDriverFactory::ShouldActivateForURL(
|
| - const GURL& url) const {
|
| - return IsBlacklisted(url) && !IsWhitelisted(url);
|
| -}
|
|
|
| void ContentSubresourceFilterDriverFactory::
|
| OnMainResourceMatchedSafeBrowsingBlacklist(
|
| @@ -101,9 +96,7 @@ void ContentSubresourceFilterDriverFactory::
|
| }
|
| if (!proceed)
|
| return;
|
| - AddHostOfURLToActivationSet(url);
|
| - for (const auto& url : redirect_urls)
|
| - AddHostOfURLToActivationSet(url);
|
| + AddToActivationHitsSet(url);
|
| }
|
|
|
| void ContentSubresourceFilterDriverFactory::AddHostOfURLToWhitelistSet(
|
| @@ -112,10 +105,10 @@ void ContentSubresourceFilterDriverFactory::AddHostOfURLToWhitelistSet(
|
| whitelisted_hosts_.insert(url.host());
|
| }
|
|
|
| -void ContentSubresourceFilterDriverFactory::AddHostOfURLToActivationSet(
|
| +void ContentSubresourceFilterDriverFactory::AddToActivationHitsSet(
|
| const GURL& url) {
|
| if (!url.host().empty() && url.SchemeIsHTTPOrHTTPS())
|
| - activate_on_hosts_.insert(url.host());
|
| + hits_hosts_.insert(url.host() + url.path());
|
| }
|
|
|
| void ContentSubresourceFilterDriverFactory::ReadyToCommitMainFrameNavigation(
|
| @@ -125,6 +118,8 @@ void ContentSubresourceFilterDriverFactory::ReadyToCommitMainFrameNavigation(
|
| set_activation_state(GetMaximumActivationState());
|
| ActivateForFrameHostIfNeeded(render_frame_host, url);
|
| }
|
| +
|
| + hits_hosts_.clear();
|
| }
|
|
|
| bool ContentSubresourceFilterDriverFactory::ShouldActivateForMainFrameURL(
|
| @@ -132,7 +127,7 @@ bool ContentSubresourceFilterDriverFactory::ShouldActivateForMainFrameURL(
|
| if (GetCurrentActivationScope() == ActivationScope::ALL_SITES)
|
| return !IsWhitelisted(url);
|
| else if (GetCurrentActivationScope() == ActivationScope::ACTIVATION_LIST)
|
| - return ShouldActivateForURL(url);
|
| + return IsHit(url) && !IsWhitelisted(url);
|
| return false;
|
| }
|
|
|
|
|