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

Unified Diff: third_party/leveldatabase/env_chromium.cc

Issue 26045002: Don't reset the database when there was an I/O error. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Change to IsIOError Created 7 years, 2 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 | « third_party/leveldatabase/env_chromium.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/leveldatabase/env_chromium.cc
diff --git a/third_party/leveldatabase/env_chromium.cc b/third_party/leveldatabase/env_chromium.cc
index 9cba7291eac71d70ead072711ad6e3c137fb1cec..0a78b48f0dadca116529a23d356c0902e5de1923 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());
« no previous file with comments | « third_party/leveldatabase/env_chromium.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698