| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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_INDEXED_DB_LEVELDB_LEVELDB_DATABASE_H_ | 5 #ifndef CONTENT_BROWSER_INDEXED_DB_LEVELDB_LEVELDB_DATABASE_H_ |
| 6 #define CONTENT_BROWSER_INDEXED_DB_LEVELDB_LEVELDB_DATABASE_H_ | 6 #define CONTENT_BROWSER_INDEXED_DB_LEVELDB_LEVELDB_DATABASE_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 141 } | 141 } |
| 142 ~DetachIteratorOnDestruct(); | 142 ~DetachIteratorOnDestruct(); |
| 143 | 143 |
| 144 private: | 144 private: |
| 145 LevelDBIterator* it_ = nullptr; | 145 LevelDBIterator* it_ = nullptr; |
| 146 | 146 |
| 147 DISALLOW_COPY_AND_ASSIGN(DetachIteratorOnDestruct); | 147 DISALLOW_COPY_AND_ASSIGN(DetachIteratorOnDestruct); |
| 148 }; | 148 }; |
| 149 | 149 |
| 150 // Despite the type name, this object uses LRU eviction. | 150 // Despite the type name, this object uses LRU eviction. |
| 151 size_t lru_max_size_ = 0; | |
| 152 base::HashingMRUCache<LevelDBIterator*, DetachIteratorOnDestruct> | 151 base::HashingMRUCache<LevelDBIterator*, DetachIteratorOnDestruct> |
| 153 iterator_lru_; | 152 iterator_lru_; |
| 154 | 153 |
| 155 // Recorded for UMA reporting. | 154 // Recorded for UMA reporting. |
| 156 uint32_t num_iterators_ = 0; | 155 uint32_t num_iterators_ = 0; |
| 157 uint32_t max_iterators_ = 0; | 156 uint32_t max_iterators_ = 0; |
| 158 | 157 |
| 159 std::string file_name_for_tracing; | 158 std::string file_name_for_tracing; |
| 160 }; | 159 }; |
| 161 | 160 |
| 162 } // namespace content | 161 } // namespace content |
| 163 | 162 |
| 164 #endif // CONTENT_BROWSER_INDEXED_DB_LEVELDB_LEVELDB_DATABASE_H_ | 163 #endif // CONTENT_BROWSER_INDEXED_DB_LEVELDB_LEVELDB_DATABASE_H_ |
| OLD | NEW |