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 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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_PFE, |
63 METHOD_AND_ERRNO, | |
64 NONE, | 63 NONE, |
65 }; | 64 }; |
66 | 65 |
67 ErrorParsingResult ParseMethodAndError(const leveldb::Status& status, | 66 ErrorParsingResult ParseMethodAndError(const leveldb::Status& status, |
68 MethodID* method, | 67 MethodID* method, |
69 int* error); | 68 base::File::Error* error); |
70 int GetCorruptionCode(const leveldb::Status& status); | 69 int GetCorruptionCode(const leveldb::Status& status); |
71 int GetNumCorruptionCodes(); | 70 int GetNumCorruptionCodes(); |
72 std::string GetCorruptionMessage(const leveldb::Status& status); | 71 std::string GetCorruptionMessage(const leveldb::Status& status); |
73 bool IndicatesDiskFull(const leveldb::Status& status); | 72 bool IndicatesDiskFull(const leveldb::Status& status); |
74 | 73 |
75 class UMALogger { | 74 class UMALogger { |
76 public: | 75 public: |
77 virtual void RecordErrorAt(MethodID method) const = 0; | 76 virtual void RecordErrorAt(MethodID method) const = 0; |
78 virtual void RecordOSError(MethodID method, | 77 virtual void RecordOSError(MethodID method, |
79 base::File::Error error) const = 0; | 78 base::File::Error error) const = 0; |
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
207 void (*function)(void*); | 206 void (*function)(void*); |
208 }; | 207 }; |
209 typedef std::deque<BGItem> BGQueue; | 208 typedef std::deque<BGItem> BGQueue; |
210 BGQueue queue_; | 209 BGQueue queue_; |
211 LockTable locks_; | 210 LockTable locks_; |
212 }; | 211 }; |
213 | 212 |
214 } // namespace leveldb_env | 213 } // namespace leveldb_env |
215 | 214 |
216 #endif // THIRD_PARTY_LEVELDATABASE_ENV_CHROMIUM_H_ | 215 #endif // THIRD_PARTY_LEVELDATABASE_ENV_CHROMIUM_H_ |
OLD | NEW |