| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 | 4 |
| 5 #include "services/ui/surfaces/gpu_compositor_frame_sink.h" | 5 #include "services/ui/surfaces/gpu_compositor_frame_sink.h" |
| 6 | 6 |
| 7 #include "services/ui/surfaces/display_compositor.h" | 7 #include "services/ui/surfaces/display_compositor.h" |
| 8 | 8 |
| 9 namespace ui { | 9 namespace ui { |
| 10 | 10 |
| 11 GpuCompositorFrameSink::GpuCompositorFrameSink( | 11 GpuCompositorFrameSink::GpuCompositorFrameSink( |
| 12 DisplayCompositor* display_compositor, | 12 DisplayCompositor* display_compositor, |
| 13 const cc::FrameSinkId& frame_sink_id, | 13 const cc::FrameSinkId& frame_sink_id, |
| 14 std::unique_ptr<cc::Display> display, | 14 std::unique_ptr<cc::Display> display, |
| 15 std::unique_ptr<cc::BeginFrameSource> begin_frame_source, |
| 15 cc::mojom::MojoCompositorFrameSinkRequest request, | 16 cc::mojom::MojoCompositorFrameSinkRequest request, |
| 16 cc::mojom::MojoCompositorFrameSinkPrivateRequest private_request, | 17 cc::mojom::MojoCompositorFrameSinkPrivateRequest private_request, |
| 17 cc::mojom::MojoCompositorFrameSinkClientPtr client) | 18 cc::mojom::MojoCompositorFrameSinkClientPtr client) |
| 18 : display_compositor_(display_compositor), | 19 : display_compositor_(display_compositor), |
| 19 support_(this, | 20 support_(this, |
| 20 display_compositor->manager(), | 21 display_compositor->manager(), |
| 21 frame_sink_id, | 22 frame_sink_id, |
| 22 std::move(display)), | 23 std::move(display), |
| 24 std::move(begin_frame_source)), |
| 23 client_(std::move(client)), | 25 client_(std::move(client)), |
| 24 binding_(this, std::move(request)), | 26 binding_(this, std::move(request)), |
| 25 private_binding_(this, std::move(private_request)) { | 27 private_binding_(this, std::move(private_request)) { |
| 26 binding_.set_connection_error_handler(base::Bind( | 28 binding_.set_connection_error_handler(base::Bind( |
| 27 &GpuCompositorFrameSink::OnClientConnectionLost, base::Unretained(this))); | 29 &GpuCompositorFrameSink::OnClientConnectionLost, base::Unretained(this))); |
| 28 | 30 |
| 29 private_binding_.set_connection_error_handler( | 31 private_binding_.set_connection_error_handler( |
| 30 base::Bind(&GpuCompositorFrameSink::OnPrivateConnectionLost, | 32 base::Bind(&GpuCompositorFrameSink::OnPrivateConnectionLost, |
| 31 base::Unretained(this))); | 33 base::Unretained(this))); |
| 32 } | 34 } |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 105 } | 107 } |
| 106 | 108 |
| 107 void GpuCompositorFrameSink::OnPrivateConnectionLost() { | 109 void GpuCompositorFrameSink::OnPrivateConnectionLost() { |
| 108 private_connection_lost_ = true; | 110 private_connection_lost_ = true; |
| 109 // Request destruction of |this| only if both connections are lost. | 111 // Request destruction of |this| only if both connections are lost. |
| 110 display_compositor_->OnCompositorFrameSinkPrivateConnectionLost( | 112 display_compositor_->OnCompositorFrameSinkPrivateConnectionLost( |
| 111 support_.frame_sink_id(), client_connection_lost_); | 113 support_.frame_sink_id(), client_connection_lost_); |
| 112 } | 114 } |
| 113 | 115 |
| 114 } // namespace ui | 116 } // namespace ui |
| OLD | NEW |