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

Unified Diff: cc/layer_impl.cc

Issue 11418108: cc: Make the ScopedPtrVector and ScopedPtrDeque containers act like STL vector and deque. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: android!! Created 7 years, 11 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/layer_animation_controller.cc ('k') | cc/layer_tree_host_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/layer_impl.cc
diff --git a/cc/layer_impl.cc b/cc/layer_impl.cc
index c588fe287926e2e736801cb71a652b673b7f3179..f036c0146430ade3cf1a5e74ba7bea44cc05834a 100644
--- a/cc/layer_impl.cc
+++ b/cc/layer_impl.cc
@@ -74,16 +74,16 @@ void LayerImpl::addChild(scoped_ptr<LayerImpl> child)
{
child->setParent(this);
DCHECK_EQ(layerTreeImpl(), child->layerTreeImpl());
- m_children.append(child.Pass());
+ m_children.push_back(child.Pass());
layerTreeImpl()->SetNeedsUpdateDrawProperties();
}
scoped_ptr<LayerImpl> LayerImpl::removeChild(LayerImpl* child)
{
- for (size_t i = 0; i < m_children.size(); ++i) {
- if (m_children[i] == child) {
- scoped_ptr<LayerImpl> ret = m_children.take(i);
- m_children.remove(i);
+ for (ScopedPtrVector<LayerImpl>::iterator it = m_children.begin(); it != m_children.end(); ++it) {
+ if (*it == child) {
+ scoped_ptr<LayerImpl> ret = m_children.take(it);
+ m_children.erase(it);
layerTreeImpl()->SetNeedsUpdateDrawProperties();
return ret.Pass();
}
@@ -99,7 +99,7 @@ void LayerImpl::removeAllChildren()
void LayerImpl::clearChildList()
{
- if (m_children.isEmpty())
+ if (m_children.empty())
return;
m_children.clear();
« no previous file with comments | « cc/layer_animation_controller.cc ('k') | cc/layer_tree_host_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698