| OLD | NEW |
| (Empty) |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_OFFSCREEN_CANVAS_COMPOSITOR_FRAME_SINK_PRO
VIDER_IMPL_H_ | |
| 6 #define CONTENT_BROWSER_RENDERER_HOST_OFFSCREEN_CANVAS_COMPOSITOR_FRAME_SINK_PRO
VIDER_IMPL_H_ | |
| 7 | |
| 8 #include <unordered_map> | |
| 9 | |
| 10 #include "content/browser/renderer_host/offscreen_canvas_compositor_frame_sink.h
" | |
| 11 #include "mojo/public/cpp/bindings/binding_set.h" | |
| 12 #include "third_party/WebKit/public/platform/modules/offscreencanvas/offscreen_c
anvas_surface.mojom.h" | |
| 13 | |
| 14 namespace content { | |
| 15 | |
| 16 // TODO(fsamuel): This should be replaced with the FrameSinkManager interface. | |
| 17 class OffscreenCanvasCompositorFrameSinkProviderImpl | |
| 18 : public blink::mojom::OffscreenCanvasCompositorFrameSinkProvider { | |
| 19 public: | |
| 20 OffscreenCanvasCompositorFrameSinkProviderImpl(); | |
| 21 ~OffscreenCanvasCompositorFrameSinkProviderImpl() override; | |
| 22 | |
| 23 void Add( | |
| 24 blink::mojom::OffscreenCanvasCompositorFrameSinkProviderRequest request); | |
| 25 | |
| 26 // blink::mojom::OffscreenCanvasCompositorFrameSinkProvider implementation. | |
| 27 void CreateCompositorFrameSink( | |
| 28 const cc::FrameSinkId& frame_sink_id, | |
| 29 cc::mojom::MojoCompositorFrameSinkClientPtr client, | |
| 30 cc::mojom::MojoCompositorFrameSinkRequest request) override; | |
| 31 | |
| 32 cc::SurfaceManager* GetSurfaceManager(); | |
| 33 | |
| 34 void OnCompositorFrameSinkClientConnectionLost( | |
| 35 const cc::FrameSinkId& frame_sink_id); | |
| 36 void OnCompositorFrameSinkClientDestroyed( | |
| 37 const cc::FrameSinkId& frame_sink_id); | |
| 38 | |
| 39 private: | |
| 40 std::unordered_map<cc::FrameSinkId, | |
| 41 std::unique_ptr<OffscreenCanvasCompositorFrameSink>, | |
| 42 cc::FrameSinkIdHash> | |
| 43 compositor_frame_sinks_; | |
| 44 | |
| 45 mojo::BindingSet<blink::mojom::OffscreenCanvasCompositorFrameSinkProvider> | |
| 46 bindings_; | |
| 47 | |
| 48 DISALLOW_COPY_AND_ASSIGN(OffscreenCanvasCompositorFrameSinkProviderImpl); | |
| 49 }; | |
| 50 | |
| 51 } // namespace content | |
| 52 | |
| 53 #endif // CONTENT_BROWSER_RENDERER_HOST_OFFSCREEN_CANVAS_COMPOSITOR_FRAME_SINK_
PROVIDER_IMPL_H_ | |
| OLD | NEW |