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

Unified Diff: components/safe_browsing_db/v4_database.h

Issue 2233103002: Move full hash caching logic to v4_get_hash_protocol_manager (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Move another test from database_manager to get_hash_manager 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/v4_database.h
diff --git a/components/safe_browsing_db/v4_database.h b/components/safe_browsing_db/v4_database.h
index ddf36dc4da873097271dcf469824aa837435772f..1365705d5661d6bd58937b0d1d0ee109c435b6b8 100644
--- a/components/safe_browsing_db/v4_database.h
+++ b/components/safe_browsing_db/v4_database.h
@@ -25,15 +25,20 @@ typedef base::Callback<void(std::unique_ptr<V4Database>)>
// requests.
typedef base::Callback<void()> DatabaseUpdatedCallback;
+// The set of interesting lists and ASCII filenames for their hash prefix
+// stores. The stores are created inside the user-data directory.
+// For instance, the UpdateListIdentifier could be for URL expressions for UwS
+// on Windows platform, and the corresponding file on disk could be named:
+// "uws_win_url.store"
+// TODO(vakh): Find the canonical place where these are defined and update the
+// comment to point to that place.
+typedef base::hash_map<UpdateListIdentifier, std::string> StoreFileNameMap;
+
// This hash_map maps the UpdateListIdentifiers to their corresponding in-memory
// stores, which contain the hash prefixes for that UpdateListIdentifier as well
// as manage their storage on disk.
typedef base::hash_map<UpdateListIdentifier, std::unique_ptr<V4Store>> StoreMap;
-// Map of identifier for any store that had a hash prefix matching the given
-// full hash to the matching hash prefix.
-typedef base::hash_map<UpdateListIdentifier, HashPrefix> MatchedHashPrefixMap;
-
// Factory for creating V4Database. Tests implement this factory to create fake
// databases for testing.
class V4DatabaseFactory {
@@ -84,7 +89,7 @@ class V4Database {
virtual void GetStoresMatchingFullHash(
const FullHash& full_hash,
const base::hash_set<UpdateListIdentifier>& stores_to_look,
- MatchedHashPrefixMap* matched_hash_prefix_map);
+ StoreAndHashPrefixes* matched_store_and_full_hashes);
// Deletes the current database and creates a new one.
virtual bool ResetDatabase();

Powered by Google App Engine
This is Rietveld 408576698