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..3d037c84ec830bce3e64db96c0ea3a0e4d9b23d2 |
--- /dev/null |
+++ b/content/browser/renderer_host/offscreen_canvas_surface_service_impl.h |
@@ -0,0 +1,54 @@ |
+// 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; |
dcheng
2016/06/14 09:56:45
You can make this private (StrongBinding will dele
xlai (Olivia)
2016/06/14 21:10:17
Done.
|
+ |
+ void GetSurfaceId(const GetSurfaceIdCallback& callback) override; |
dcheng
2016/06/14 09:56:45
Nit: comment on which thing this is overriding (li
xlai (Olivia)
2016/06/14 21:10:17
Done.
|
+ void RequestSurfaceCreation(const cc::SurfaceId& surface_id) override; |
+ void Require(const cc::SurfaceId& surface_id, |
+ const cc::SurfaceSequence& sequence) override; |
+ void Satisfy(const cc::SurfaceSequence& sequence) override; |
+ |
+ // cc::SurfaceFactoryClient implementation. |
+ void ReturnResources(const cc::ReturnedResourceArray& resources) override; |
+ void WillDrawSurface(cc::SurfaceId id, const gfx::Rect& damage_rect) override; |
dcheng
2016/06/14 09:56:45
It's not introduced by this CL, but how come we pa
xlai (Olivia)
2016/06/14 21:10:17
When I implement the functions in the next patch (
|
+ 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_ |