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

Unified Diff: cc/trees/layer_tree_impl.cc

Issue 2100353002: cc: DCHECK that the OutputSurface was released in ~LayerTreeHostImpl(). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: released-outputsurface: . 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/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(); });

Powered by Google App Engine
This is Rietveld 408576698