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

Unified Diff: cc/layer.cc

Issue 11377108: [cc] Fix crash when adding a child layer to its own parent. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address review comments Created 8 years, 1 month 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/layer_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/layer.cc
diff --git a/cc/layer.cc b/cc/layer.cc
index 29fe62a8bfa0b955ca2ced34595e9b4de3e93edb..afc8627ad87fdc50b8e3a466fc3762d168eae5da 100644
--- a/cc/layer.cc
+++ b/cc/layer.cc
@@ -155,11 +155,11 @@ void Layer::addChild(scoped_refptr<Layer> child)
void Layer::insertChild(scoped_refptr<Layer> child, size_t index)
{
- index = min(index, m_children.size());
child->removeFromParent();
child->setParent(this);
child->m_stackingOrderChanged = true;
+ index = min(index, m_children.size());
LayerList::iterator iter = m_children.begin();
m_children.insert(iter + index, child);
setNeedsCommit();
« no previous file with comments | « no previous file | cc/layer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698