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

Unified Diff: Source/platform/graphics/paint/DisplayItems.cpp

Issue 1157653005: Move use of DisplayItemList's vector behind an explicit DisplayItems interface. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: DisplayItems must be noncopyable (Windows build fix) Created 5 years, 6 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
Index: Source/platform/graphics/paint/DisplayItems.cpp
diff --git a/Source/platform/graphics/paint/DisplayItems.cpp b/Source/platform/graphics/paint/DisplayItems.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..78c940dd9fbb388db8aafa2f38485e799f974a76
--- /dev/null
+++ b/Source/platform/graphics/paint/DisplayItems.cpp
@@ -0,0 +1,50 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "config.h"
+#include "platform/graphics/paint/DisplayItems.h"
+
+namespace blink {
+
+DisplayItems::DisplayItems()
+{
+}
+
+DisplayItems::~DisplayItems()
+{
+}
+
+void DisplayItems::append(PassOwnPtr<DisplayItem> displayItem)
+{
+ m_items.append(displayItem);
+}
+
+void DisplayItems::appendByMoving(const Iterator& it)
+{
+ // Release the underlying OwnPtr to move the display item ownership.
+ ASSERT(!it->isGone());
+ append(it.m_iterator->release());
+}
+
+void DisplayItems::removeLast()
+{
+ m_items.removeLast();
+}
+
+void DisplayItems::clear()
+{
+ m_items.clear();
+}
+
+void DisplayItems::swap(DisplayItems& other)
+{
+ m_items.swap(other.m_items);
+}
+
+void DisplayItems::setGone(const Iterator& it)
+{
+ it.m_iterator->clear();
+}
+
+} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698