| OLD | NEW |
| 1 // Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2009 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_MEM_BACKEND_IMPL_H__ | 7 #ifndef NET_DISK_CACHE_MEM_BACKEND_IMPL_H__ |
| 8 #define NET_DISK_CACHE_MEM_BACKEND_IMPL_H__ | 8 #define NET_DISK_CACHE_MEM_BACKEND_IMPL_H__ |
| 9 | 9 |
| 10 #include "base/hash_tables.h" | 10 #include "base/hash_tables.h" |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 public: | 22 public: |
| 23 MemBackendImpl() : max_size_(0), current_size_(0) {} | 23 MemBackendImpl() : max_size_(0), current_size_(0) {} |
| 24 ~MemBackendImpl(); | 24 ~MemBackendImpl(); |
| 25 | 25 |
| 26 // Performs general initialization for this current instance of the cache. | 26 // Performs general initialization for this current instance of the cache. |
| 27 bool Init(); | 27 bool Init(); |
| 28 | 28 |
| 29 // Backend interface. | 29 // Backend interface. |
| 30 virtual int32 GetEntryCount() const; | 30 virtual int32 GetEntryCount() const; |
| 31 virtual bool OpenEntry(const std::string& key, Entry** entry); | 31 virtual bool OpenEntry(const std::string& key, Entry** entry); |
| 32 virtual int OpenEntry(const std::string& key, Entry** entry, |
| 33 CompletionCallback* callback); |
| 32 virtual bool CreateEntry(const std::string& key, Entry** entry); | 34 virtual bool CreateEntry(const std::string& key, Entry** entry); |
| 35 virtual int CreateEntry(const std::string& key, Entry** entry, |
| 36 CompletionCallback* callback); |
| 33 virtual bool DoomEntry(const std::string& key); | 37 virtual bool DoomEntry(const std::string& key); |
| 34 virtual bool DoomAllEntries(); | 38 virtual bool DoomAllEntries(); |
| 39 virtual int DoomAllEntries(CompletionCallback* callback); |
| 35 virtual bool DoomEntriesBetween(const base::Time initial_time, | 40 virtual bool DoomEntriesBetween(const base::Time initial_time, |
| 36 const base::Time end_time); | 41 const base::Time end_time); |
| 42 virtual int DoomEntriesBetween(const base::Time initial_time, |
| 43 const base::Time end_time, |
| 44 CompletionCallback* callback); |
| 37 virtual bool DoomEntriesSince(const base::Time initial_time); | 45 virtual bool DoomEntriesSince(const base::Time initial_time); |
| 46 virtual int DoomEntriesSince(const base::Time initial_time, |
| 47 CompletionCallback* callback); |
| 38 virtual bool OpenNextEntry(void** iter, Entry** next_entry); | 48 virtual bool OpenNextEntry(void** iter, Entry** next_entry); |
| 49 virtual int OpenNextEntry(void** iter, Entry** next_entry, |
| 50 CompletionCallback* callback); |
| 39 virtual void EndEnumeration(void** iter); | 51 virtual void EndEnumeration(void** iter); |
| 40 virtual void GetStats( | 52 virtual void GetStats( |
| 41 std::vector<std::pair<std::string, std::string> >* stats) {} | 53 std::vector<std::pair<std::string, std::string> >* stats) {} |
| 42 | 54 |
| 43 // Sets the maximum size for the total amount of data stored by this instance. | 55 // Sets the maximum size for the total amount of data stored by this instance. |
| 44 bool SetMaxSize(int max_bytes); | 56 bool SetMaxSize(int max_bytes); |
| 45 | 57 |
| 46 // Permanently deletes an entry. | 58 // Permanently deletes an entry. |
| 47 void InternalDoomEntry(MemEntryImpl* entry); | 59 void InternalDoomEntry(MemEntryImpl* entry); |
| 48 | 60 |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 80 MemRankings rankings_; // Rankings to be able to trim the cache. | 92 MemRankings rankings_; // Rankings to be able to trim the cache. |
| 81 int32 max_size_; // Maximum data size for this instance. | 93 int32 max_size_; // Maximum data size for this instance. |
| 82 int32 current_size_; | 94 int32 current_size_; |
| 83 | 95 |
| 84 DISALLOW_EVIL_CONSTRUCTORS(MemBackendImpl); | 96 DISALLOW_EVIL_CONSTRUCTORS(MemBackendImpl); |
| 85 }; | 97 }; |
| 86 | 98 |
| 87 } // namespace disk_cache | 99 } // namespace disk_cache |
| 88 | 100 |
| 89 #endif // NET_DISK_CACHE_MEM_BACKEND_IMPL_H__ | 101 #endif // NET_DISK_CACHE_MEM_BACKEND_IMPL_H__ |
| OLD | NEW |