Index: components/subresource_filter/content/browser/subresource_filter_safe_browsing_activation_throttle.cc |
diff --git a/components/subresource_filter/content/browser/subresource_filter_safe_browsing_activation_throttle.cc b/components/subresource_filter/content/browser/subresource_filter_safe_browsing_activation_throttle.cc |
index 058a7c3359b1c64faf2a6fc3a81eeeaa401d677c..27c14506f56212c2ecb68add9a27b1a498cd77c5 100644 |
--- a/components/subresource_filter/content/browser/subresource_filter_safe_browsing_activation_throttle.cc |
+++ b/components/subresource_filter/content/browser/subresource_filter_safe_browsing_activation_throttle.cc |
@@ -82,8 +82,11 @@ |
content::NavigationThrottle::ThrottleCheckResult |
SubresourceFilterSafeBrowsingActivationThrottle::WillProcessResponse() { |
+ if (!database_client_) |
+ return content::NavigationThrottle::PROCEED; |
+ |
// No need to defer the navigation if the check already happened. |
- if (!database_client_ || check_results_.back().finished) { |
+ if (check_results_.back().finished) { |
NotifyResult(); |
return content::NavigationThrottle::ThrottleCheckResult::PROCEED; |
} |
@@ -129,22 +132,14 @@ |
using subresource_filter::ContentSubresourceFilterDriverFactory; |
+ const SubresourceFilterSafeBrowsingClient::CheckResult& result = |
+ check_results_.back(); |
ContentSubresourceFilterDriverFactory* driver_factory = |
ContentSubresourceFilterDriverFactory::FromWebContents(web_contents); |
DCHECK(driver_factory); |
- const SubresourceFilterSafeBrowsingClient::CheckResult& result = |
- check_results_.back(); |
- auto threat_type = safe_browsing::SBThreatType::SB_THREAT_TYPE_SAFE; |
- auto pattern_type = safe_browsing::ThreatPatternType::NONE; |
- if (database_client_) { |
- DCHECK(!check_results_.empty()); |
- DCHECK(check_results_.back().finished); |
- threat_type = result.threat_type; |
- pattern_type = result.pattern_type; |
- } |
- driver_factory->OnSafeBrowsingMatchComputed(navigation_handle(), threat_type, |
- pattern_type); |
+ driver_factory->OnMainResourceMatchedSafeBrowsingBlacklist( |
+ navigation_handle()->GetURL(), result.threat_type, result.pattern_type); |
base::TimeDelta delay = defer_time_.is_null() |
? base::TimeDelta::FromMilliseconds(0) |