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

Side by Side Diff: cc/test/push_properties_counting_layer_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 | « no previous file | cc/trees/layer_tree_impl.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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/test/push_properties_counting_layer_impl.h" 5 #include "cc/test/push_properties_counting_layer_impl.h"
6 6
7 namespace cc { 7 namespace cc {
8 8
9 // static 9 // static
10 std::unique_ptr<PushPropertiesCountingLayerImpl> 10 std::unique_ptr<PushPropertiesCountingLayerImpl>
11 PushPropertiesCountingLayerImpl::Create(LayerTreeImpl* tree_impl, int id) { 11 PushPropertiesCountingLayerImpl::Create(LayerTreeImpl* tree_impl, int id) {
12 return base::WrapUnique(new PushPropertiesCountingLayerImpl(tree_impl, id)); 12 return base::WrapUnique(new PushPropertiesCountingLayerImpl(tree_impl, id));
13 } 13 }
14 14
15 PushPropertiesCountingLayerImpl::PushPropertiesCountingLayerImpl( 15 PushPropertiesCountingLayerImpl::PushPropertiesCountingLayerImpl(
16 LayerTreeImpl* tree_impl, 16 LayerTreeImpl* tree_impl,
17 int id) 17 int id)
18 : LayerImpl(tree_impl, id), push_properties_count_(0) { 18 : LayerImpl(tree_impl, id), push_properties_count_(0) {}
19 SetBounds(gfx::Size(1, 1));
20 }
21 19
22 PushPropertiesCountingLayerImpl::~PushPropertiesCountingLayerImpl() = default; 20 PushPropertiesCountingLayerImpl::~PushPropertiesCountingLayerImpl() = default;
23 21
24 void PushPropertiesCountingLayerImpl::PushPropertiesTo(LayerImpl* layer) { 22 void PushPropertiesCountingLayerImpl::PushPropertiesTo(LayerImpl* layer) {
25 LayerImpl::PushPropertiesTo(layer); 23 LayerImpl::PushPropertiesTo(layer);
26 push_properties_count_++; 24 push_properties_count_++;
27 // Push state to the active tree because we can only access it from there. 25 // Push state to the active tree because we can only access it from there.
28 static_cast<PushPropertiesCountingLayerImpl*>(layer)->push_properties_count_ = 26 static_cast<PushPropertiesCountingLayerImpl*>(layer)->push_properties_count_ =
29 push_properties_count_; 27 push_properties_count_;
30 } 28 }
31 29
32 std::unique_ptr<LayerImpl> PushPropertiesCountingLayerImpl::CreateLayerImpl( 30 std::unique_ptr<LayerImpl> PushPropertiesCountingLayerImpl::CreateLayerImpl(
33 LayerTreeImpl* tree_impl) { 31 LayerTreeImpl* tree_impl) {
34 return PushPropertiesCountingLayerImpl::Create(tree_impl, LayerImpl::id()); 32 return PushPropertiesCountingLayerImpl::Create(tree_impl, LayerImpl::id());
35 } 33 }
36 34
37 } // namespace cc 35 } // namespace cc
OLDNEW
« no previous file with comments | « no previous file | cc/trees/layer_tree_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698