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 "components/mus/public/cpp/window_surface.h" | 5 #include "components/mus/public/cpp/window_surface.h" |
6 | 6 |
7 #include "base/memory/ptr_util.h" | 7 #include "base/memory/ptr_util.h" |
8 #include "components/mus/public/cpp/surfaces/surfaces_type_converters.h" | 8 #include "components/mus/public/cpp/surfaces/surfaces_type_converters.h" |
9 #include "components/mus/public/cpp/window_surface_client.h" | 9 #include "components/mus/public/cpp/window_surface_client.h" |
10 | 10 |
(...skipping 17 matching lines...) Expand all Loading... |
28 | 28 |
29 void WindowSurface::BindToThread() { | 29 void WindowSurface::BindToThread() { |
30 DCHECK(!thread_checker_); | 30 DCHECK(!thread_checker_); |
31 thread_checker_.reset(new base::ThreadChecker()); | 31 thread_checker_.reset(new base::ThreadChecker()); |
32 surface_.Bind(std::move(surface_info_)); | 32 surface_.Bind(std::move(surface_info_)); |
33 client_binding_.reset(new mojo::Binding<mojom::SurfaceClient>( | 33 client_binding_.reset(new mojo::Binding<mojom::SurfaceClient>( |
34 this, std::move(client_request_))); | 34 this, std::move(client_request_))); |
35 } | 35 } |
36 | 36 |
37 void WindowSurface::SubmitCompositorFrame(mojom::CompositorFramePtr frame, | 37 void WindowSurface::SubmitCompositorFrame(mojom::CompositorFramePtr frame, |
38 const base::Closure& callback) { | 38 const mojo::Closure& callback) { |
39 DCHECK(thread_checker_); | 39 DCHECK(thread_checker_); |
40 DCHECK(thread_checker_->CalledOnValidThread()); | 40 DCHECK(thread_checker_->CalledOnValidThread()); |
41 if (!surface_) | 41 if (!surface_) |
42 return; | 42 return; |
43 surface_->SubmitCompositorFrame(std::move(frame), callback); | 43 surface_->SubmitCompositorFrame(std::move(frame), callback); |
44 } | 44 } |
45 | 45 |
46 WindowSurface::WindowSurface( | 46 WindowSurface::WindowSurface( |
47 mojo::InterfacePtrInfo<mojom::Surface> surface_info, | 47 mojo::InterfacePtrInfo<mojom::Surface> surface_info, |
48 mojo::InterfaceRequest<mojom::SurfaceClient> client_request) | 48 mojo::InterfaceRequest<mojom::SurfaceClient> client_request) |
(...skipping 12 matching lines...) Expand all Loading... |
61 | 61 |
62 WindowSurfaceBinding::~WindowSurfaceBinding() {} | 62 WindowSurfaceBinding::~WindowSurfaceBinding() {} |
63 | 63 |
64 WindowSurfaceBinding::WindowSurfaceBinding( | 64 WindowSurfaceBinding::WindowSurfaceBinding( |
65 mojo::InterfaceRequest<mojom::Surface> surface_request, | 65 mojo::InterfaceRequest<mojom::Surface> surface_request, |
66 mojo::InterfacePtrInfo<mojom::SurfaceClient> surface_client) | 66 mojo::InterfacePtrInfo<mojom::SurfaceClient> surface_client) |
67 : surface_request_(std::move(surface_request)), | 67 : surface_request_(std::move(surface_request)), |
68 surface_client_(std::move(surface_client)) {} | 68 surface_client_(std::move(surface_client)) {} |
69 | 69 |
70 } // namespace mus | 70 } // namespace mus |
OLD | NEW |