Chromium Code Reviews| Index: services/ui/ws/compositor_frame_sink_client_binding.h |
| diff --git a/services/ui/ws/compositor_frame_sink_client_binding.h b/services/ui/ws/compositor_frame_sink_client_binding.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..5d455841c59792c7dae137b7fcea57e4f3618288 |
| --- /dev/null |
| +++ b/services/ui/ws/compositor_frame_sink_client_binding.h |
| @@ -0,0 +1,51 @@ |
| +// Copyright 2017 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef SERVICES_UI_WS_COMPOSITOR_FRAME_SINK_CLIENT_BINDING_H_ |
|
Fady Samuel
2017/05/19 14:21:51
Rename file to compositor_frame_sink_binding.h
Alex Z.
2017/05/19 14:25:23
I followed the naming convention from WindowTreeBi
|
| +#define SERVICES_UI_WS_COMPOSITOR_FRAME_SINK_CLIENT_BINDING_H_ |
| + |
| +#include "base/macros.h" |
| +#include "cc/ipc/frame_sink_manager.mojom.h" |
| +#include "cc/ipc/mojo_compositor_frame_sink.mojom.h" |
| +#include "cc/surfaces/local_surface_id_allocator.h" |
| +#include "mojo/public/cpp/bindings/binding.h" |
| + |
| +namespace ui { |
| +namespace ws { |
| + |
| +// CompositorFrameSinkClientBinding manages the binding between a FrameGenerator |
| +// and its MojoCompositorFrameSink. CompositorFrameSinkClientBinding exists so |
| +// that a mock implementation of MojoCompositorFrameSink can be injected for |
| +// tests. FrameGenerator owns its associated CompositorFrameSinkClientBinding. |
| +class CompositorFrameSinkClientBinding |
|
Fady Samuel
2017/05/19 14:21:51
nit: CompositorFrameSinkClientBinding => Compsitor
|
| + : public cc::mojom::MojoCompositorFrameSink { |
| + public: |
| + CompositorFrameSinkClientBinding( |
| + cc::mojom::MojoCompositorFrameSinkClient* sink_client, |
| + cc::mojom::MojoCompositorFrameSinkClientRequest sink_client_request, |
| + cc::mojom::MojoCompositorFrameSinkAssociatedPtr compositor_frame_sink, |
| + cc::mojom::DisplayPrivateAssociatedPtr display_private); |
| + ~CompositorFrameSinkClientBinding() override; |
| + |
| + private: |
| + // cc::mojom::MojoCompositorFrameSink implementation: |
| + void SubmitCompositorFrame(const cc::LocalSurfaceId& local_surface_id, |
| + cc::CompositorFrame frame) override; |
| + void SetNeedsBeginFrame(bool needs_begin_frame) override; |
| + void BeginFrameDidNotSwap(const cc::BeginFrameAck& ack) override; |
| + void EvictCurrentSurface() override; |
| + |
| + mojo::Binding<cc::mojom::MojoCompositorFrameSinkClient> binding_; |
| + cc::mojom::DisplayPrivateAssociatedPtr display_private_; |
| + cc::mojom::MojoCompositorFrameSinkAssociatedPtr compositor_frame_sink_; |
| + cc::LocalSurfaceId local_surface_id_; |
| + cc::LocalSurfaceIdAllocator id_allocator_; |
| + gfx::Size last_submitted_frame_size_; |
| + |
| + DISALLOW_COPY_AND_ASSIGN(CompositorFrameSinkClientBinding); |
| +}; |
| +} |
| +} |
| + |
| +#endif // SERVICES_UI_WS_COMPOSITOR_FRAME_SINK_CLIENT_BINDING_H_ |