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

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

Issue 10093004: Double-check safe-browsing database validity on update failure. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Check size before reading. Created 8 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_store.h
diff --git a/chrome/browser/safe_browsing/safe_browsing_store.h b/chrome/browser/safe_browsing/safe_browsing_store.h
index a5b67fb96fd3c02b5689826a22e67989a312e37d..5b1e83145b4466a8d1d899fd87f0eaf9644069b2 100644
--- a/chrome/browser/safe_browsing/safe_browsing_store.h
+++ b/chrome/browser/safe_browsing/safe_browsing_store.h
@@ -220,6 +220,15 @@ class SafeBrowsingStore {
virtual void DeleteAddChunk(int32 chunk_id) = 0;
virtual void DeleteSubChunk(int32 chunk_id) = 0;
+ // May be called during update to verify that the storage is valid.
+ // Return true if the store seems valid. If corruption is detected,
+ // calls the corruption callback and return false.
+ // NOTE(shess): When storage was SQLite, there was no guarantee that
+ // a structurally sound database actually contained valid data,
+ // whereas SafeBrowsingStoreFile checksums the data. For now, this
+ // distinction doesn't matter.
+ virtual bool CheckValidity() = 0;
+
// Pass the collected chunks through SBPRocessSubs() and commit to
// permanent storage. The resulting add prefixes and hashes will be
// stored in |add_prefixes_result| and |add_full_hashes_result|.
« no previous file with comments | « chrome/browser/safe_browsing/safe_browsing_database.cc ('k') | chrome/browser/safe_browsing/safe_browsing_store_file.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698