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_SURFACE_SERVICE_IMPL_H_ | |
6 #define CONTENT_BROWSER_RENDERER_HOST_OFFSCREEN_CANVAS_SURFACE_SERVICE_IMPL_H_ | |
7 | |
8 #include "cc/surfaces/surface_factory.h" | |
9 #include "cc/surfaces/surface_factory_client.h" | |
10 #include "cc/surfaces/surface_id.h" | |
11 #include "cc/surfaces/surface_id_allocator.h" | |
12 #include "mojo/public/cpp/bindings/interface_request.h" | |
13 #include "mojo/public/cpp/bindings/string.h" | |
14 #include "mojo/public/cpp/bindings/strong_binding.h" | |
15 #include "third_party/WebKit/public/platform/modules/offscreencanvas/offscreen_c anvas_surface_service.mojom.h" | |
16 | |
17 namespace content { | |
18 | |
19 class OffscreenCanvasSurfaceServiceImpl | |
20 : public blink::mojom::OffscreenCanvasSurfaceService, | |
21 public cc::SurfaceFactoryClient { | |
22 public: | |
23 static void Create(mojo::InterfaceRequest< | |
24 blink::mojom::OffscreenCanvasSurfaceService> request); | |
25 ~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.
| |
26 | |
27 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.
| |
28 void RequestSurfaceCreation(const cc::SurfaceId& surface_id) override; | |
29 void Require(const cc::SurfaceId& surface_id, | |
30 const cc::SurfaceSequence& sequence) override; | |
31 void Satisfy(const cc::SurfaceSequence& sequence) override; | |
32 | |
33 // cc::SurfaceFactoryClient implementation. | |
34 void ReturnResources(const cc::ReturnedResourceArray& resources) override; | |
35 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 (
| |
36 void SetBeginFrameSource(cc::BeginFrameSource* begin_frame_source) override; | |
37 | |
38 private: | |
39 explicit OffscreenCanvasSurfaceServiceImpl( | |
40 mojo::InterfaceRequest<blink::mojom::OffscreenCanvasSurfaceService> | |
41 request); | |
42 | |
43 // Surface-related state | |
44 std::unique_ptr<cc::SurfaceIdAllocator> id_allocator_; | |
45 std::unique_ptr<cc::SurfaceFactory> surface_factory_; | |
46 | |
47 mojo::StrongBinding<blink::mojom::OffscreenCanvasSurfaceService> binding_; | |
48 | |
49 DISALLOW_COPY_AND_ASSIGN(OffscreenCanvasSurfaceServiceImpl); | |
50 }; | |
51 | |
52 } // namespace content | |
53 | |
54 #endif // CONTENT_BROWSER_RENDERER_HOST_OFFSCREEN_CANVAS_SURFACE_SERVICE_IMPL_H _ | |
OLD | NEW |