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

Unified Diff: cc/base/scoped_ptr_deque.h

Issue 1420433009: cc: Keep most recently used resources at the front of resource queue. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Corrected implementation. Created 5 years, 2 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 | « no previous file | cc/resources/resource_pool.h » ('j') | cc/resources/resource_pool.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/base/scoped_ptr_deque.h
diff --git a/cc/base/scoped_ptr_deque.h b/cc/base/scoped_ptr_deque.h
index cb4adfc15be5273d49a1966708effee66b6873a2..dde4a5c4d491cded8bab0ceb3920a4295a31e5a5 100644
--- a/cc/base/scoped_ptr_deque.h
+++ b/cc/base/scoped_ptr_deque.h
@@ -106,6 +106,13 @@ class ScopedPtrDeque {
return ret.Pass();
}
+ scoped_ptr<T> rtake(reverse_iterator position) {
reveman 2015/11/02 01:47:07 Instead of adding this, can the user of this class
prashant.n 2015/11/02 04:07:20 I think same thing we'll have to do. iterator it
reveman 2015/11/02 04:32:59 as there's no rerase in std::deque I think it's be
+ DCHECK(position < rend());
+ scoped_ptr<T> ret(*position);
+ data_.erase(--position.base());
+ return ret.Pass();
+ }
+
void swap(iterator a, iterator b) {
DCHECK(a < end());
DCHECK(b < end());
« no previous file with comments | « no previous file | cc/resources/resource_pool.h » ('j') | cc/resources/resource_pool.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698