diff options
author | dgrogan@chromium.org <dgrogan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-10-08 02:52:32 +0000 |
---|---|---|
committer | dgrogan@chromium.org <dgrogan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-10-08 02:52:32 +0000 |
commit | 0afaf1a928dea560da5731a2811569724e11de6f (patch) | |
tree | 6e07bb93cf1820a23b0352ef8f5270aab2dd337d /third_party | |
parent | 0c2d584ab97619534f19b8c3fb1c48123dbcfde6 (diff) | |
download | chromium_src-0afaf1a928dea560da5731a2811569724e11de6f.zip chromium_src-0afaf1a928dea560da5731a2811569724e11de6f.tar.gz chromium_src-0afaf1a928dea560da5731a2811569724e11de6f.tar.bz2 |
Don't reset the database when there was an I/O error.
Unlike corruption errors, I/O errors have the potential to be ephemeral.
We shouldn't aggressively delete the database in those cases. Instead,
punt that decision up to the web app.
Also, can remove the full disk catch-all. That was intended to catch
full disks masquerading as other I/O errors.
BUG=239882
Review URL: https://codereview.chromium.org/26045002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@227444 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'third_party')
-rw-r--r-- | third_party/leveldatabase/env_chromium.cc | 8 | ||||
-rw-r--r-- | third_party/leveldatabase/env_chromium.h | 1 |
2 files changed, 9 insertions, 0 deletions
diff --git a/third_party/leveldatabase/env_chromium.cc b/third_party/leveldatabase/env_chromium.cc index 9cba729..0a78b48 100644 --- a/third_party/leveldatabase/env_chromium.cc +++ b/third_party/leveldatabase/env_chromium.cc @@ -392,6 +392,14 @@ bool IndicatesDiskFull(leveldb::Status status) { (result == leveldb_env::METHOD_AND_ERRNO && error == ENOSPC); } +bool IsIOError(leveldb::Status status) { + leveldb_env::MethodID method; + int error = -1; + leveldb_env::ErrorParsingResult result = leveldb_env::ParseMethodAndError( + status.ToString().c_str(), &method, &error); + return result != leveldb_env::NONE; +} + std::string FilePathToString(const base::FilePath& file_path) { #if defined(OS_WIN) return UTF16ToUTF8(file_path.value()); diff --git a/third_party/leveldatabase/env_chromium.h b/third_party/leveldatabase/env_chromium.h index e84fad7..b23969c 100644 --- a/third_party/leveldatabase/env_chromium.h +++ b/third_party/leveldatabase/env_chromium.h @@ -66,6 +66,7 @@ ErrorParsingResult ParseMethodAndError(const char* string, MethodID* method, int* error); bool IndicatesDiskFull(leveldb::Status status); +bool IsIOError(leveldb::Status status); std::string FilePathToString(const base::FilePath& file_path); class UMALogger { |