Index: content/renderer/render_widget.cc |
diff --git a/content/renderer/render_widget.cc b/content/renderer/render_widget.cc |
index f5f43f07028bb43d883919571d84b0d52a50c28c..6a4442fa9cb31bf7e7676f129c07fdb42836a797 100644 |
--- a/content/renderer/render_widget.cc |
+++ b/content/renderer/render_widget.cc |
@@ -378,6 +378,7 @@ RenderWidget::RenderWidget(int32_t widget_routing_id, |
focused_pepper_plugin_(nullptr), |
time_to_first_active_paint_recorded_(true), |
was_shown_time_(base::TimeTicks::Now()), |
+ current_content_source_id_(0), |
weak_ptr_factory_(this) { |
DCHECK_NE(routing_id_, MSG_ROUTING_NONE); |
if (!swapped_out) |
@@ -1286,6 +1287,7 @@ blink::WebLayerTreeView* RenderWidget::initializeLayerTreeView() { |
compositor_->setViewportSize(physical_backing_size_); |
OnDeviceScaleFactorChanged(); |
compositor_->SetDeviceColorSpace(screen_info_.icc_profile.GetColorSpace()); |
+ compositor_->SetContentSourceId(current_content_source_id_); |
// For background pages and certain tests, we don't want to trigger |
// CompositorFrameSink creation. |
if (compositor_never_visible_ || !RenderThreadImpl::current()) |
@@ -2300,6 +2302,15 @@ void RenderWidget::startDragging(blink::WebReferrerPolicy policy, |
possible_drag_event_info_)); |
} |
+uint32_t RenderWidget::GetContentSourceId() { |
+ return current_content_source_id_; |
+} |
+ |
+void RenderWidget::IncrementContentSourceId() { |
+ if (compositor_) |
+ compositor_->SetContentSourceId(++current_content_source_id_); |
+} |
+ |
blink::WebWidget* RenderWidget::GetWebWidget() const { |
return webwidget_internal_; |
} |