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

Unified Diff: components/safe_browsing_db/v4_local_database_manager.cc

Issue 2101153004: Minor: Have a method return store_file_name_map instead of a global (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/safe_browsing_db/v4_local_database_manager.cc
diff --git a/components/safe_browsing_db/v4_local_database_manager.cc b/components/safe_browsing_db/v4_local_database_manager.cc
index f1f484ce8e74b30ddc3ca2afe4d529756fe7ef05..904117c58e2454166011f8fb55ae36f9ac291acf 100644
--- a/components/safe_browsing_db/v4_local_database_manager.cc
+++ b/components/safe_browsing_db/v4_local_database_manager.cc
@@ -35,11 +35,13 @@ namespace {
// TODO(vakh): Implement this to populate the map appopriately.
Scott Hess - ex-Googler 2016/06/29 03:25:50 "appropriately", while you're here...
// Filed as http://crbug.com/608075
-StoreFileNameMap store_file_name_map{
- {UpdateListIdentifier(PLATFORM_TYPE, URL, MALWARE_THREAT),
- "UrlMalware.store"},
- {UpdateListIdentifier(PLATFORM_TYPE, URL, SOCIAL_ENGINEERING_PUBLIC),
- "UrlSoceng.store"}};
+StoreFileNameMap GetStoreFileNameMap() {
+ return StoreFileNameMap(
+ {{UpdateListIdentifier(PLATFORM_TYPE, URL, MALWARE_THREAT),
+ "UrlMalware.store"},
+ {UpdateListIdentifier(PLATFORM_TYPE, URL, SOCIAL_ENGINEERING_PUBLIC),
+ "UrlSoceng.store"}});
+}
} // namespace
@@ -206,6 +208,7 @@ void V4LocalDatabaseManager::SetupDatabase() {
// Do not create the database on the IO thread since this may be an expensive
// operation. Instead, do that on the task_runner and when the new database
// has been created, swap it out on the IO thread.
+ StoreFileNameMap store_file_name_map = GetStoreFileNameMap();
DCHECK(!store_file_name_map.empty());
NewDatabaseReadyCallback db_ready_callback = base::Bind(
&V4LocalDatabaseManager::DatabaseReady, base::Unretained(this));
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698