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

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

Issue 10211013: Do not validity check safe-browsing store if not opened. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/safe_browsing/safe_browsing_store_file.cc
diff --git a/chrome/browser/safe_browsing/safe_browsing_store_file.cc b/chrome/browser/safe_browsing/safe_browsing_store_file.cc
index 2159fa1ecf61a4d95adaf8129a58a5413c361bff..76a8958aad0b1f793849df313d44052d18da3b8a 100644
--- a/chrome/browser/safe_browsing/safe_browsing_store_file.cc
+++ b/chrome/browser/safe_browsing/safe_browsing_store_file.cc
@@ -244,12 +244,13 @@ bool SafeBrowsingStoreFile::Delete() {
}
bool SafeBrowsingStoreFile::CheckValidity() {
- if (empty_)
+ // The file was either empty or never opened. The empty case is
+ // presumed not to be invalid. The never-opened case can happen if
+ // BeginUpdate() fails for any databases, and should already have
+ // caused the corruption callback to fire.
+ if (!file_.get())
return true;
- // If the file was not empty, it should be open.
- DCHECK(file_.get());
-
if (!FileRewind(file_.get()))
return OnCorruptDatabase();
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698