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 <list> | 8 #include <list> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
123 // disk cache backend interface. | 123 // disk cache backend interface. |
124 scoped_ptr<HashList> GetEntriesBetween(const base::Time initial_time, | 124 scoped_ptr<HashList> GetEntriesBetween(const base::Time initial_time, |
125 const base::Time end_time); | 125 const base::Time end_time); |
126 | 126 |
127 // Returns the list of all entries key hash. | 127 // Returns the list of all entries key hash. |
128 scoped_ptr<HashList> GetAllHashes(); | 128 scoped_ptr<HashList> GetAllHashes(); |
129 | 129 |
130 // Returns number of indexed entries. | 130 // Returns number of indexed entries. |
131 int32 GetEntryCount() const; | 131 int32 GetEntryCount() const; |
132 | 132 |
133 // Returns the size of the entire cache in bytes. | |
gavinp
2015/10/13 15:50:12
Probably should document that the cache must be in
msramek
2015/10/13 17:25:50
Done.
| |
134 uint64 GetCacheSize() const; | |
135 | |
133 // Returns whether the index has been initialized yet. | 136 // Returns whether the index has been initialized yet. |
134 bool initialized() const { return initialized_; } | 137 bool initialized() const { return initialized_; } |
135 | 138 |
136 private: | 139 private: |
137 friend class SimpleIndexTest; | 140 friend class SimpleIndexTest; |
138 FRIEND_TEST_ALL_PREFIXES(SimpleIndexTest, IndexSizeCorrectOnMerge); | 141 FRIEND_TEST_ALL_PREFIXES(SimpleIndexTest, IndexSizeCorrectOnMerge); |
139 FRIEND_TEST_ALL_PREFIXES(SimpleIndexTest, DiskWriteQueued); | 142 FRIEND_TEST_ALL_PREFIXES(SimpleIndexTest, DiskWriteQueued); |
140 FRIEND_TEST_ALL_PREFIXES(SimpleIndexTest, DiskWriteExecuted); | 143 FRIEND_TEST_ALL_PREFIXES(SimpleIndexTest, DiskWriteExecuted); |
141 FRIEND_TEST_ALL_PREFIXES(SimpleIndexTest, DiskWritePostponed); | 144 FRIEND_TEST_ALL_PREFIXES(SimpleIndexTest, DiskWritePostponed); |
142 | 145 |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
195 | 198 |
196 // Set to true when the app is on the background. When the app is in the | 199 // Set to true when the app is on the background. When the app is in the |
197 // background we can write the index much more frequently, to insure fresh | 200 // background we can write the index much more frequently, to insure fresh |
198 // index on next startup. | 201 // index on next startup. |
199 bool app_on_background_; | 202 bool app_on_background_; |
200 }; | 203 }; |
201 | 204 |
202 } // namespace disk_cache | 205 } // namespace disk_cache |
203 | 206 |
204 #endif // NET_DISK_CACHE_SIMPLE_SIMPLE_INDEX_H_ | 207 #endif // NET_DISK_CACHE_SIMPLE_SIMPLE_INDEX_H_ |
OLD | NEW |