summaryrefslogtreecommitdiffstats
path: root/third_party/leveldatabase/env_chromium.cc
diff options
context:
space:
mode:
authordgrogan@chromium.org <dgrogan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-10-08 02:52:32 +0000
committerdgrogan@chromium.org <dgrogan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-10-08 02:52:32 +0000
commit0afaf1a928dea560da5731a2811569724e11de6f (patch)
tree6e07bb93cf1820a23b0352ef8f5270aab2dd337d /third_party/leveldatabase/env_chromium.cc
parent0c2d584ab97619534f19b8c3fb1c48123dbcfde6 (diff)
downloadchromium_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/leveldatabase/env_chromium.cc')
-rw-r--r--third_party/leveldatabase/env_chromium.cc8
1 files changed, 8 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());