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

Unified Diff: components/safe_browsing_db/v4_database.h

Issue 2160193003: PVer4: V4Database: Return stores that have a hash prefix for a given full hash (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@01_check_url_store
Patch Set: Created 4 years, 5 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 df458a24809361098e9c019bec5a62e4958efe9a..d5033b787638650acafcb73f21a62aaca45949b5 100644
--- a/components/safe_browsing_db/v4_database.h
+++ b/components/safe_browsing_db/v4_database.h
@@ -30,6 +30,9 @@ typedef base::Callback<void()> DatabaseUpdatedCallback;
// as manage their storage on disk.
typedef base::hash_map<UpdateListIdentifier, std::unique_ptr<V4Store>> StoreMap;
+// The list of stores that had a hash prefix matching the given full hash.
+typedef std::vector<UpdateListIdentifier> StoresMatched;
Nathan Parker 2016/07/19 23:05:56 A thought: It might be easier to read to not typed
vakh (use Gerrit instead) 2016/07/20 00:07:43 Now that it is a map of store identifiers to the m
+
// Factory for creating V4Database. Tests implement this factory to create fake
// databases for testing.
class V4DatabaseFactory {
@@ -74,6 +77,9 @@ class V4Database {
// Returns the current state of each of the stores being managed.
std::unique_ptr<StoreStateMap> GetStoreStateMap();
+ void GetStoresMatchingFullHash(const FullHash& full_hash,
+ StoresMatched* stores_matched);
+
// Deletes the current database and creates a new one.
virtual bool ResetDatabase();
@@ -90,6 +96,7 @@ class V4Database {
FRIEND_TEST_ALL_PREFIXES(V4DatabaseTest, TestApplyUpdateWithNoNewState);
FRIEND_TEST_ALL_PREFIXES(V4DatabaseTest, TestApplyUpdateWithEmptyUpdate);
FRIEND_TEST_ALL_PREFIXES(V4DatabaseTest, TestApplyUpdateWithInvalidUpdate);
+ FRIEND_TEST_ALL_PREFIXES(V4DatabaseTest, TestSomeStoresMatchFullHash);
// Makes the passed |factory| the factory used to instantiate a V4Store. Only
// for tests.
« no previous file with comments | « no previous file | components/safe_browsing_db/v4_database.cc » ('j') | components/safe_browsing_db/v4_database.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698