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

Unified Diff: cc/base/sidecar_list_container.h

Issue 1163803003: cc: Implement RemoveLast for DisplayItemList. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: danakj comments Created 5 years, 7 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 | « cc/base/list_container.cc ('k') | cc/base/sidecar_list_container_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/base/sidecar_list_container.h
diff --git a/cc/base/sidecar_list_container.h b/cc/base/sidecar_list_container.h
index 52deaf4b0a47f11b3eeabaa780bb1ee2bcded359..842795fad1b3a94d2ea644a89c6fbd99301e5e4e 100644
--- a/cc/base/sidecar_list_container.h
+++ b/cc/base/sidecar_list_container.h
@@ -29,6 +29,10 @@ class SidecarListContainer {
using SidecarDestroyer = void (*)(void* sidecar);
using Iterator = typename ListContainer<BaseElementType>::Iterator;
using ConstIterator = typename ListContainer<BaseElementType>::ConstIterator;
+ using ReverseIterator =
+ typename ListContainer<BaseElementType>::ReverseIterator;
+ using ConstReverseIterator =
+ typename ListContainer<BaseElementType>::ConstReverseIterator;
explicit SidecarListContainer(size_t max_size_for_derived_class,
size_t max_size_for_sidecar,
@@ -60,6 +64,11 @@ class SidecarListContainer {
list_.clear();
}
+ void RemoveLast() {
+ destroyer_(GetSidecar(*list_.rbegin()));
+ list_.RemoveLast();
+ }
+
// This permits a client to exchange a pointer to an element to a pointer to
// its corresponding sidecar.
void* GetSidecar(BaseElementType* element) {
« no previous file with comments | « cc/base/list_container.cc ('k') | cc/base/sidecar_list_container_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698