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

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

Issue 803603004: IndexedDB: Reusing leveldb logs when opening database (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added implementation of leveldb::Env::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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2013 The LevelDB Authors. All rights reserved. 1 // Copyright (c) 2013 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 #ifndef THIRD_PARTY_LEVELDATABASE_ENV_CHROMIUM_H_ 5 #ifndef THIRD_PARTY_LEVELDATABASE_ENV_CHROMIUM_H_
6 #define THIRD_PARTY_LEVELDATABASE_ENV_CHROMIUM_H_ 6 #define THIRD_PARTY_LEVELDATABASE_ENV_CHROMIUM_H_
7 7
8 #include <deque> 8 #include <deque>
9 #include <set> 9 #include <set>
10 #include <string> 10 #include <string>
11 #include <vector> 11 #include <vector>
12 12
13 #include "base/files/file.h" 13 #include "base/files/file.h"
14 #include "base/files/file_path.h" 14 #include "base/files/file_path.h"
15 #include "base/metrics/histogram.h" 15 #include "base/metrics/histogram.h"
16 #include "leveldb/env.h" 16 #include "leveldb/env.h"
17 #include "port/port_chromium.h" 17 #include "port/port_chromium.h"
18 #include "util/mutexlock.h" 18 #include "util/mutexlock.h"
19 19
20 namespace leveldb_env { 20 namespace leveldb_env {
21 21
22 enum MethodID { 22 enum MethodID {
jsbell 2014/12/15 17:41:23 Isn't this enum logged to UMA, and therefore new e
cmumford 2014/12/15 18:08:36 Thx. I think I forgot this last time too. Added a
23 kSequentialFileRead, 23 kSequentialFileRead,
24 kSequentialFileSkip, 24 kSequentialFileSkip,
25 kRandomAccessFileRead, 25 kRandomAccessFileRead,
26 kWritableFileAppend, 26 kWritableFileAppend,
27 kWritableFileClose, 27 kWritableFileClose,
28 kWritableFileFlush, 28 kWritableFileFlush,
29 kWritableFileSync, 29 kWritableFileSync,
30 kNewSequentialFile, 30 kNewSequentialFile,
31 kNewRandomAccessFile, 31 kNewRandomAccessFile,
32 kNewWritableFile, 32 kNewWritableFile,
33 kNewAppendableFile,
33 kDeleteFile, 34 kDeleteFile,
34 kCreateDir, 35 kCreateDir,
35 kDeleteDir, 36 kDeleteDir,
36 kGetFileSize, 37 kGetFileSize,
37 kRenameFile, 38 kRenameFile,
38 kLockFile, 39 kLockFile,
39 kUnlockFile, 40 kUnlockFile,
40 kGetTestDirectory, 41 kGetTestDirectory,
41 kNewLogger, 42 kNewLogger,
42 kSyncParent, 43 kSyncParent,
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
122 virtual leveldb::Status GetTestDirectory(std::string* path); 123 virtual leveldb::Status GetTestDirectory(std::string* path);
123 virtual uint64_t NowMicros(); 124 virtual uint64_t NowMicros();
124 virtual void SleepForMicroseconds(int micros); 125 virtual void SleepForMicroseconds(int micros);
125 virtual leveldb::Status NewSequentialFile(const std::string& fname, 126 virtual leveldb::Status NewSequentialFile(const std::string& fname,
126 leveldb::SequentialFile** result); 127 leveldb::SequentialFile** result);
127 virtual leveldb::Status NewRandomAccessFile( 128 virtual leveldb::Status NewRandomAccessFile(
128 const std::string& fname, 129 const std::string& fname,
129 leveldb::RandomAccessFile** result); 130 leveldb::RandomAccessFile** result);
130 virtual leveldb::Status NewWritableFile(const std::string& fname, 131 virtual leveldb::Status NewWritableFile(const std::string& fname,
131 leveldb::WritableFile** result); 132 leveldb::WritableFile** result);
133 virtual leveldb::Status NewAppendableFile(const std::string& fname,
134 leveldb::WritableFile** result);
132 virtual leveldb::Status NewLogger(const std::string& fname, 135 virtual leveldb::Status NewLogger(const std::string& fname,
133 leveldb::Logger** result); 136 leveldb::Logger** result);
134 137
135 protected: 138 protected:
136 virtual void DidSyncDir(const std::string& fname); 139 virtual void DidSyncDir(const std::string& fname);
137 140
138 std::string name_; 141 std::string name_;
139 bool make_backup_; 142 bool make_backup_;
140 143
141 private: 144 private:
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
203 void (*function)(void*); 206 void (*function)(void*);
204 }; 207 };
205 typedef std::deque<BGItem> BGQueue; 208 typedef std::deque<BGItem> BGQueue;
206 BGQueue queue_; 209 BGQueue queue_;
207 LockTable locks_; 210 LockTable locks_;
208 }; 211 };
209 212
210 } // namespace leveldb_env 213 } // namespace leveldb_env
211 214
212 #endif // THIRD_PARTY_LEVELDATABASE_ENV_CHROMIUM_H_ 215 #endif // THIRD_PARTY_LEVELDATABASE_ENV_CHROMIUM_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698