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

Unified Diff: cc/trees/layer_tree_host.cc

Issue 1232573005: cc: Make sure we don't insert or remove layers during painting (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Re-use in_paint_layer_contents_ Created 5 years, 5 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/trees/layer_tree_host.cc
diff --git a/cc/trees/layer_tree_host.cc b/cc/trees/layer_tree_host.cc
index 918d5db58fc8c1d738e4e025f2985a9b896f10b9..a348301ba491ab61d294993414c74ce821727448 100644
--- a/cc/trees/layer_tree_host.cc
+++ b/cc/trees/layer_tree_host.cc
@@ -1096,6 +1096,7 @@ Layer* LayerTreeHost::LayerById(int id) const {
void LayerTreeHost::RegisterLayer(Layer* layer) {
DCHECK(!LayerById(layer->id()));
+ DCHECK(!in_paint_layer_contents_);
layer_id_map_[layer->id()] = layer;
if (animation_host_)
animation_host_->RegisterLayer(layer->id(), LayerTreeType::ACTIVE);
@@ -1103,6 +1104,7 @@ void LayerTreeHost::RegisterLayer(Layer* layer) {
void LayerTreeHost::UnregisterLayer(Layer* layer) {
DCHECK(LayerById(layer->id()));
+ DCHECK(!in_paint_layer_contents_);
if (animation_host_)
animation_host_->UnregisterLayer(layer->id(), LayerTreeType::ACTIVE);
layer_id_map_.erase(layer->id());
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698