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

Unified Diff: chrome/browser/loader/safe_browsing_resource_throttle.cc

Issue 2692273006: Refactor safebrowsing StartDisplayingBlockingPage (Closed)
Patch Set: Fix method description Created 3 years, 10 months 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/safe_browsing/base_resource_throttle.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/loader/safe_browsing_resource_throttle.cc
diff --git a/chrome/browser/loader/safe_browsing_resource_throttle.cc b/chrome/browser/loader/safe_browsing_resource_throttle.cc
index 161065986021b9c92a524e03f3cdfa5af67bdeb9..5cba24e9cd95369fade253b64931007abd565711 100644
--- a/chrome/browser/loader/safe_browsing_resource_throttle.cc
+++ b/chrome/browser/loader/safe_browsing_resource_throttle.cc
@@ -92,29 +92,7 @@ void SafeBrowsingResourceThrottle::StartDisplayingBlockingPage(
const security_interstitials::UnsafeResource& resource) {
content::WebContents* web_contents = resource.web_contents_getter.Run();
if (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);
- DCHECK(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);
- }
-
+ BaseResourceThrottle::NotifySubresourceFilterOfBlockedResource(resource);
prerender::PrerenderContents* prerender_contents =
prerender::PrerenderContents::FromWebContents(web_contents);
if (prerender_contents) {
« no previous file with comments | « no previous file | components/safe_browsing/base_resource_throttle.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698