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 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
56 // Insert an MemEntryImpl into the ranking list. This method is only called | 56 // Insert an MemEntryImpl into the ranking list. This method is only called |
57 // from MemEntryImpl to insert child entries. The reference can be removed | 57 // from MemEntryImpl to insert child entries. The reference can be removed |
58 // by calling RemoveFromRankingList(|entry|). | 58 // by calling RemoveFromRankingList(|entry|). |
59 void InsertIntoRankingList(MemEntryImpl* entry); | 59 void InsertIntoRankingList(MemEntryImpl* entry); |
60 | 60 |
61 // Remove |entry| from ranking list. This method is only called from | 61 // Remove |entry| from ranking list. This method is only called from |
62 // MemEntryImpl to remove a child entry from the ranking list. | 62 // MemEntryImpl to remove a child entry from the ranking list. |
63 void RemoveFromRankingList(MemEntryImpl* entry); | 63 void RemoveFromRankingList(MemEntryImpl* entry); |
64 | 64 |
65 // Backend interface. | 65 // Backend interface. |
66 virtual net::CacheType GetCacheType() const OVERRIDE; | 66 virtual net::CacheType GetCacheType() const override; |
67 virtual int32 GetEntryCount() const OVERRIDE; | 67 virtual int32 GetEntryCount() const override; |
68 virtual int OpenEntry(const std::string& key, Entry** entry, | 68 virtual int OpenEntry(const std::string& key, Entry** entry, |
69 const CompletionCallback& callback) OVERRIDE; | 69 const CompletionCallback& callback) override; |
70 virtual int CreateEntry(const std::string& key, Entry** entry, | 70 virtual int CreateEntry(const std::string& key, Entry** entry, |
71 const CompletionCallback& callback) OVERRIDE; | 71 const CompletionCallback& callback) override; |
72 virtual int DoomEntry(const std::string& key, | 72 virtual int DoomEntry(const std::string& key, |
73 const CompletionCallback& callback) OVERRIDE; | 73 const CompletionCallback& callback) override; |
74 virtual int DoomAllEntries(const CompletionCallback& callback) OVERRIDE; | 74 virtual int DoomAllEntries(const CompletionCallback& callback) override; |
75 virtual int DoomEntriesBetween(base::Time initial_time, | 75 virtual int DoomEntriesBetween(base::Time initial_time, |
76 base::Time end_time, | 76 base::Time end_time, |
77 const CompletionCallback& callback) OVERRIDE; | 77 const CompletionCallback& callback) override; |
78 virtual int DoomEntriesSince(base::Time initial_time, | 78 virtual int DoomEntriesSince(base::Time initial_time, |
79 const CompletionCallback& callback) OVERRIDE; | 79 const CompletionCallback& callback) override; |
80 virtual scoped_ptr<Iterator> CreateIterator() OVERRIDE; | 80 virtual scoped_ptr<Iterator> CreateIterator() override; |
81 virtual void GetStats( | 81 virtual void GetStats( |
82 std::vector<std::pair<std::string, std::string> >* stats) OVERRIDE {} | 82 std::vector<std::pair<std::string, std::string> >* stats) override {} |
83 virtual void OnExternalCacheHit(const std::string& key) OVERRIDE; | 83 virtual void OnExternalCacheHit(const std::string& key) override; |
84 | 84 |
85 private: | 85 private: |
86 class MemIterator; | 86 class MemIterator; |
87 friend class MemIterator; | 87 friend class MemIterator; |
88 | 88 |
89 typedef base::hash_map<std::string, MemEntryImpl*> EntryMap; | 89 typedef base::hash_map<std::string, MemEntryImpl*> EntryMap; |
90 | 90 |
91 // Old Backend interface. | 91 // Old Backend interface. |
92 bool OpenEntry(const std::string& key, Entry** entry); | 92 bool OpenEntry(const std::string& key, Entry** entry); |
93 bool CreateEntry(const std::string& key, Entry** entry); | 93 bool CreateEntry(const std::string& key, Entry** entry); |
(...skipping 20 matching lines...) Expand all Loading... |
114 net::NetLog* net_log_; | 114 net::NetLog* net_log_; |
115 | 115 |
116 base::WeakPtrFactory<MemBackendImpl> weak_factory_; | 116 base::WeakPtrFactory<MemBackendImpl> weak_factory_; |
117 | 117 |
118 DISALLOW_COPY_AND_ASSIGN(MemBackendImpl); | 118 DISALLOW_COPY_AND_ASSIGN(MemBackendImpl); |
119 }; | 119 }; |
120 | 120 |
121 } // namespace disk_cache | 121 } // namespace disk_cache |
122 | 122 |
123 #endif // NET_DISK_CACHE_MEMORY_MEM_BACKEND_IMPL_H_ | 123 #endif // NET_DISK_CACHE_MEMORY_MEM_BACKEND_IMPL_H_ |
OLD | NEW |