| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium 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. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CONTENT_BROWSER_LEVELDB_WRAPPER_IMPL_H_ | 5 #ifndef CONTENT_BROWSER_LEVELDB_WRAPPER_IMPL_H_ |
| 6 #define CONTENT_BROWSER_LEVELDB_WRAPPER_IMPL_H_ | 6 #define CONTENT_BROWSER_LEVELDB_WRAPPER_IMPL_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <memory> | 9 #include <memory> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 83 void Delete(const std::vector<uint8_t>& key, | 83 void Delete(const std::vector<uint8_t>& key, |
| 84 const std::string& source, | 84 const std::string& source, |
| 85 const DeleteCallback& callback) override; | 85 const DeleteCallback& callback) override; |
| 86 void DeleteAll(const std::string& source, | 86 void DeleteAll(const std::string& source, |
| 87 const DeleteAllCallback& callback) override; | 87 const DeleteAllCallback& callback) override; |
| 88 void Get(const std::vector<uint8_t>& key, | 88 void Get(const std::vector<uint8_t>& key, |
| 89 const GetCallback& callback) override; | 89 const GetCallback& callback) override; |
| 90 void GetAll( | 90 void GetAll( |
| 91 mojom::LevelDBWrapperGetAllCallbackAssociatedPtrInfo complete_callback, | 91 mojom::LevelDBWrapperGetAllCallbackAssociatedPtrInfo complete_callback, |
| 92 const GetAllCallback& callback) override; | 92 const GetAllCallback& callback) override; |
| 93 void Sync(const SyncCallback& callback) override; |
| 93 | 94 |
| 94 private: | 95 private: |
| 95 // Used to rate limit commits. | 96 // Used to rate limit commits. |
| 96 class RateLimiter { | 97 class RateLimiter { |
| 97 public: | 98 public: |
| 98 RateLimiter(size_t desired_rate, base::TimeDelta time_quantum); | 99 RateLimiter(size_t desired_rate, base::TimeDelta time_quantum); |
| 99 | 100 |
| 100 void add_samples(size_t samples) { samples_ += samples; } | 101 void add_samples(size_t samples) { samples_ += samples; } |
| 101 | 102 |
| 102 // Computes the total time needed to process the total samples seen | 103 // Computes the total time needed to process the total samples seen |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 153 base::WeakPtrFactory<LevelDBWrapperImpl> weak_ptr_factory_; | 154 base::WeakPtrFactory<LevelDBWrapperImpl> weak_ptr_factory_; |
| 154 | 155 |
| 155 static bool s_aggressive_flushing_enabled_; | 156 static bool s_aggressive_flushing_enabled_; |
| 156 | 157 |
| 157 DISALLOW_COPY_AND_ASSIGN(LevelDBWrapperImpl); | 158 DISALLOW_COPY_AND_ASSIGN(LevelDBWrapperImpl); |
| 158 }; | 159 }; |
| 159 | 160 |
| 160 } // namespace content | 161 } // namespace content |
| 161 | 162 |
| 162 #endif // CONTENT_BROWSER_LEVELDB_WRAPPER_IMPL_H_ | 163 #endif // CONTENT_BROWSER_LEVELDB_WRAPPER_IMPL_H_ |
| OLD | NEW |