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

Unified Diff: content/browser/renderer_host/offscreen_canvas_surface_impl.h

Issue 2789753002: Convert offscreen canvas to use FrameSinkManagerHost. (Closed)
Patch Set: Rebase. 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 side-by-side diff with in-line comments
Download patch
Index: content/browser/renderer_host/offscreen_canvas_surface_impl.h
diff --git a/content/browser/renderer_host/offscreen_canvas_surface_impl.h b/content/browser/renderer_host/offscreen_canvas_surface_impl.h
index ab3bcb2785b1c71e83cc277e5214197895660ac9..3f76a2b41cf6632702c485fce1fb11a6984505bf 100644
--- a/content/browser/renderer_host/offscreen_canvas_surface_impl.h
+++ b/content/browser/renderer_host/offscreen_canvas_surface_impl.h
@@ -7,12 +7,13 @@
#include "cc/ipc/frame_sink_manager.mojom.h"
#include "cc/surfaces/surface_id.h"
-#include "mojo/public/cpp/bindings/interface_request.h"
#include "mojo/public/cpp/bindings/strong_binding.h"
#include "third_party/WebKit/public/platform/modules/offscreencanvas/offscreen_canvas_surface.mojom.h"
namespace content {
+// The browser owned object for an offscreen canvas connection. Holds
+// connections to both the renderer and frame sink manager.
class CONTENT_EXPORT OffscreenCanvasSurfaceImpl
: public blink::mojom::OffscreenCanvasSurface {
public:
@@ -26,6 +27,14 @@ class CONTENT_EXPORT OffscreenCanvasSurfaceImpl
cc::mojom::FrameSinkManagerClientPtr client,
blink::mojom::OffscreenCanvasSurfaceRequest request);
+ // Creates a MojoCompositorFrameSink connection to FrameSinkManager for an
+ // offscreen canvas client. The corresponding private interface will be owned
+ // here to control CompositorFrameSink lifetime. This should only ever be
+ // called once.
+ void CreateCompositorFrameSink(
+ cc::mojom::MojoCompositorFrameSinkClientPtr client,
+ cc::mojom::MojoCompositorFrameSinkRequest request);
+
void OnSurfaceCreated(const cc::SurfaceInfo& surface_info);
// blink::mojom::OffscreenCanvasSurface implementation.
@@ -47,11 +56,18 @@ class CONTENT_EXPORT OffscreenCanvasSurfaceImpl
cc::mojom::FrameSinkManagerClientPtr client_;
mojo::StrongBindingPtr<blink::mojom::OffscreenCanvasSurface> binding_;
+ // Private connection for the CompositorFrameSink. The CompositorFrameSink
+ // will not be destroyed until both private and offscreen canvas client
+ // connections are closed.
+ cc::mojom::MojoCompositorFrameSinkPrivatePtr compositor_frame_sink_private_;
+
// Surface-related state
const cc::FrameSinkId frame_sink_id_;
cc::LocalSurfaceId current_local_surface_id_;
const cc::FrameSinkId parent_frame_sink_id_;
+ bool has_created_compositor_frame_sink_ = false;
+
DISALLOW_COPY_AND_ASSIGN(OffscreenCanvasSurfaceImpl);
};

Powered by Google App Engine
This is Rietveld 408576698