Index: components/mus/surfaces/compositor_frame_sink_factory_impl.h |
diff --git a/components/mus/surfaces/compositor_frame_sink_factory_impl.h b/components/mus/surfaces/compositor_frame_sink_factory_impl.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..8954bed8b9757e0a99f27064c2a6fdbd8fb1ecce |
--- /dev/null |
+++ b/components/mus/surfaces/compositor_frame_sink_factory_impl.h |
@@ -0,0 +1,50 @@ |
+// Copyright 2016 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_MUS_SURFACES_COMPOSITOR_FRAME_SINK_FACTORY_IMPL_H_ |
+#define COMPONENTS_MUS_SURFACES_COMPOSITOR_FRAME_SINK_FACTORY_IMPL_H_ |
+ |
+#include "cc/surfaces/surface_id_allocator.h" |
+#include "components/mus/public/interfaces/display_compositor.mojom.h" |
+#include "components/mus/surfaces/compositor_frame_sink_delegate.h" |
+#include "components/mus/surfaces/surfaces_state.h" |
+#include "mojo/public/cpp/bindings/strong_binding.h" |
+ |
+namespace mus { |
+ |
+class CompositorFrameSinkImpl; |
+ |
+class CompositorFrameSinkFactoryImpl : public mojom::CompositorFrameSinkFactory, |
+ public CompositorFrameSinkDelegate { |
+ public: |
+ CompositorFrameSinkFactoryImpl( |
+ int client_id, |
+ mojo::InterfaceRequest<mojom::CompositorFrameSinkFactory> request, |
+ const scoped_refptr<SurfacesState>& surfaces_state); |
+ ~CompositorFrameSinkFactoryImpl() override; |
+ |
+ void CompositorFrameSinkConnectionLost(int sink_id) override; |
rjkroege
2016/05/19 22:08:38
// CompositorFrameSinkDelegate implementation?
An
Fady Samuel
2016/05/25 12:37:01
For unit testing. One can test this class without
|
+ cc::SurfaceId GenerateSurfaceId() override; |
+ |
+ // mojom::CompositorFrameSinkFactory implementation. |
+ void CreateCompositorFrameSink( |
+ int sink_id, |
+ mojo::InterfaceRequest<mojom::CompositorFrameSink> sink, |
+ mojom::CompositorFrameSinkClientPtr client) override; |
+ |
+ private: |
+ const int client_id_; |
+ scoped_refptr<SurfacesState> surfaces_state_; |
+ cc::SurfaceIdAllocator allocator_; |
+ using CompositorFrameSinkMap = |
+ std::map<int, std::unique_ptr<CompositorFrameSinkImpl>>; |
+ CompositorFrameSinkMap sinks_; |
+ mojo::StrongBinding<mojom::CompositorFrameSinkFactory> binding_; |
+ |
+ DISALLOW_COPY_AND_ASSIGN(CompositorFrameSinkFactoryImpl); |
+}; |
+ |
+} // namespace mus |
+ |
+#endif // COMPONENTS_MUS_SURFACES_COMPOSITOR_FRAME_SINK_FACTORY_IMPL_H_ |