diff options
author | shess@chromium.org <shess@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-04-25 03:35:13 +0000 |
---|---|---|
committer | shess@chromium.org <shess@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-04-25 03:35:13 +0000 |
commit | 0cb8410651a5d1149285d3baa54fe124bbb86d47 (patch) | |
tree | 7bae4f7a5d614d2e69e4bba788dbf8baa2dcc0ab /chrome | |
parent | 0a133c0a8ebe9687e0427b44ff5724b07d523955 (diff) | |
download | chromium_src-0cb8410651a5d1149285d3baa54fe124bbb86d47.zip chromium_src-0cb8410651a5d1149285d3baa54fe124bbb86d47.tar.gz chromium_src-0cb8410651a5d1149285d3baa54fe124bbb86d47.tar.bz2 |
Do not validity check safe-browsing store if not opened.
In case of corruptions, the state of empty_ versus file_ may not be
what was expected.
BUG=124907
TEST=See bug.
Review URL: http://codereview.chromium.org/10211013
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@133860 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r-- | chrome/browser/safe_browsing/safe_browsing_store_file.cc | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/chrome/browser/safe_browsing/safe_browsing_store_file.cc b/chrome/browser/safe_browsing/safe_browsing_store_file.cc index 2159fa1..76a8958 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(); |