Skip to content

Commit

Permalink
DCHECK that property tree access is safe in LayerTreeImpl::DidUpdateS…
Browse files Browse the repository at this point in the history
…crollState

This patch adds a DCHECK in LayerTreeImpl::DidUpdateScrollState that property
trees are synced and can be used. This required changing
PushPropertiesCountingLayerImpl to not call SetBounds in the ctor which was
not actually needed because the value would get synced.

This patch doesn't change behavior and just prepares for a future patch
which will use the scroll property tree to look up a LayerImpl's
scroll bounds instead of accessing this through scroll_clip_layer (e.g.,
clip_size in LayerTreeImpl::UpdateScrollbars).

BUG=723263
CQ_INCLUDE_TRYBOTS=master.tryserver.blink:linux_trusty_blink_rel

Review-Url: https://codereview.chromium.org/2897703002
Cr-Commit-Position: refs/heads/master@{#473320}
  • Loading branch information
progers authored and Commit bot committed May 19, 2017
1 parent d4b0825 commit bf7130d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 1 addition & 3 deletions cc/test/push_properties_counting_layer_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,7 @@ PushPropertiesCountingLayerImpl::Create(LayerTreeImpl* tree_impl, int id) {
PushPropertiesCountingLayerImpl::PushPropertiesCountingLayerImpl(
LayerTreeImpl* tree_impl,
int id)
: LayerImpl(tree_impl, id), push_properties_count_(0) {
SetBounds(gfx::Size(1, 1));
}
: LayerImpl(tree_impl, id), push_properties_count_(0) {}

PushPropertiesCountingLayerImpl::~PushPropertiesCountingLayerImpl() = default;

Expand Down
2 changes: 2 additions & 0 deletions cc/trees/layer_tree_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,8 @@ void LayerTreeImpl::DidUpdateScrollState(int layer_id) {
if (!IsActiveTree())
return;

DCHECK(lifecycle().AllowsPropertyTreeAccess());

// The scroll_clip_layer Layer properties should be up-to-date.
// TODO(pdr): This DCHECK fails on existing tests but should be enabled.
// DCHECK(lifecycle().AllowsLayerPropertyAccess());
Expand Down

0 comments on commit bf7130d

Please sign in to comment.