Index: cc/trees/property_tree.h |
diff --git a/cc/trees/property_tree.h b/cc/trees/property_tree.h |
index 601cbaf2f74d77f52e744ff0a075d93fd59b904c..915efb8ea5a462ac5a1f4d5d700b14d9a57eafa2 100644 |
--- a/cc/trees/property_tree.h |
+++ b/cc/trees/property_tree.h |
@@ -104,6 +104,9 @@ class CC_EXPORT PropertyTree { |
return Node(FindNodeIndexFromOwningLayerId(id)); |
} |
T* UpdateNodeFromOwningLayerId(int id) { |
+#if DCHECK_IS_ON() |
+ DCHECK(LookupByOnwningLayerIdAllowed()); |
+#endif |
int index = FindNodeIndexFromOwningLayerId(id); |
if (index == kInvalidNodeId) { |
DCHECK(property_trees()->is_main_thread); |
@@ -114,6 +117,9 @@ class CC_EXPORT PropertyTree { |
} |
int FindNodeIndexFromOwningLayerId(int id) const { |
+#if DCHECK_IS_ON() |
+ DCHECK(LookupByOnwningLayerIdAllowed()); |
+#endif |
auto iter = owning_layer_id_to_node_index_.find(id); |
if (iter == owning_layer_id_to_node_index_.end()) |
return kInvalidNodeId; |
@@ -122,6 +128,9 @@ class CC_EXPORT PropertyTree { |
} |
void SetOwningLayerIdForNode(const T* node, int id) { |
+#if DCHECK_IS_ON() |
+ DCHECK(LookupByOnwningLayerIdAllowed()); |
+#endif |
if (!node) { |
owning_layer_id_to_node_index_[id] = kInvalidNodeId; |
return; |
@@ -131,6 +140,11 @@ class CC_EXPORT PropertyTree { |
owning_layer_id_to_node_index_[id] = node->id; |
} |
+ protected: |
+#if DCHECK_IS_ON() |
+ virtual bool LookupByOnwningLayerIdAllowed() const { return true; } |
+#endif |
+ |
private: |
std::vector<T> nodes_; |
@@ -409,6 +423,11 @@ class CC_EXPORT EffectTree final : public PropertyTree<EffectNode> { |
std::vector<std::unique_ptr<RenderSurfaceImpl>>* old_render_surfaces, |
LayerTreeImpl* layer_tree_impl); |
+ protected: |
+#if DCHECK_IS_ON() |
+ bool LookupByOnwningLayerIdAllowed() const override; |
+#endif |
+ |
private: |
void UpdateOpacities(EffectNode* node, EffectNode* parent_node); |
void UpdateIsDrawn(EffectNode* node, EffectNode* parent_node); |
@@ -647,7 +666,7 @@ class CC_EXPORT PropertyTrees final { |
base::flat_map<ElementId, int> element_id_to_scroll_node_index; |
base::flat_map<ElementId, int> element_id_to_transform_node_index; |
- std::vector<int> always_use_active_tree_opacity_effect_ids; |
+ std::vector<ElementId> always_use_active_tree_opacity_effect_ids; |
TransformTree transform_tree; |
EffectTree effect_tree; |
ClipTree clip_tree; |