| OLD | NEW |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 #include "content/browser/renderer_host/frame_sink_provider_impl.h" | 4 #include "content/browser/renderer_host/frame_sink_provider_impl.h" |
| 5 #include "content/browser/renderer_host/render_widget_host_impl.h" | 5 #include "content/browser/renderer_host/render_widget_host_impl.h" |
| 6 | 6 |
| 7 namespace content { | 7 namespace content { |
| 8 | 8 |
| 9 FrameSinkProviderImpl::FrameSinkProviderImpl(int32_t process_id) | 9 FrameSinkProviderImpl::FrameSinkProviderImpl(int32_t process_id) |
| 10 : process_id_(process_id), binding_(this) {} | 10 : process_id_(process_id), binding_(this) {} |
| 11 | 11 |
| 12 FrameSinkProviderImpl::~FrameSinkProviderImpl() = default; | 12 FrameSinkProviderImpl::~FrameSinkProviderImpl() = default; |
| 13 | 13 |
| 14 void FrameSinkProviderImpl::Bind(mojom::FrameSinkProviderRequest request) { | 14 void FrameSinkProviderImpl::Bind(mojom::FrameSinkProviderRequest request) { |
| 15 if (binding_.is_bound()) { | 15 if (binding_.is_bound()) { |
| 16 DLOG(ERROR) << "Received multiple requests for FrameSinkProvider. " | 16 DLOG(ERROR) << "Received multiple requests for FrameSinkProvider. " |
| 17 << "There should be only one instance per renderer."; | 17 << "There should be only one instance per renderer."; |
| 18 return; | 18 return; |
| 19 } | 19 } |
| 20 binding_.Bind(std::move(request)); | 20 binding_.Bind(std::move(request)); |
| 21 } | 21 } |
| 22 | 22 |
| 23 void FrameSinkProviderImpl::Unbind() { | 23 void FrameSinkProviderImpl::Unbind() { |
| 24 binding_.Close(); | 24 binding_.Close(); |
| 25 } | 25 } |
| 26 | 26 |
| 27 void FrameSinkProviderImpl::CreateForWidget( | 27 void FrameSinkProviderImpl::CreateForWidget( |
| 28 int32_t widget_id, | 28 int32_t widget_id, |
| 29 viz::mojom::CompositorFrameSinkRequest request, | 29 viz::mojom::CompositorFrameSinkRequest request, |
| 30 viz::mojom::CompositorFrameSinkClientPtr client) { | 30 viz::mojom::CompositorFrameSinkClientPtr client, |
| 31 viz::mojom::TargetFrameForInputDelegatePtr input_delegate) { |
| 31 RenderWidgetHostImpl* render_widget_host_impl = | 32 RenderWidgetHostImpl* render_widget_host_impl = |
| 32 RenderWidgetHostImpl::FromID(process_id_, widget_id); | 33 RenderWidgetHostImpl::FromID(process_id_, widget_id); |
| 33 if (!render_widget_host_impl) { | 34 if (!render_widget_host_impl) { |
| 34 DLOG(ERROR) << "No RenderWidgetHost exists with id " << widget_id | 35 DLOG(ERROR) << "No RenderWidgetHost exists with id " << widget_id |
| 35 << "in process " << process_id_; | 36 << "in process " << process_id_; |
| 36 return; | 37 return; |
| 37 } | 38 } |
| 38 render_widget_host_impl->RequestCompositorFrameSink(std::move(request), | 39 render_widget_host_impl->RequestCompositorFrameSink( |
| 39 std::move(client)); | 40 std::move(request), std::move(client), std::move(input_delegate)); |
| 40 } | 41 } |
| 41 | 42 |
| 42 } // namespace content | 43 } // namespace content |
| OLD | NEW |