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

Unified Diff: third_party/leveldatabase/env_chromium.cc

Issue 803603004: IndexedDB: Reusing leveldb logs when opening database (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed UMA logging for NewAppendableFile Created 6 years 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
Index: third_party/leveldatabase/env_chromium.cc
diff --git a/third_party/leveldatabase/env_chromium.cc b/third_party/leveldatabase/env_chromium.cc
index cad20412bb343f5abf69b9eb7cc27b6448814e7b..558a04342cae6ba470bd806c480f1cf4f8675b7d 100644
--- a/third_party/leveldatabase/env_chromium.cc
+++ b/third_party/leveldatabase/env_chromium.cc
@@ -358,6 +358,8 @@ const char* MethodIDToString(MethodID method) {
return "NewRandomAccessFile";
case kNewWritableFile:
return "NewWritableFile";
+ case kNewAppendableFile:
+ return "NewAppendableFile";
case kDeleteFile:
return "DeleteFile";
case kCreateDir:
@@ -900,6 +902,22 @@ Status ChromiumEnv::NewWritableFile(const std::string& fname,
}
}
+Status ChromiumEnv::NewAppendableFile(const std::string& fname,
+ leveldb::WritableFile** result) {
+ *result = NULL;
+ FilePath path = FilePath::FromUTF8Unsafe(fname);
+ scoped_ptr<base::File> f(new base::File(
+ path, base::File::FLAG_OPEN_ALWAYS | base::File::FLAG_APPEND));
+ if (!f->IsValid()) {
+ RecordErrorAt(kNewAppendableFile);
+ return MakeIOError(fname, "Unable to create appendable file",
+ kNewAppendableFile, f->error_details());
+ }
+ *result =
+ new ChromiumWritableFile(fname, f.release(), this, this, make_backup_);
+ return Status::OK();
+}
+
uint64_t ChromiumEnv::NowMicros() {
return base::TimeTicks::Now().ToInternalValue();
}

Powered by Google App Engine
This is Rietveld 408576698