Index: components/safe_browsing/base_resource_throttle.cc |
diff --git a/components/safe_browsing/base_resource_throttle.cc b/components/safe_browsing/base_resource_throttle.cc |
index ff2cf8e34f3f984d3ffc4f509417971eda099b15..87a8812e2bf04cc7dc711e6263edb30d40f1a8d0 100644 |
--- a/components/safe_browsing/base_resource_throttle.cc |
+++ b/components/safe_browsing/base_resource_throttle.cc |
@@ -10,7 +10,6 @@ |
#include "components/safe_browsing/base_ui_manager.h" |
#include "components/safe_browsing_db/util.h" |
#include "components/security_interstitials/content/unsafe_resource.h" |
-#include "components/subresource_filter/content/browser/content_subresource_filter_driver_factory.h" |
#include "content/public/browser/browser_thread.h" |
#include "content/public/browser/resource_request_info.h" |
#include "content/public/browser/web_contents.h" |
@@ -302,43 +301,12 @@ void BaseResourceThrottle::StartDisplayingBlockingPageHelper( |
} |
// Static |
-void BaseResourceThrottle::NotifySubresourceFilterOfBlockedResource( |
- const security_interstitials::UnsafeResource& resource) { |
- content::WebContents* web_contents = resource.web_contents_getter.Run(); |
- DCHECK(web_contents); |
- // Once activated, the subresource filter will filter subresources, but is |
- // triggered when the main frame document matches Safe Browsing blacklists. |
- if (!resource.is_subresource) { |
- using subresource_filter::ContentSubresourceFilterDriverFactory; |
- ContentSubresourceFilterDriverFactory* driver_factory = |
- ContentSubresourceFilterDriverFactory::FromWebContents(web_contents); |
- |
- // Content embedders (such as Android Webview) do not have a driver_factory. |
- if (driver_factory) { |
- // For a redirect chain of A -> B -> C, the subresource filter expects C |
- // as the resource URL and [A, B] as redirect URLs. |
- std::vector<GURL> redirect_parent_urls; |
- if (!resource.redirect_urls.empty()) { |
- redirect_parent_urls.push_back(resource.original_url); |
- redirect_parent_urls.insert(redirect_parent_urls.end(), |
- resource.redirect_urls.begin(), |
- std::prev(resource.redirect_urls.end())); |
- } |
- driver_factory->OnMainResourceMatchedSafeBrowsingBlacklist( |
- resource.url, redirect_parent_urls, resource.threat_type, |
- resource.threat_metadata.threat_pattern_type); |
- } |
- } |
-} |
- |
-// Static |
void BaseResourceThrottle::StartDisplayingBlockingPage( |
const base::WeakPtr<BaseResourceThrottle>& throttle, |
scoped_refptr<BaseUIManager> ui_manager, |
const security_interstitials::UnsafeResource& resource) { |
content::WebContents* web_contents = resource.web_contents_getter.Run(); |
if (web_contents) { |
- NotifySubresourceFilterOfBlockedResource(resource); |
ui_manager->DisplayBlockingPage(resource); |
return; |
} |