Index: cc/trees/layer_tree_impl.cc |
diff --git a/cc/trees/layer_tree_impl.cc b/cc/trees/layer_tree_impl.cc |
index c39359ae73e2cd33bd8fcf55b94150afc51c9069..3d0b9d9e3a7c976c977b72962178817f5e128f91 100644 |
--- a/cc/trees/layer_tree_impl.cc |
+++ b/cc/trees/layer_tree_impl.cc |
@@ -100,6 +100,18 @@ void LayerTreeImpl::Shutdown() { |
} |
void LayerTreeImpl::ReleaseResources() { |
+#if DCHECK_IS_ON() |
+ // These DCHECKs catch tests that add layers to the tree but fail to build the |
enne (OOO)
2016/06/27 22:22:20
Nice!
|
+ // layer list afterward. |
+ LayerListIterator<LayerImpl> it(root_layer_); |
+ size_t i = 0; |
+ for (; it != LayerListIterator<LayerImpl>(nullptr); ++it, ++i) { |
+ DCHECK_LT(i, layer_list_.size()); |
+ DCHECK_EQ(layer_list_[i], *it); |
+ } |
+#endif |
+ |
+ DCHECK_EQ(!root_layer_, LayerListIsEmpty()); |
if (!LayerListIsEmpty()) { |
LayerTreeHostCommon::CallFunctionForEveryLayer( |
this, [](LayerImpl* layer) { layer->ReleaseResources(); }); |