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

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, 7 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 56cd2ba022451236b5cb8bd96865aa4567e3985e..6d3a8e4e39e98da73127ebc9aab2988b9f3a304f 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,8 +15,9 @@ FakeSafeBrowsingDatabaseManager::FakeSafeBrowsingDatabaseManager()
void FakeSafeBrowsingDatabaseManager::AddBlacklistedUrl(
const GURL& url,
- safe_browsing::SBThreatType threat_type) {
- url_to_threat_type_[url] = threat_type;
+ safe_browsing::SBThreatType threat_type,
+ safe_browsing::ThreatPatternType pattern_type) {
+ url_to_threat_type_[url] = std::make_pair(threat_type, pattern_type);
}
void FakeSafeBrowsingDatabaseManager::RemoveBlacklistedUrl(const GURL& url) {
@@ -55,8 +56,10 @@ void FakeSafeBrowsingDatabaseManager::OnCheckUrlForSubresourceFilterComplete(
// Check to see if the request was cancelled to avoid use-after-free.
if (checks_.find(client) == checks_.end())
return;
- client->OnCheckBrowseUrlResult(url, url_to_threat_type_[url],
- safe_browsing::ThreatMetadata());
+ safe_browsing::ThreatMetadata metadata;
+ metadata.threat_pattern_type = url_to_threat_type_[url].second;
+
+ client->OnCheckBrowseUrlResult(url, url_to_threat_type_[url].first, metadata);
// Erase the client when a check is complete. Otherwise, it's possible
// subsequent clients that share an address with this one will DCHECK in
// CheckUrlForSubresourceFilter.

Powered by Google App Engine
This is Rietveld 408576698