| Index: content/browser/renderer_host/offscreen_canvas_provider_impl.h
|
| diff --git a/content/browser/renderer_host/offscreen_canvas_provider_impl.h b/content/browser/renderer_host/offscreen_canvas_provider_impl.h
|
| index 554e121a39a7b453d9d4a82aaf9ee8a8e05f1ea8..54f5070327302f00b36d329fced79d8f4c5a0626 100644
|
| --- a/content/browser/renderer_host/offscreen_canvas_provider_impl.h
|
| +++ b/content/browser/renderer_host/offscreen_canvas_provider_impl.h
|
| @@ -5,14 +5,20 @@
|
| #ifndef CONTENT_BROWSER_RENDERER_HOST_OFFSCREEN_CANVAS_PROVIDER_IMPL_H_
|
| #define CONTENT_BROWSER_RENDERER_HOST_OFFSCREEN_CANVAS_PROVIDER_IMPL_H_
|
|
|
| +#include <memory>
|
| +
|
| +#include "base/containers/flat_map.h"
|
| #include "cc/surfaces/frame_sink_id.h"
|
| +#include "content/common/content_export.h"
|
| #include "mojo/public/cpp/bindings/binding_set.h"
|
| #include "third_party/WebKit/public/platform/modules/offscreencanvas/offscreen_canvas_surface.mojom.h"
|
|
|
| namespace content {
|
|
|
| +class OffscreenCanvasSurfaceImpl;
|
| +
|
| // Creates OffscreenCanvasSurfaces and MojoCompositorFrameSinks for a renderer.
|
| -class OffscreenCanvasProviderImpl
|
| +class CONTENT_EXPORT OffscreenCanvasProviderImpl
|
| : public blink::mojom::OffscreenCanvasProvider {
|
| public:
|
| explicit OffscreenCanvasProviderImpl(uint32_t renderer_client_id);
|
| @@ -32,11 +38,20 @@ class OffscreenCanvasProviderImpl
|
| cc::mojom::MojoCompositorFrameSinkRequest request) override;
|
|
|
| private:
|
| + friend class OffscreenCanvasProviderImplTest;
|
| +
|
| + // Destroys the |canvas_map_| entry for |frame_sink_id|. Provided as a
|
| + // callback to each OffscreenCanvasSurfaceImpl so they can destroy themselves.
|
| + void DestroyOffscreenCanvasSurface(cc::FrameSinkId frame_sink_id);
|
| +
|
| // FrameSinkIds for offscreen canvas must use the renderer client id.
|
| const uint32_t renderer_client_id_;
|
|
|
| mojo::BindingSet<blink::mojom::OffscreenCanvasProvider> bindings_;
|
|
|
| + base::flat_map<cc::FrameSinkId, std::unique_ptr<OffscreenCanvasSurfaceImpl>>
|
| + canvas_map_;
|
| +
|
| DISALLOW_COPY_AND_ASSIGN(OffscreenCanvasProviderImpl);
|
| };
|
|
|
|
|