Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(90)

Side by Side Diff: content/browser/renderer_host/offscreen_canvas_provider_impl.h

Issue 2811413002: Add check for renderer client id. (Closed)
Patch Set: Fix comment. Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | content/browser/renderer_host/offscreen_canvas_provider_impl.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CONTENT_BROWSER_RENDERER_HOST_OFFSCREEN_CANVAS_PROVIDER_IMPL_H_ 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_OFFSCREEN_CANVAS_PROVIDER_IMPL_H_
6 #define CONTENT_BROWSER_RENDERER_HOST_OFFSCREEN_CANVAS_PROVIDER_IMPL_H_ 6 #define CONTENT_BROWSER_RENDERER_HOST_OFFSCREEN_CANVAS_PROVIDER_IMPL_H_
7 7
8 #include "cc/surfaces/frame_sink_id.h" 8 #include "cc/surfaces/frame_sink_id.h"
9 #include "mojo/public/cpp/bindings/binding_set.h" 9 #include "mojo/public/cpp/bindings/binding_set.h"
10 #include "third_party/WebKit/public/platform/modules/offscreencanvas/offscreen_c anvas_surface.mojom.h" 10 #include "third_party/WebKit/public/platform/modules/offscreencanvas/offscreen_c anvas_surface.mojom.h"
11 11
12 namespace content { 12 namespace content {
13 13
14 // Creates OffscreenCanvasSurfaces and MojoCompositorFrameSinks for a renderer. 14 // Creates OffscreenCanvasSurfaces and MojoCompositorFrameSinks for a renderer.
15 class OffscreenCanvasProviderImpl 15 class OffscreenCanvasProviderImpl
16 : public blink::mojom::OffscreenCanvasProvider { 16 : public blink::mojom::OffscreenCanvasProvider {
17 public: 17 public:
18 OffscreenCanvasProviderImpl(); 18 explicit OffscreenCanvasProviderImpl(uint32_t renderer_client_id);
19 ~OffscreenCanvasProviderImpl() override; 19 ~OffscreenCanvasProviderImpl() override;
20 20
21 void Add(blink::mojom::OffscreenCanvasProviderRequest request); 21 void Add(blink::mojom::OffscreenCanvasProviderRequest request);
22 22
23 // blink::mojom::OffscreenCanvasProvider implementation. 23 // blink::mojom::OffscreenCanvasProvider implementation.
24 void CreateOffscreenCanvasSurface( 24 void CreateOffscreenCanvasSurface(
25 const cc::FrameSinkId& parent_frame_sink_id, 25 const cc::FrameSinkId& parent_frame_sink_id,
26 const cc::FrameSinkId& frame_sink_id, 26 const cc::FrameSinkId& frame_sink_id,
27 cc::mojom::FrameSinkManagerClientPtr client, 27 cc::mojom::FrameSinkManagerClientPtr client,
28 blink::mojom::OffscreenCanvasSurfaceRequest request) override; 28 blink::mojom::OffscreenCanvasSurfaceRequest request) override;
29 void CreateCompositorFrameSink( 29 void CreateCompositorFrameSink(
30 const cc::FrameSinkId& frame_sink_id, 30 const cc::FrameSinkId& frame_sink_id,
31 cc::mojom::MojoCompositorFrameSinkClientPtr client, 31 cc::mojom::MojoCompositorFrameSinkClientPtr client,
32 cc::mojom::MojoCompositorFrameSinkRequest request) override; 32 cc::mojom::MojoCompositorFrameSinkRequest request) override;
33 33
34 private: 34 private:
35 // FrameSinkIds for offscreen canvas must use the renderer client id.
36 const uint32_t renderer_client_id_;
37
35 mojo::BindingSet<blink::mojom::OffscreenCanvasProvider> bindings_; 38 mojo::BindingSet<blink::mojom::OffscreenCanvasProvider> bindings_;
36 39
37 DISALLOW_COPY_AND_ASSIGN(OffscreenCanvasProviderImpl); 40 DISALLOW_COPY_AND_ASSIGN(OffscreenCanvasProviderImpl);
38 }; 41 };
39 42
40 } // namespace content 43 } // namespace content
41 44
42 #endif // CONTENT_BROWSER_RENDERER_HOST_OFFSCREEN_CANVAS_PROVIDER_IMPL_H_ 45 #endif // CONTENT_BROWSER_RENDERER_HOST_OFFSCREEN_CANVAS_PROVIDER_IMPL_H_
OLDNEW
« no previous file with comments | « no previous file | content/browser/renderer_host/offscreen_canvas_provider_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698