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_BACKEND_IMPL_H_ | 5 #ifndef NET_DISK_CACHE_SIMPLE_SIMPLE_BACKEND_IMPL_H_ |
6 #define NET_DISK_CACHE_SIMPLE_SIMPLE_BACKEND_IMPL_H_ | 6 #define NET_DISK_CACHE_SIMPLE_SIMPLE_BACKEND_IMPL_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <utility> | 9 #include <utility> |
10 #include <vector> | 10 #include <vector> |
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
133 void InitializeIndex(const CompletionCallback& callback, | 133 void InitializeIndex(const CompletionCallback& callback, |
134 const DiskStatResult& result); | 134 const DiskStatResult& result); |
135 | 135 |
136 // Dooms all entries previously accessed between |initial_time| and | 136 // Dooms all entries previously accessed between |initial_time| and |
137 // |end_time|. Invoked when the index is ready. | 137 // |end_time|. Invoked when the index is ready. |
138 void IndexReadyForDoom(base::Time initial_time, | 138 void IndexReadyForDoom(base::Time initial_time, |
139 base::Time end_time, | 139 base::Time end_time, |
140 const CompletionCallback& callback, | 140 const CompletionCallback& callback, |
141 int result); | 141 int result); |
142 | 142 |
| 143 // Calculates the size of the entire cache. Invoked when the index is ready. |
| 144 void IndexReadyForSizeCalculation(const CompletionCallback& callback, |
| 145 int result); |
| 146 |
143 // Try to create the directory if it doesn't exist. This must run on the IO | 147 // Try to create the directory if it doesn't exist. This must run on the IO |
144 // thread. | 148 // thread. |
145 static DiskStatResult InitCacheStructureOnDisk(const base::FilePath& path, | 149 static DiskStatResult InitCacheStructureOnDisk(const base::FilePath& path, |
146 uint64 suggested_max_size); | 150 uint64 suggested_max_size); |
147 | 151 |
148 // Searches |active_entries_| for the entry corresponding to |key|. If found, | 152 // Searches |active_entries_| for the entry corresponding to |key|. If found, |
149 // returns the found entry. Otherwise, creates a new entry and returns that. | 153 // returns the found entry. Otherwise, creates a new entry and returns that. |
150 scoped_refptr<SimpleEntryImpl> CreateOrFindActiveEntry( | 154 scoped_refptr<SimpleEntryImpl> CreateOrFindActiveEntry( |
151 uint64 entry_hash, | 155 uint64 entry_hash, |
152 const std::string& key); | 156 const std::string& key); |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
204 // is complete. The base::Closure map target is used to store deferred | 208 // is complete. The base::Closure map target is used to store deferred |
205 // operations to be run at the completion of the Doom. | 209 // operations to be run at the completion of the Doom. |
206 base::hash_map<uint64, std::vector<base::Closure> > entries_pending_doom_; | 210 base::hash_map<uint64, std::vector<base::Closure> > entries_pending_doom_; |
207 | 211 |
208 net::NetLog* const net_log_; | 212 net::NetLog* const net_log_; |
209 }; | 213 }; |
210 | 214 |
211 } // namespace disk_cache | 215 } // namespace disk_cache |
212 | 216 |
213 #endif // NET_DISK_CACHE_SIMPLE_SIMPLE_BACKEND_IMPL_H_ | 217 #endif // NET_DISK_CACHE_SIMPLE_SIMPLE_BACKEND_IMPL_H_ |
OLD | NEW |