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

Side by Side Diff: net/disk_cache/rankings.h

Issue 10854063: Clean-up inline members of nested classes (net/) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 4 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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. 5 // See net/disk_cache/disk_cache.h for the public interface.
6 6
7 #ifndef NET_DISK_CACHE_RANKINGS_H_ 7 #ifndef NET_DISK_CACHE_RANKINGS_H_
8 #define NET_DISK_CACHE_RANKINGS_H_ 8 #define NET_DISK_CACHE_RANKINGS_H_
9 9
10 #include <list> 10 #include <list>
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
57 RESERVED, // Reserved for future use. 57 RESERVED, // Reserved for future use.
58 DELETED, // List of recently deleted or doomed entries. 58 DELETED, // List of recently deleted or doomed entries.
59 LAST_ELEMENT 59 LAST_ELEMENT
60 }; 60 };
61 61
62 // This class provides a specialized version of scoped_ptr, that calls 62 // This class provides a specialized version of scoped_ptr, that calls
63 // Rankings whenever a CacheRankingsBlock is deleted, to keep track of cache 63 // Rankings whenever a CacheRankingsBlock is deleted, to keep track of cache
64 // iterators that may go stale. 64 // iterators that may go stale.
65 class ScopedRankingsBlock : public scoped_ptr<CacheRankingsBlock> { 65 class ScopedRankingsBlock : public scoped_ptr<CacheRankingsBlock> {
66 public: 66 public:
67 ScopedRankingsBlock() : rankings_(NULL) {} 67 ScopedRankingsBlock();
68 explicit ScopedRankingsBlock(Rankings* rankings) : rankings_(rankings) {} 68 explicit ScopedRankingsBlock(Rankings* rankings);
69 ScopedRankingsBlock(Rankings* rankings, CacheRankingsBlock* node) 69 ScopedRankingsBlock(Rankings* rankings, CacheRankingsBlock* node);
70 : scoped_ptr<CacheRankingsBlock>(node), rankings_(rankings) {}
71 70
72 ~ScopedRankingsBlock() { 71 ~ScopedRankingsBlock() {
73 rankings_->FreeRankingsBlock(get()); 72 rankings_->FreeRankingsBlock(get());
mmenke 2012/08/09 15:13:35 Shouldn't this also be de-inlined?
hans 2012/08/09 15:35:42 The plugin wasn't complaining about it. I can out-
74 } 73 }
75 74
76 void set_rankings(Rankings* rankings) { 75 void set_rankings(Rankings* rankings) {
77 rankings_ = rankings; 76 rankings_ = rankings;
78 } 77 }
79 78
80 // scoped_ptr::reset will delete the object. 79 // scoped_ptr::reset will delete the object.
81 void reset(CacheRankingsBlock* p = NULL) { 80 void reset(CacheRankingsBlock* p = NULL) {
82 if (p != get()) 81 if (p != get())
83 rankings_->FreeRankingsBlock(get()); 82 rankings_->FreeRankingsBlock(get());
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
207 BackendImpl* backend_; 206 BackendImpl* backend_;
208 LruData* control_data_; // Data related to the LRU lists. 207 LruData* control_data_; // Data related to the LRU lists.
209 IteratorList iterators_; 208 IteratorList iterators_;
210 209
211 DISALLOW_COPY_AND_ASSIGN(Rankings); 210 DISALLOW_COPY_AND_ASSIGN(Rankings);
212 }; 211 };
213 212
214 } // namespace disk_cache 213 } // namespace disk_cache
215 214
216 #endif // NET_DISK_CACHE_RANKINGS_H_ 215 #endif // NET_DISK_CACHE_RANKINGS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698