OLD | NEW |
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> |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
52 leveldb::Status MakeIOError(leveldb::Slice filename, | 52 leveldb::Status MakeIOError(leveldb::Slice filename, |
53 const std::string& message, | 53 const std::string& message, |
54 MethodID method, | 54 MethodID method, |
55 base::File::Error error); | 55 base::File::Error error); |
56 leveldb::Status MakeIOError(leveldb::Slice filename, | 56 leveldb::Status MakeIOError(leveldb::Slice filename, |
57 const std::string& message, | 57 const std::string& message, |
58 MethodID method); | 58 MethodID method); |
59 | 59 |
60 enum ErrorParsingResult { | 60 enum ErrorParsingResult { |
61 METHOD_ONLY, | 61 METHOD_ONLY, |
62 METHOD_AND_PFE, | 62 METHOD_AND_BFE, |
63 NONE, | 63 NONE, |
64 }; | 64 }; |
65 | 65 |
66 ErrorParsingResult ParseMethodAndError(const leveldb::Status& status, | 66 ErrorParsingResult ParseMethodAndError(const leveldb::Status& status, |
67 MethodID* method, | 67 MethodID* method, |
68 base::File::Error* error); | 68 base::File::Error* error); |
69 int GetCorruptionCode(const leveldb::Status& status); | 69 int GetCorruptionCode(const leveldb::Status& status); |
70 int GetNumCorruptionCodes(); | 70 int GetNumCorruptionCodes(); |
71 std::string GetCorruptionMessage(const leveldb::Status& status); | 71 std::string GetCorruptionMessage(const leveldb::Status& status); |
72 bool IndicatesDiskFull(const leveldb::Status& status); | 72 bool IndicatesDiskFull(const leveldb::Status& status); |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
132 leveldb::WritableFile** result); | 132 leveldb::WritableFile** result); |
133 virtual leveldb::Status NewAppendableFile(const std::string& fname, | 133 virtual leveldb::Status NewAppendableFile(const std::string& fname, |
134 leveldb::WritableFile** result); | 134 leveldb::WritableFile** result); |
135 virtual leveldb::Status NewLogger(const std::string& fname, | 135 virtual leveldb::Status NewLogger(const std::string& fname, |
136 leveldb::Logger** result); | 136 leveldb::Logger** result); |
137 | 137 |
138 protected: | 138 protected: |
139 virtual void DidSyncDir(const std::string& fname); | 139 virtual void DidSyncDir(const std::string& fname); |
140 | 140 |
141 std::string name_; | 141 std::string name_; |
| 142 std::string uma_ioerror_base_name_; |
142 bool make_backup_; | 143 bool make_backup_; |
143 | 144 |
144 private: | 145 private: |
145 static const char* FileErrorString(base::File::Error error); | 146 static const char* FileErrorString(base::File::Error error); |
146 | 147 |
147 virtual void DidCreateNewFile(const std::string& fname); | 148 virtual void DidCreateNewFile(const std::string& fname); |
148 virtual bool DoesDirNeedSync(const std::string& fname); | 149 virtual bool DoesDirNeedSync(const std::string& fname); |
149 virtual void RecordErrorAt(MethodID method) const; | 150 virtual void RecordErrorAt(MethodID method) const; |
150 virtual void RecordOSError(MethodID method, | 151 virtual void RecordOSError(MethodID method, |
151 base::File::Error error) const; | 152 base::File::Error error) const; |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
206 void (*function)(void*); | 207 void (*function)(void*); |
207 }; | 208 }; |
208 typedef std::deque<BGItem> BGQueue; | 209 typedef std::deque<BGItem> BGQueue; |
209 BGQueue queue_; | 210 BGQueue queue_; |
210 LockTable locks_; | 211 LockTable locks_; |
211 }; | 212 }; |
212 | 213 |
213 } // namespace leveldb_env | 214 } // namespace leveldb_env |
214 | 215 |
215 #endif // THIRD_PARTY_LEVELDATABASE_ENV_CHROMIUM_H_ | 216 #endif // THIRD_PARTY_LEVELDATABASE_ENV_CHROMIUM_H_ |
OLD | NEW |