| 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 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 132 virtual leveldb::Status NewLogger(const std::string& fname, | 132 virtual leveldb::Status NewLogger(const std::string& fname, |
| 133 leveldb::Logger** result); | 133 leveldb::Logger** result); |
| 134 | 134 |
| 135 protected: | 135 protected: |
| 136 virtual void DidSyncDir(const std::string& fname); | 136 virtual void DidSyncDir(const std::string& fname); |
| 137 | 137 |
| 138 std::string name_; | 138 std::string name_; |
| 139 bool make_backup_; | 139 bool make_backup_; |
| 140 | 140 |
| 141 private: | 141 private: |
| 142 static const char* FileErrorString(::base::File::Error error); | 142 static const char* FileErrorString(base::File::Error error); |
| 143 | 143 |
| 144 virtual void DidCreateNewFile(const std::string& fname); | 144 virtual void DidCreateNewFile(const std::string& fname); |
| 145 virtual bool DoesDirNeedSync(const std::string& fname); | 145 virtual bool DoesDirNeedSync(const std::string& fname); |
| 146 virtual void RecordErrorAt(MethodID method) const; | 146 virtual void RecordErrorAt(MethodID method) const; |
| 147 virtual void RecordOSError(MethodID method, | 147 virtual void RecordOSError(MethodID method, |
| 148 base::File::Error error) const; | 148 base::File::Error error) const; |
| 149 void RecordOpenFilesLimit(const std::string& type); | 149 void RecordOpenFilesLimit(const std::string& type); |
| 150 base::HistogramBase* GetMaxFDHistogram(const std::string& type) const; | 150 base::HistogramBase* GetMaxFDHistogram(const std::string& type) const; |
| 151 base::HistogramBase* GetOSErrorHistogram(MethodID method, int limit) const; | 151 base::HistogramBase* GetOSErrorHistogram(MethodID method, int limit) const; |
| 152 | 152 |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 186 base::HistogramBase* GetLockFileAncestorHistogram() const; | 186 base::HistogramBase* GetLockFileAncestorHistogram() const; |
| 187 | 187 |
| 188 // RetrierProvider implementation. | 188 // RetrierProvider implementation. |
| 189 virtual int MaxRetryTimeMillis() const { return kMaxRetryTimeMillis; } | 189 virtual int MaxRetryTimeMillis() const { return kMaxRetryTimeMillis; } |
| 190 virtual base::HistogramBase* GetRetryTimeHistogram(MethodID method) const; | 190 virtual base::HistogramBase* GetRetryTimeHistogram(MethodID method) const; |
| 191 virtual base::HistogramBase* GetRecoveredFromErrorHistogram( | 191 virtual base::HistogramBase* GetRecoveredFromErrorHistogram( |
| 192 MethodID method) const; | 192 MethodID method) const; |
| 193 | 193 |
| 194 base::FilePath test_directory_; | 194 base::FilePath test_directory_; |
| 195 | 195 |
| 196 ::base::Lock mu_; | 196 base::Lock mu_; |
| 197 ::base::ConditionVariable bgsignal_; | 197 base::ConditionVariable bgsignal_; |
| 198 bool started_bgthread_; | 198 bool started_bgthread_; |
| 199 | 199 |
| 200 // Entry per Schedule() call | 200 // Entry per Schedule() call |
| 201 struct BGItem { | 201 struct BGItem { |
| 202 void* arg; | 202 void* arg; |
| 203 void (*function)(void*); | 203 void (*function)(void*); |
| 204 }; | 204 }; |
| 205 typedef std::deque<BGItem> BGQueue; | 205 typedef std::deque<BGItem> BGQueue; |
| 206 BGQueue queue_; | 206 BGQueue queue_; |
| 207 LockTable locks_; | 207 LockTable locks_; |
| 208 }; | 208 }; |
| 209 | 209 |
| 210 } // namespace leveldb_env | 210 } // namespace leveldb_env |
| 211 | 211 |
| 212 #endif // THIRD_PARTY_LEVELDATABASE_ENV_CHROMIUM_H_ | 212 #endif // THIRD_PARTY_LEVELDATABASE_ENV_CHROMIUM_H_ |
| OLD | NEW |