Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3813)

Unified Diff: chrome/common/mru_cache.h

Issue 4247: Port some things in browser/{download,history}, minor things in common.... (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: '' Created 12 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/template_url.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/common/mru_cache.h
===================================================================
--- chrome/common/mru_cache.h (revision 2786)
+++ chrome/common/mru_cache.h (working copy)
@@ -70,7 +70,7 @@
// will take ownership of the pointer.
iterator Put(const KeyType& key, const PayloadType& payload) {
// Remove any existing payload with that key.
- KeyIndex::iterator index_iter = index_.find(key);
+ typename KeyIndex::iterator index_iter = index_.find(key);
if (index_iter != index_.end()) {
// Erase the reference to it. This will call the deletor on the removed
// element. The index reference will be replaced in the code below.
@@ -92,10 +92,10 @@
//
// TODO(brettw) We may want a const version of this function in the future.
iterator Get(const KeyType& key) {
- KeyIndex::iterator index_iter = index_.find(key);
+ typename KeyIndex::iterator index_iter = index_.find(key);
if (index_iter == index_.end())
return end();
- PayloadList::iterator iter = index_iter->second;
+ typename PayloadList::iterator iter = index_iter->second;
// Move the touched item to the front of the recency ordering.
ordering_.splice(ordering_.begin(), ordering_, iter);
@@ -107,7 +107,7 @@
//
// TODO(brettw) We may want a const version of this function in the future.
iterator Peek(const KeyType& key) {
- KeyIndex::const_iterator index_iter = index_.find(key);
+ typename KeyIndex::const_iterator index_iter = index_.find(key);
if (index_iter == index_.end())
return end();
return index_iter->second;
@@ -190,15 +190,20 @@
class MRUCache : public MRUCacheBase<KeyType,
PayloadType,
MRUCacheNullDeletor<PayloadType> > {
+ private:
+ typedef MRUCacheBase<KeyType, PayloadType,
+ MRUCacheNullDeletor<PayloadType> > ParentType;
+
public:
// See MRUCacheBase, noting the possibility of using NO_AUTO_EVICT.
- MRUCache(size_type max_size) : MRUCacheBase(max_size) {
+ MRUCache(typename ParentType::size_type max_size)
+ : ParentType(max_size) {
}
virtual ~MRUCache() {
}
private:
- DISALLOW_EVIL_CONSTRUCTORS(MRUCache);
+ DISALLOW_COPY_AND_ASSIGN(MRUCache);
};
// OwningMRUCache --------------------------------------------------------------
@@ -219,15 +224,20 @@
: public MRUCacheBase<KeyType,
PayloadType,
MRUCachePointerDeletor<PayloadType> > {
+ private:
+ typedef MRUCacheBase<KeyType, PayloadType,
+ MRUCachePointerDeletor<PayloadType> > ParentType;
+
public:
// See MRUCacheBase, noting the possibility of using NO_AUTO_EVICT.
- OwningMRUCache(size_type max_size) : MRUCacheBase(max_size) {
+ OwningMRUCache(typename ParentType::size_type max_size)
+ : ParentType(max_size) {
}
virtual ~OwningMRUCache() {
}
private:
- DISALLOW_EVIL_CONSTRUCTORS(OwningMRUCache);
+ DISALLOW_COPY_AND_ASSIGN(OwningMRUCache);
};
#endif // CHROME_COMMON_MRU_CACHE_H__
« no previous file with comments | « chrome/browser/template_url.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698