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

Unified Diff: cc/trees/layer_tree_host.cc

Issue 2707243005: Discard compositor frames from unloaded web content (Closed)
Patch Set: Review comment addressed Created 3 years, 10 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
Index: cc/trees/layer_tree_host.cc
diff --git a/cc/trees/layer_tree_host.cc b/cc/trees/layer_tree_host.cc
index c0425180ad777b2a0bfe41e6dda4852e1f7b20a1..2203ab25bd24f4374009f2e759e7ae1b20f6bf8a 100644
--- a/cc/trees/layer_tree_host.cc
+++ b/cc/trees/layer_tree_host.cc
@@ -101,6 +101,7 @@ LayerTreeHost::LayerTreeHost(InitParams* params, CompositorMode mode)
debug_state_(settings_.initial_debug_state),
id_(s_layer_tree_host_sequence_number.GetNext() + 1),
task_graph_runner_(params->task_graph_runner),
+ content_source_id_(0),
event_listener_properties_(),
mutator_host_(params->mutator_host),
image_worker_task_runner_(params->image_worker_task_runner) {
@@ -961,6 +962,13 @@ void LayerTreeHost::SetDeviceColorSpace(
this, [](Layer* layer) { layer->SetNeedsDisplay(); });
}
+void LayerTreeHost::SetContentSourceId(uint32_t id) {
+ if (content_source_id_ == id)
+ return;
+ content_source_id_ = id;
+ SetNeedsCommit();
+}
+
void LayerTreeHost::RegisterLayer(Layer* layer) {
DCHECK(!LayerById(layer->id()));
DCHECK(!in_paint_layer_contents_);
@@ -1131,6 +1139,8 @@ void LayerTreeHost::PushPropertiesTo(LayerTreeImpl* tree_impl) {
tree_impl->SetDeviceColorSpace(device_color_space_);
+ tree_impl->set_content_source_id(content_source_id_);
+
if (pending_page_scale_animation_) {
tree_impl->SetPendingPageScaleAnimation(
std::move(pending_page_scale_animation_));

Powered by Google App Engine
This is Rietveld 408576698