| Index: content/browser/renderer_host/offscreen_canvas_surface_service_impl.h
|
| diff --git a/content/browser/renderer_host/offscreen_canvas_surface_service_impl.h b/content/browser/renderer_host/offscreen_canvas_surface_service_impl.h
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..ec4820a64789c814e388a05a5d44d1edd0ee1161
|
| --- /dev/null
|
| +++ b/content/browser/renderer_host/offscreen_canvas_surface_service_impl.h
|
| @@ -0,0 +1,57 @@
|
| +// 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 CONTENT_BROWSER_RENDERER_HOST_OFFSCREEN_CANVAS_SURFACE_SERVICE_IMPL_H_
|
| +#define CONTENT_BROWSER_RENDERER_HOST_OFFSCREEN_CANVAS_SURFACE_SERVICE_IMPL_H_
|
| +
|
| +#include "cc/surfaces/surface_factory.h"
|
| +#include "cc/surfaces/surface_factory_client.h"
|
| +#include "cc/surfaces/surface_id.h"
|
| +#include "cc/surfaces/surface_id_allocator.h"
|
| +#include "mojo/public/cpp/bindings/interface_request.h"
|
| +#include "mojo/public/cpp/bindings/string.h"
|
| +#include "mojo/public/cpp/bindings/strong_binding.h"
|
| +#include "third_party/WebKit/public/platform/modules/offscreencanvas/offscreen_canvas_surface_service.mojom.h"
|
| +
|
| +namespace content {
|
| +
|
| +class OffscreenCanvasSurfaceServiceImpl
|
| + : public blink::mojom::OffscreenCanvasSurfaceService,
|
| + public cc::SurfaceFactoryClient {
|
| + public:
|
| + static void Create(
|
| + mojo::InterfaceRequest<blink::mojom::OffscreenCanvasSurfaceService>
|
| + request);
|
| + ~OffscreenCanvasSurfaceServiceImpl() override;
|
| +
|
| + void GetSurfaceId(const GetSurfaceIdCallback& callback) override;
|
| + void RequestSurfaceCreation(
|
| + const blink::mojom::SurfaceIdPtr surface_id) override;
|
| + void Require(blink::mojom::SurfaceIdPtr surface_id,
|
| + blink::mojom::SurfaceSequencePtr sequence) override;
|
| + void Satisfy(blink::mojom::SurfaceSequencePtr sequence) override;
|
| +
|
| + // cc::SurfaceFactoryClient implementation.
|
| + void ReturnResources(const cc::ReturnedResourceArray& resources) override;
|
| + void WillDrawSurface(cc::SurfaceId id,
|
| + const gfx::Rect& damage_rect) override;
|
| + void SetBeginFrameSource(cc::BeginFrameSource* begin_frame_source) override;
|
| +
|
| + private:
|
| + explicit OffscreenCanvasSurfaceServiceImpl(
|
| + mojo::InterfaceRequest<blink::mojom::OffscreenCanvasSurfaceService>
|
| + request);
|
| +
|
| + // Surface-related state
|
| + std::unique_ptr<cc::SurfaceIdAllocator> id_allocator_;
|
| + std::unique_ptr<cc::SurfaceFactory> surface_factory_;
|
| +
|
| + mojo::StrongBinding<blink::mojom::OffscreenCanvasSurfaceService> binding_;
|
| +
|
| + DISALLOW_COPY_AND_ASSIGN(OffscreenCanvasSurfaceServiceImpl);
|
| +};
|
| +
|
| +} // namespace content
|
| +
|
| +#endif // CONTENT_BROWSER_RENDERER_HOST_OFFSCREEN_CANVAS_SURFACE_SERVICE_IMPL_H_
|
|
|