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

Unified Diff: components/subresource_filter/content/browser/fake_safe_browsing_database_manager.cc

Issue 2814733002: Add the SocEng as a type for checking in CheckUrlForSubresourceFilter. (Closed)
Patch Set: . Created 3 years, 8 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
Index: components/subresource_filter/content/browser/fake_safe_browsing_database_manager.cc
diff --git a/components/subresource_filter/content/browser/fake_safe_browsing_database_manager.cc b/components/subresource_filter/content/browser/fake_safe_browsing_database_manager.cc
index f6526bd7b29b575c4fccaf829eb043d2db9a2613..e768474dfe1ff202a05aa72ec6cf65420b474f60 100644
--- a/components/subresource_filter/content/browser/fake_safe_browsing_database_manager.cc
+++ b/components/subresource_filter/content/browser/fake_safe_browsing_database_manager.cc
@@ -15,7 +15,14 @@ FakeSafeBrowsingDatabaseManager::FakeSafeBrowsingDatabaseManager()
void FakeSafeBrowsingDatabaseManager::AddBlacklistedUrl(
const GURL& url,
safe_browsing::SBThreatType threat_type) {
- url_to_threat_type_[url] = threat_type;
+ AddBlacklistedUrl(url, threat_type, safe_browsing::ThreatPatternType::NONE);
+}
+
+void FakeSafeBrowsingDatabaseManager::AddBlacklistedUrl(
+ const GURL& url,
+ safe_browsing::SBThreatType threat_type,
+ safe_browsing::ThreatPatternType pattern_type) {
engedy 2017/04/26 13:47:10 nit: Could we just make NONE the default value for
melandory 2017/04/26 15:02:21 Done.
+ url_to_threat_type_[url] = std::make_pair(threat_type, pattern_type);
}
void FakeSafeBrowsingDatabaseManager::SimulateTimeout() {
@@ -31,11 +38,12 @@ bool FakeSafeBrowsingDatabaseManager::CheckUrlForSubresourceFilter(
return false;
if (!url_to_threat_type_.count(url))
return true;
-
+ safe_browsing::ThreatMetadata metadata;
+ metadata.threat_pattern_type = url_to_threat_type_[url].second;
content::BrowserThread::PostTask(
content::BrowserThread::IO, FROM_HERE,
base::Bind(&Client::OnCheckBrowseUrlResult, base::Unretained(client), url,
- url_to_threat_type_[url], safe_browsing::ThreatMetadata()));
+ url_to_threat_type_[url].first, metadata));
return false;
}

Powered by Google App Engine
This is Rietveld 408576698