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

Unified Diff: chrome/browser/safe_browsing/bloom_filter.h

Issue 10818042: Add construction checksum to safe-browsing's BloomFilter. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 8 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
« no previous file with comments | « no previous file | chrome/browser/safe_browsing/bloom_filter.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/safe_browsing/bloom_filter.h
diff --git a/chrome/browser/safe_browsing/bloom_filter.h b/chrome/browser/safe_browsing/bloom_filter.h
index 9730ffda9b006574059018ca6f34ba1a744ade42..5a1e6ef9a646ef920215bc6d54c4d460775b536e 100644
--- a/chrome/browser/safe_browsing/bloom_filter.h
+++ b/chrome/browser/safe_browsing/bloom_filter.h
@@ -66,6 +66,10 @@ class BloomFilter : public base::RefCountedThreadSafe<BloomFilter> {
// tests wish to make their own calculations.
static int FilterSizeForKeyCount(int key_count);
+ // Check whether the contents of the bloom filter have changed since
+ // construction. Present while debugging PrefixSet.
+ bool CheckChecksum() const;
+
private:
friend class base::RefCountedThreadSafe<BloomFilter>;
FRIEND_TEST_ALL_PREFIXES(SafeBrowsingBloomFilter, BloomFilterUse);
@@ -102,6 +106,10 @@ class BloomFilter : public base::RefCountedThreadSafe<BloomFilter> {
// Random keys used for hashing.
HashKeys hash_keys_;
+ // For debugging, used to verify that |hash_keys_| and |data_| have
+ // not changed other than via constructor or Insert().
+ uint32 checksum_;
+
DISALLOW_COPY_AND_ASSIGN(BloomFilter);
};
« no previous file with comments | « no previous file | chrome/browser/safe_browsing/bloom_filter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698