| 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 NET_DISK_CACHE_SIMPLE_SIMPLE_INDEX_H_ | 5 #ifndef NET_DISK_CACHE_SIMPLE_SIMPLE_INDEX_H_ |
| 6 #define NET_DISK_CACHE_SIMPLE_SIMPLE_INDEX_H_ | 6 #define NET_DISK_CACHE_SIMPLE_SIMPLE_INDEX_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <list> | 10 #include <list> |
| (...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 148 // Returns the list of all entries key hash. | 148 // Returns the list of all entries key hash. |
| 149 std::unique_ptr<HashList> GetAllHashes(); | 149 std::unique_ptr<HashList> GetAllHashes(); |
| 150 | 150 |
| 151 // Returns number of indexed entries. | 151 // Returns number of indexed entries. |
| 152 int32_t GetEntryCount() const; | 152 int32_t GetEntryCount() const; |
| 153 | 153 |
| 154 // Returns the size of the entire cache in bytes. Can only be called after the | 154 // Returns the size of the entire cache in bytes. Can only be called after the |
| 155 // index has been initialized. | 155 // index has been initialized. |
| 156 uint64_t GetCacheSize() const; | 156 uint64_t GetCacheSize() const; |
| 157 | 157 |
| 158 // Returns the size of the cache entries accessed between |initial_time| and |
| 159 // |end_time| in bytes. Can only be called after the index has been |
| 160 // initialized. |
| 161 uint64_t GetCacheSizeBetween(const base::Time initial_time, |
| 162 const base::Time end_time) const; |
| 163 |
| 158 // Returns whether the index has been initialized yet. | 164 // Returns whether the index has been initialized yet. |
| 159 bool initialized() const { return initialized_; } | 165 bool initialized() const { return initialized_; } |
| 160 | 166 |
| 161 IndexInitMethod init_method() const { return init_method_; } | 167 IndexInitMethod init_method() const { return init_method_; } |
| 162 | 168 |
| 163 private: | 169 private: |
| 164 friend class SimpleIndexTest; | 170 friend class SimpleIndexTest; |
| 165 FRIEND_TEST_ALL_PREFIXES(SimpleIndexTest, IndexSizeCorrectOnMerge); | 171 FRIEND_TEST_ALL_PREFIXES(SimpleIndexTest, IndexSizeCorrectOnMerge); |
| 166 FRIEND_TEST_ALL_PREFIXES(SimpleIndexTest, DiskWriteQueued); | 172 FRIEND_TEST_ALL_PREFIXES(SimpleIndexTest, DiskWriteQueued); |
| 167 FRIEND_TEST_ALL_PREFIXES(SimpleIndexTest, DiskWriteExecuted); | 173 FRIEND_TEST_ALL_PREFIXES(SimpleIndexTest, DiskWriteExecuted); |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 225 | 231 |
| 226 // Set to true when the app is on the background. When the app is in the | 232 // Set to true when the app is on the background. When the app is in the |
| 227 // background we can write the index much more frequently, to insure fresh | 233 // background we can write the index much more frequently, to insure fresh |
| 228 // index on next startup. | 234 // index on next startup. |
| 229 bool app_on_background_; | 235 bool app_on_background_; |
| 230 }; | 236 }; |
| 231 | 237 |
| 232 } // namespace disk_cache | 238 } // namespace disk_cache |
| 233 | 239 |
| 234 #endif // NET_DISK_CACHE_SIMPLE_SIMPLE_INDEX_H_ | 240 #endif // NET_DISK_CACHE_SIMPLE_SIMPLE_INDEX_H_ |
| OLD | NEW |