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

Unified Diff: cc/trees/tree_synchronizer.cc

Issue 572353003: Fix RemoveFromScrollTree and RemoveFromClipTree (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2125
Patch Set: Created 6 years, 3 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/layers/layer_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/tree_synchronizer.cc
diff --git a/cc/trees/tree_synchronizer.cc b/cc/trees/tree_synchronizer.cc
index a54bd22efa1b79a8b7f29a205a488308effdd900..1faf0e04e679d468b91ab49ef5e209794d8abea5 100644
--- a/cc/trees/tree_synchronizer.cc
+++ b/cc/trees/tree_synchronizer.cc
@@ -242,16 +242,23 @@ static void CheckScrollAndClipPointersRecursive(Layer* layer,
if (!layer)
return;
- DCHECK_EQ(!!layer->scroll_parent(), !!layer_impl->scroll_parent());
- if (layer->scroll_parent())
+ // Having a scroll parent on the impl thread implies having one the main
+ // thread, too. The main thread may have a scroll parent that is not in the
+ // tree because it's been removed but not deleted. In this case, the layer
+ // impl will have no scroll parent. Same argument applies for clip parents and
+ // scroll/clip children.
+ DCHECK(!layer_impl->scroll_parent() || !!layer->scroll_parent());
+ DCHECK(!layer_impl->clip_parent() || !!layer->clip_parent());
+ DCHECK(!layer_impl->scroll_children() || !!layer->scroll_children());
+ DCHECK(!layer_impl->clip_children() || !!layer->clip_children());
+
+ if (layer_impl->scroll_parent())
DCHECK_EQ(layer->scroll_parent()->id(), layer_impl->scroll_parent()->id());
- DCHECK_EQ(!!layer->clip_parent(), !!layer_impl->clip_parent());
- if (layer->clip_parent())
+ if (layer_impl->clip_parent())
DCHECK_EQ(layer->clip_parent()->id(), layer_impl->clip_parent()->id());
- DCHECK_EQ(!!layer->scroll_children(), !!layer_impl->scroll_children());
- if (layer->scroll_children()) {
+ if (layer_impl->scroll_children()) {
for (std::set<Layer*>::iterator it = layer->scroll_children()->begin();
it != layer->scroll_children()->end();
++it) {
@@ -265,8 +272,7 @@ static void CheckScrollAndClipPointersRecursive(Layer* layer,
}
}
- DCHECK_EQ(!!layer->clip_children(), !!layer_impl->clip_children());
- if (layer->clip_children()) {
+ if (layer_impl->clip_children()) {
for (std::set<Layer*>::iterator it = layer->clip_children()->begin();
it != layer->clip_children()->end();
++it) {
« no previous file with comments | « cc/layers/layer_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698