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

Unified Diff: cc/layers/layer_impl.cc

Issue 2043963005: cc : Make LayerImpl destruction independent of tree hierarchy (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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: cc/layers/layer_impl.cc
diff --git a/cc/layers/layer_impl.cc b/cc/layers/layer_impl.cc
index 407449d774176c40a69ec524808bbb5d3ea21e35..98ea697d2e0c6c0ea4a3e8d3380bf06cb5467e9a 100644
--- a/cc/layers/layer_impl.cc
+++ b/cc/layers/layer_impl.cc
@@ -108,7 +108,7 @@ LayerImpl::~LayerImpl() {
layer_tree_impl_->RemoveLayer(mask_layer_id_);
if (replica_layer_)
layer_tree_impl_->RemoveLayer(replica_layer_id_);
ajuma 2016/06/07 23:25:36 Since masks and replicas are part of layers_ in La
jaydasika 2016/06/08 00:17:37 I din't understand that fully. masks and replicas
jaydasika 2016/06/08 00:49:32 Scratch my previous comment, I understand what you
ajuma 2016/06/08 13:48:02 That's a good point about destruction order -- eve
jaydasika 2016/06/08 16:29:30 I agree that there is no guarantee about destructi
ajuma 2016/06/08 16:40:45 Ah, got it, that makes sense.
- ClearChildList();
+ children_.clear();
}
void LayerImpl::AddChild(std::unique_ptr<LayerImpl> child) {
@@ -130,14 +130,6 @@ void LayerImpl::SetParent(LayerImpl* parent) {
parent_ = parent;
}
-void LayerImpl::ClearChildList() {
- if (children_.empty())
- return;
- for (auto* child : children_)
- layer_tree_impl_->RemoveLayer(child->id());
- children_.clear();
-}
-
void LayerImpl::ClearLinksToOtherLayers() {
children_.clear();
mask_layer_ = nullptr;

Powered by Google App Engine
This is Rietveld 408576698