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

Side by Side Diff: third_party/leveldatabase/env_chromium.cc

Issue 1023773003: IndexedDB: Enable leveldb log reuse on Chrome OS. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 9 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 unified diff | Download patch
« no previous file with comments | « content/browser/indexed_db/leveldb/leveldb_database.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The LevelDB Authors. All rights reserved. 1 // Copyright (c) 2011 The LevelDB Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. See the AUTHORS file for names of contributors. 3 // found in the LICENSE file. See the AUTHORS file for names of contributors.
4 4
5 #include "third_party/leveldatabase/env_chromium.h" 5 #include "third_party/leveldatabase/env_chromium.h"
6 6
7 #if defined(OS_POSIX) 7 #if defined(OS_POSIX)
8 #include <dirent.h> 8 #include <dirent.h>
9 #include <sys/types.h> 9 #include <sys/types.h>
10 #endif 10 #endif
(...skipping 878 matching lines...) Expand 10 before | Expand all | Expand 10 after
889 kNewWritableFile, f->error_details()); 889 kNewWritableFile, f->error_details());
890 } else { 890 } else {
891 *result = 891 *result =
892 new ChromiumWritableFile(fname, f.release(), this, this, make_backup_); 892 new ChromiumWritableFile(fname, f.release(), this, this, make_backup_);
893 return Status::OK(); 893 return Status::OK();
894 } 894 }
895 } 895 }
896 896
897 Status ChromiumEnv::NewAppendableFile(const std::string& fname, 897 Status ChromiumEnv::NewAppendableFile(const std::string& fname,
898 leveldb::WritableFile** result) { 898 leveldb::WritableFile** result) {
899 #if defined(OS_CHROMEOS)
900 // Disabled until crbug.com/460568 is fixed. Technically this method shouldn't
901 // be called if reuse_logs is false, but a leveldb bug (fixed, but not yet in
902 // Chrome) still calls this function. Using default leveldb Env implementation
903 // to workaround this bug.
904 return Env::NewAppendableFile(fname, result);
905 #endif
906
907 *result = NULL; 899 *result = NULL;
908 FilePath path = FilePath::FromUTF8Unsafe(fname); 900 FilePath path = FilePath::FromUTF8Unsafe(fname);
909 scoped_ptr<base::File> f(new base::File( 901 scoped_ptr<base::File> f(new base::File(
910 path, base::File::FLAG_OPEN_ALWAYS | base::File::FLAG_APPEND)); 902 path, base::File::FLAG_OPEN_ALWAYS | base::File::FLAG_APPEND));
911 if (!f->IsValid()) { 903 if (!f->IsValid()) {
912 RecordErrorAt(kNewAppendableFile); 904 RecordErrorAt(kNewAppendableFile);
913 return MakeIOError(fname, "Unable to create appendable file", 905 return MakeIOError(fname, "Unable to create appendable file",
914 kNewAppendableFile, f->error_details()); 906 kNewAppendableFile, f->error_details());
915 } 907 }
916 *result = 908 *result =
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after
1104 1096
1105 Env* IDBEnv() { 1097 Env* IDBEnv() {
1106 return leveldb_env::idb_env.Pointer(); 1098 return leveldb_env::idb_env.Pointer();
1107 } 1099 }
1108 1100
1109 Env* Env::Default() { 1101 Env* Env::Default() {
1110 return leveldb_env::default_env.Pointer(); 1102 return leveldb_env::default_env.Pointer();
1111 } 1103 }
1112 1104
1113 } // namespace leveldb 1105 } // namespace leveldb
OLDNEW
« no previous file with comments | « content/browser/indexed_db/leveldb/leveldb_database.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698