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

Unified Diff: cc/trees/layer_tree_host.cc

Issue 2707243005: Discard compositor frames from unloaded web content (Closed)
Patch Set: Add default value for source ID in frame metadata Created 3 years, 9 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 | « cc/trees/layer_tree_host.h ('k') | cc/trees/layer_tree_host_impl.cc » ('j') | 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 4ad7918622b191898a79b32db5be3317e764f434..942d593868124b3593d8cd735d965cd939c8f069 100644
--- a/cc/trees/layer_tree_host.cc
+++ b/cc/trees/layer_tree_host.cc
@@ -104,6 +104,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) {
DCHECK(task_graph_runner_);
@@ -972,6 +973,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_);
@@ -1142,6 +1150,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_));
« no previous file with comments | « cc/trees/layer_tree_host.h ('k') | cc/trees/layer_tree_host_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698