| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_MEMORY_MEM_BACKEND_IMPL_H_ | 7 #ifndef NET_DISK_CACHE_MEMORY_MEM_BACKEND_IMPL_H_ |
| 8 #define NET_DISK_CACHE_MEMORY_MEM_BACKEND_IMPL_H_ | 8 #define NET_DISK_CACHE_MEMORY_MEM_BACKEND_IMPL_H_ |
| 9 | 9 |
| 10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 57 // by calling RemoveFromRankingList(|entry|). | 57 // by calling RemoveFromRankingList(|entry|). |
| 58 void InsertIntoRankingList(MemEntryImpl* entry); | 58 void InsertIntoRankingList(MemEntryImpl* entry); |
| 59 | 59 |
| 60 // Remove |entry| from ranking list. This method is only called from | 60 // Remove |entry| from ranking list. This method is only called from |
| 61 // MemEntryImpl to remove a child entry from the ranking list. | 61 // MemEntryImpl to remove a child entry from the ranking list. |
| 62 void RemoveFromRankingList(MemEntryImpl* entry); | 62 void RemoveFromRankingList(MemEntryImpl* entry); |
| 63 | 63 |
| 64 // Backend interface. | 64 // Backend interface. |
| 65 virtual net::CacheType GetCacheType() const OVERRIDE; | 65 virtual net::CacheType GetCacheType() const OVERRIDE; |
| 66 virtual int32 GetEntryCount() const OVERRIDE; | 66 virtual int32 GetEntryCount() const OVERRIDE; |
| 67 virtual int OpenEntry(const std::string& key, Entry** entry, | 67 virtual int OpenEntry(const std::string& key, |
| 68 Entry** entry, |
| 68 const CompletionCallback& callback) OVERRIDE; | 69 const CompletionCallback& callback) OVERRIDE; |
| 69 virtual int CreateEntry(const std::string& key, Entry** entry, | 70 virtual int CreateEntry(const std::string& key, |
| 71 Entry** entry, |
| 70 const CompletionCallback& callback) OVERRIDE; | 72 const CompletionCallback& callback) OVERRIDE; |
| 71 virtual int DoomEntry(const std::string& key, | 73 virtual int DoomEntry(const std::string& key, |
| 72 const CompletionCallback& callback) OVERRIDE; | 74 const CompletionCallback& callback) OVERRIDE; |
| 73 virtual int DoomAllEntries(const CompletionCallback& callback) OVERRIDE; | 75 virtual int DoomAllEntries(const CompletionCallback& callback) OVERRIDE; |
| 74 virtual int DoomEntriesBetween(base::Time initial_time, | 76 virtual int DoomEntriesBetween(base::Time initial_time, |
| 75 base::Time end_time, | 77 base::Time end_time, |
| 76 const CompletionCallback& callback) OVERRIDE; | 78 const CompletionCallback& callback) OVERRIDE; |
| 77 virtual int DoomEntriesSince(base::Time initial_time, | 79 virtual int DoomEntriesSince(base::Time initial_time, |
| 78 const CompletionCallback& callback) OVERRIDE; | 80 const CompletionCallback& callback) OVERRIDE; |
| 79 virtual int OpenNextEntry(void** iter, Entry** next_entry, | 81 virtual int OpenNextEntry(void** iter, |
| 82 Entry** next_entry, |
| 80 const CompletionCallback& callback) OVERRIDE; | 83 const CompletionCallback& callback) OVERRIDE; |
| 81 virtual void EndEnumeration(void** iter) OVERRIDE; | 84 virtual void EndEnumeration(void** iter) OVERRIDE; |
| 82 virtual void GetStats( | 85 virtual void GetStats( |
| 83 std::vector<std::pair<std::string, std::string> >* stats) OVERRIDE {} | 86 std::vector<std::pair<std::string, std::string> >* stats) OVERRIDE {} |
| 84 virtual void OnExternalCacheHit(const std::string& key) OVERRIDE; | 87 virtual void OnExternalCacheHit(const std::string& key) OVERRIDE; |
| 85 | 88 |
| 86 private: | 89 private: |
| 87 typedef base::hash_map<std::string, MemEntryImpl*> EntryMap; | 90 typedef base::hash_map<std::string, MemEntryImpl*> EntryMap; |
| 88 | 91 |
| 89 // Old Backend interface. | 92 // Old Backend interface. |
| (...skipping 21 matching lines...) Expand all Loading... |
| 111 int32 current_size_; | 114 int32 current_size_; |
| 112 | 115 |
| 113 net::NetLog* net_log_; | 116 net::NetLog* net_log_; |
| 114 | 117 |
| 115 DISALLOW_COPY_AND_ASSIGN(MemBackendImpl); | 118 DISALLOW_COPY_AND_ASSIGN(MemBackendImpl); |
| 116 }; | 119 }; |
| 117 | 120 |
| 118 } // namespace disk_cache | 121 } // namespace disk_cache |
| 119 | 122 |
| 120 #endif // NET_DISK_CACHE_MEMORY_MEM_BACKEND_IMPL_H_ | 123 #endif // NET_DISK_CACHE_MEMORY_MEM_BACKEND_IMPL_H_ |
| OLD | NEW |