OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 // See net/disk_cache/disk_cache.h for the public interface of the cache. | 5 // See net/disk_cache/disk_cache.h for the public interface of the cache. |
6 | 6 |
7 #ifndef NET_DISK_CACHE_BACKEND_IMPL_H_ | 7 #ifndef NET_DISK_CACHE_BACKEND_IMPL_H_ |
8 #define NET_DISK_CACHE_BACKEND_IMPL_H_ | 8 #define NET_DISK_CACHE_BACKEND_IMPL_H_ |
9 | 9 |
10 #include "base/file_path.h" | 10 #include "base/file_path.h" |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
55 static Backend* CreateBackend(const FilePath& full_path, bool force, | 55 static Backend* CreateBackend(const FilePath& full_path, bool force, |
56 int max_bytes, net::CacheType type, | 56 int max_bytes, net::CacheType type, |
57 BackendFlags flags); | 57 BackendFlags flags); |
58 | 58 |
59 // Performs general initialization for this current instance of the cache. | 59 // Performs general initialization for this current instance of the cache. |
60 bool Init(); | 60 bool Init(); |
61 | 61 |
62 // Backend interface. | 62 // Backend interface. |
63 virtual int32 GetEntryCount() const; | 63 virtual int32 GetEntryCount() const; |
64 virtual bool OpenEntry(const std::string& key, Entry** entry); | 64 virtual bool OpenEntry(const std::string& key, Entry** entry); |
| 65 virtual int OpenEntry(const std::string& key, Entry** entry, |
| 66 CompletionCallback* callback); |
65 virtual bool CreateEntry(const std::string& key, Entry** entry); | 67 virtual bool CreateEntry(const std::string& key, Entry** entry); |
| 68 virtual int CreateEntry(const std::string& key, Entry** entry, |
| 69 CompletionCallback* callback); |
66 virtual bool DoomEntry(const std::string& key); | 70 virtual bool DoomEntry(const std::string& key); |
67 virtual bool DoomAllEntries(); | 71 virtual bool DoomAllEntries(); |
| 72 virtual int DoomAllEntries(CompletionCallback* callback); |
68 virtual bool DoomEntriesBetween(const base::Time initial_time, | 73 virtual bool DoomEntriesBetween(const base::Time initial_time, |
69 const base::Time end_time); | 74 const base::Time end_time); |
| 75 virtual int DoomEntriesBetween(const base::Time initial_time, |
| 76 const base::Time end_time, |
| 77 CompletionCallback* callback); |
70 virtual bool DoomEntriesSince(const base::Time initial_time); | 78 virtual bool DoomEntriesSince(const base::Time initial_time); |
| 79 virtual int DoomEntriesSince(const base::Time initial_time, |
| 80 CompletionCallback* callback); |
71 virtual bool OpenNextEntry(void** iter, Entry** next_entry); | 81 virtual bool OpenNextEntry(void** iter, Entry** next_entry); |
| 82 virtual int OpenNextEntry(void** iter, Entry** next_entry, |
| 83 CompletionCallback* callback); |
72 virtual void EndEnumeration(void** iter); | 84 virtual void EndEnumeration(void** iter); |
73 virtual void GetStats(StatsItems* stats); | 85 virtual void GetStats(StatsItems* stats); |
74 | 86 |
75 // Sets the maximum size for the total amount of data stored by this instance. | 87 // Sets the maximum size for the total amount of data stored by this instance. |
76 bool SetMaxSize(int max_bytes); | 88 bool SetMaxSize(int max_bytes); |
77 | 89 |
78 // Sets the cache type for this backend. | 90 // Sets the cache type for this backend. |
79 void SetType(net::CacheType type); | 91 void SetType(net::CacheType type); |
80 | 92 |
81 // Returns the full name for an external storage file. | 93 // Returns the full name for an external storage file. |
(...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
292 | 304 |
293 DISALLOW_EVIL_CONSTRUCTORS(BackendImpl); | 305 DISALLOW_EVIL_CONSTRUCTORS(BackendImpl); |
294 }; | 306 }; |
295 | 307 |
296 // Returns the prefered max cache size given the available disk space. | 308 // Returns the prefered max cache size given the available disk space. |
297 int PreferedCacheSize(int64 available); | 309 int PreferedCacheSize(int64 available); |
298 | 310 |
299 } // namespace disk_cache | 311 } // namespace disk_cache |
300 | 312 |
301 #endif // NET_DISK_CACHE_BACKEND_IMPL_H_ | 313 #endif // NET_DISK_CACHE_BACKEND_IMPL_H_ |
OLD | NEW |