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

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

Issue 2859783002: [subresource_filter] Make website setting existence imply site activation (Closed)
Patch Set: rebase 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
« no previous file with comments | « components/subresource_filter/content/browser/fake_safe_browsing_database_manager.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 cfd968e8f7eb8c0182389c12ba3eed06fb41e423..56cd2ba022451236b5cb8bd96865aa4567e3985e 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
@@ -19,6 +19,10 @@ void FakeSafeBrowsingDatabaseManager::AddBlacklistedUrl(
url_to_threat_type_[url] = threat_type;
}
+void FakeSafeBrowsingDatabaseManager::RemoveBlacklistedUrl(const GURL& url) {
+ url_to_threat_type_.erase(url);
+}
+
void FakeSafeBrowsingDatabaseManager::SimulateTimeout() {
simulate_timeout_ = true;
}
@@ -53,6 +57,10 @@ void FakeSafeBrowsingDatabaseManager::OnCheckUrlForSubresourceFilterComplete(
return;
client->OnCheckBrowseUrlResult(url, url_to_threat_type_[url],
safe_browsing::ThreatMetadata());
+ // 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.
+ checks_.erase(client);
}
bool FakeSafeBrowsingDatabaseManager::CheckResourceUrl(const GURL& url,
« no previous file with comments | « components/subresource_filter/content/browser/fake_safe_browsing_database_manager.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698