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

Side by Side Diff: cc/trees/layer_tree_impl.cc

Issue 2897703002: DCHECK that property tree access is safe in LayerTreeImpl::DidUpdateScrollState (Closed)
Patch Set: Created 3 years, 7 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 unified diff | Download patch
« no previous file with comments | « cc/test/push_properties_counting_layer_impl.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2011 The Chromium Authors. All rights reserved. 1 // Copyright 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "cc/trees/layer_tree_impl.h" 5 #include "cc/trees/layer_tree_impl.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <algorithm> 10 #include <algorithm>
(...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after
200 } 200 }
201 201
202 if (IsActiveTree() && layer_tree_host_impl_->pending_tree()) 202 if (IsActiveTree() && layer_tree_host_impl_->pending_tree())
203 layer_tree_host_impl_->pending_tree()->DidUpdateScrollOffset(layer_id); 203 layer_tree_host_impl_->pending_tree()->DidUpdateScrollOffset(layer_id);
204 } 204 }
205 205
206 void LayerTreeImpl::DidUpdateScrollState(int layer_id) { 206 void LayerTreeImpl::DidUpdateScrollState(int layer_id) {
207 if (!IsActiveTree()) 207 if (!IsActiveTree())
208 return; 208 return;
209 209
210 DCHECK(lifecycle().AllowsPropertyTreeAccess());
211
210 // The scroll_clip_layer Layer properties should be up-to-date. 212 // The scroll_clip_layer Layer properties should be up-to-date.
211 // TODO(pdr): This DCHECK fails on existing tests but should be enabled. 213 // TODO(pdr): This DCHECK fails on existing tests but should be enabled.
212 // DCHECK(lifecycle().AllowsLayerPropertyAccess()); 214 // DCHECK(lifecycle().AllowsLayerPropertyAccess());
213 215
214 if (layer_id == Layer::INVALID_ID) 216 if (layer_id == Layer::INVALID_ID)
215 return; 217 return;
216 218
217 int scroll_layer_id, clip_layer_id; 219 int scroll_layer_id, clip_layer_id;
218 if (IsViewportLayerId(layer_id)) { 220 if (IsViewportLayerId(layer_id)) {
219 if (!InnerViewportContainerLayer()) 221 if (!InnerViewportContainerLayer())
(...skipping 1881 matching lines...) Expand 10 before | Expand all | Expand 10 after
2101 2103
2102 void LayerTreeImpl::ResetAllChangeTracking() { 2104 void LayerTreeImpl::ResetAllChangeTracking() {
2103 layers_that_should_push_properties_.clear(); 2105 layers_that_should_push_properties_.clear();
2104 // Iterate over all layers, including masks. 2106 // Iterate over all layers, including masks.
2105 for (auto& layer : *layers_) 2107 for (auto& layer : *layers_)
2106 layer->ResetChangeTracking(); 2108 layer->ResetChangeTracking();
2107 property_trees_.ResetAllChangeTracking(); 2109 property_trees_.ResetAllChangeTracking();
2108 } 2110 }
2109 2111
2110 } // namespace cc 2112 } // namespace cc
OLDNEW
« no previous file with comments | « cc/test/push_properties_counting_layer_impl.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698