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

Unified Diff: chrome/browser/safe_browsing/safe_browsing_database.cc

Issue 263833005: Knock out injected safe-browsing prefixes. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: add ContainsBrowseUrl test. Created 6 years, 8 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: chrome/browser/safe_browsing/safe_browsing_database.cc
diff --git a/chrome/browser/safe_browsing/safe_browsing_database.cc b/chrome/browser/safe_browsing/safe_browsing_database.cc
index e1df58162229604a125ccd96061c38f518ea349f..09418a7b6bd36f49667649fb372ef0cf497a7ead 100644
--- a/chrome/browser/safe_browsing/safe_browsing_database.cc
+++ b/chrome/browser/safe_browsing/safe_browsing_database.cc
@@ -855,14 +855,10 @@ void SafeBrowsingDatabaseNew::InsertAdd(int chunk_id, SBPrefix host,
store->WriteAddPrefix(encoded_chunk_id, prefix);
}
} else {
- // Prefixes and hashes.
+ // Full hashes only.
const base::Time receive_time = base::Time::Now();
for (int i = 0; i < count; ++i) {
const SBFullHash full_hash = entry->FullHashAt(i);
- const SBPrefix prefix = full_hash.prefix;
-
- STATS_COUNTER("SB.PrefixAdd", 1);
- store->WriteAddPrefix(encoded_chunk_id, prefix);
STATS_COUNTER("SB.PrefixAddFull", 1);
store->WriteAddHash(encoded_chunk_id, receive_time, full_hash);
@@ -930,15 +926,12 @@ void SafeBrowsingDatabaseNew::InsertSub(int chunk_id, SBPrefix host,
store->WriteSubPrefix(encoded_chunk_id, add_chunk_id, prefix);
}
} else {
- // Prefixes and hashes.
+ // Full hashes only.
for (int i = 0; i < count; ++i) {
const SBFullHash full_hash = entry->FullHashAt(i);
const int add_chunk_id =
EncodeChunkId(entry->ChunkIdAtPrefix(i), list_id);
- STATS_COUNTER("SB.PrefixSub", 1);
- store->WriteSubPrefix(encoded_chunk_id, add_chunk_id, full_hash.prefix);
-
STATS_COUNTER("SB.PrefixSubFull", 1);
store->WriteSubHash(encoded_chunk_id, add_chunk_id, full_hash);
}

Powered by Google App Engine
This is Rietveld 408576698