Index: components/display_compositor/gpu_compositor_frame_sink_base.h |
diff --git a/components/display_compositor/gpu_compositor_frame_sink_base.h b/components/display_compositor/gpu_compositor_frame_sink_base.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..aa6b382c63b6eb84485445965fd64fd031cf2ce8 |
--- /dev/null |
+++ b/components/display_compositor/gpu_compositor_frame_sink_base.h |
@@ -0,0 +1,48 @@ |
+// 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 COMPONENTS_DISPLAY_COMPOSITOR_GPU_COMPOSITOR_FRAME_SINK_BASE_H_ |
+#define COMPONENTS_DISPLAY_COMPOSITOR_GPU_COMPOSITOR_FRAME_SINK_BASE_H_ |
+ |
+#include <memory> |
+#include <vector> |
+ |
+#include "base/macros.h" |
+#include "base/memory/weak_ptr.h" |
+#include "components/display_compositor/gpu_compositor_frame_sink.h" |
+#include "mojo/public/cpp/bindings/binding.h" |
+ |
+namespace display_compositor { |
+ |
+// Server side representation of a WindowSurface. |
+class DISPLAY_COMPOSITOR_EXPORT GpuCompositorFrameSinkBase |
+ : public GpuCompositorFrameSink, |
+ public NON_EXPORTED_BASE(cc::mojom::MojoCompositorFrameSinkPrivate) { |
+ public: |
+ GpuCompositorFrameSinkBase( |
+ GpuCompositorFrameSinkDelegate* delegate, |
+ std::unique_ptr<cc::CompositorFrameSinkSupport>, |
+ cc::mojom::MojoCompositorFrameSinkPrivateRequest private_request, |
+ cc::mojom::MojoCompositorFrameSinkClientPtr client); |
+ |
+ ~GpuCompositorFrameSinkBase() override; |
+ |
+ // cc::mojom::MojoCompositorFrameSinkPrivate: |
+ void AddChildFrameSink(const cc::FrameSinkId& child_frame_sink_id) override; |
+ void RemoveChildFrameSink( |
+ const cc::FrameSinkId& child_frame_sink_id) override; |
+ |
+ protected: |
+ void OnPrivateConnectionLost(); |
+ |
+ private: |
+ mojo::Binding<cc::mojom::MojoCompositorFrameSinkPrivate> |
+ compositor_frame_sink_private_binding_; |
+ |
+ DISALLOW_COPY_AND_ASSIGN(GpuCompositorFrameSinkBase); |
+}; |
+ |
+} // namespace display_compositor |
+ |
+#endif // COMPONENTS_DISPLAY_COMPOSITOR_GPU_COMPOSITOR_FRAME_SINK_BASE_H_ |