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

Unified Diff: components/safe_browsing_db/v4_database.cc

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: Remove more tests from db_manager. Simplify another test. 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.cc
diff --git a/components/safe_browsing_db/v4_database.cc b/components/safe_browsing_db/v4_database.cc
index 59bea71a173cbbe51756d6d8333a402e2c1ef61e..f813df8395c333f83eedce818ccb92e96735c6b6 100644
--- a/components/safe_browsing_db/v4_database.cc
+++ b/components/safe_browsing_db/v4_database.cc
@@ -171,14 +171,17 @@ std::unique_ptr<StoreStateMap> V4Database::GetStoreStateMap() {
void V4Database::GetStoresMatchingFullHash(
const FullHash& full_hash,
const base::hash_set<UpdateListIdentifier>& stores_to_look,
- MatchedHashPrefixMap* matched_hash_prefix_map) {
+ StoreAndHashPrefixes* matched_store_and_hash_prefixes) {
+ DCHECK(matched_store_and_hash_prefixes);
Nathan Parker 2016/09/09 21:26:20 nit: You don't need the DCHECK if you're accessing
vakh (use Gerrit instead) 2016/09/09 23:25:17 Done.
+ matched_store_and_hash_prefixes->clear();
for (const UpdateListIdentifier& identifier : stores_to_look) {
const auto& store_pair = store_map_->find(identifier);
DCHECK(store_pair != store_map_->end());
const std::unique_ptr<V4Store>& store = store_pair->second;
HashPrefix hash_prefix = store->GetMatchingHashPrefix(full_hash);
if (!hash_prefix.empty()) {
- (*matched_hash_prefix_map)[identifier] = hash_prefix;
+ matched_store_and_hash_prefixes->push_back(
Nathan Parker 2016/09/09 21:26:20 nit: Does this work: ->emplace_back(identifier, h
vakh (use Gerrit instead) 2016/09/09 23:25:17 Done.
+ StoreAndHashPrefix(identifier, hash_prefix));
}
}
}

Powered by Google App Engine
This is Rietveld 408576698