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

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: rebase-on-2106273002 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
« no previous file with comments | « cc/trees/layer_tree_host_impl_unittest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/trees/layer_tree_impl.cc
diff --git a/cc/trees/layer_tree_impl.cc b/cc/trees/layer_tree_impl.cc
index a3820cadf48c430da188832506f1aaff16456963..037838da3784c913aba9a050c315bb12888dfb1d 100644
--- a/cc/trees/layer_tree_impl.cc
+++ b/cc/trees/layer_tree_impl.cc
@@ -100,6 +100,17 @@ 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
+ // layer list afterward.
+ LayerListIterator<LayerImpl> it(root_layer_for_testing_);
+ size_t i = 0;
+ for (; it != LayerListIterator<LayerImpl>(nullptr); ++it, ++i) {
+ DCHECK_LT(i, layer_list_.size());
+ DCHECK_EQ(layer_list_[i], *it);
+ }
+#endif
+
if (!LayerListIsEmpty()) {
LayerTreeHostCommon::CallFunctionForEveryLayer(
this, [](LayerImpl* layer) { layer->ReleaseResources(); });
« no previous file with comments | « cc/trees/layer_tree_host_impl_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698