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

Unified Diff: components/safe_browsing_db/database_manager.cc

Issue 2345573002: Each DatabaseManager gets to decide which stores to track (Closed)
Patch Set: Each DBmanager defines stores to look. base::hash_set -> std::unorderd_set. StoreToFileNameMap -> S… Created 4 years, 3 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/safe_browsing_db/database_manager.cc
diff --git a/components/safe_browsing_db/database_manager.cc b/components/safe_browsing_db/database_manager.cc
index 725a4b45ed52ad1692454f0333f2e174aad1876a..533025e576750259a608767f8d0794026c624835 100644
--- a/components/safe_browsing_db/database_manager.cc
+++ b/components/safe_browsing_db/database_manager.cc
@@ -6,6 +6,7 @@
#include "base/metrics/histogram_macros.h"
#include "components/safe_browsing_db/v4_get_hash_protocol_manager.h"
+#include "components/safe_browsing_db/v4_protocol_manager_util.h"
#include "content/public/browser/browser_thread.h"
#include "net/url_request/url_request_context_getter.h"
#include "url/gurl.h"
@@ -25,9 +26,8 @@ void SafeBrowsingDatabaseManager::StartOnIOThread(
const V4ProtocolConfig& config) {
DCHECK_CURRENTLY_ON(BrowserThread::IO);
- base::hash_set<UpdateListIdentifier> stores_to_look({GetChromeUrlApiId()});
v4_get_hash_protocol_manager_ = V4GetHashProtocolManager::Create(
- request_context_getter, stores_to_look, config);
+ request_context_getter, GetStoresForFullHashRequests(), config);
}
// |shutdown| not used. Destroys the v4 protocol managers. This may be called
@@ -71,6 +71,11 @@ bool SafeBrowsingDatabaseManager::CancelApiCheck(Client* client) {
return false;
}
+std::unordered_set<UpdateListIdentifier>
+SafeBrowsingDatabaseManager::GetStoresForFullHashRequests() {
+ return std::unordered_set<UpdateListIdentifier>({GetChromeUrlApiId()});
+}
+
bool SafeBrowsingDatabaseManager::CheckApiBlacklistUrl(const GURL& url,
Client* client) {
DCHECK_CURRENTLY_ON(BrowserThread::IO);

Powered by Google App Engine
This is Rietveld 408576698