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

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

Issue 2479563005: Create manager to track OffscreenCanvasSurfaceImpl instances (Closed)
Patch Set: Created 4 years, 1 month 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_compositor_frame_sink.h
diff --git a/content/browser/renderer_host/offscreen_canvas_compositor_frame_sink.h b/content/browser/renderer_host/offscreen_canvas_compositor_frame_sink.h
index 0d838ed11ee7831824cd70a4c261ecee3962336f..b79afa5a3f6050bb6f1a723c20cd425a39ef3d27 100644
--- a/content/browser/renderer_host/offscreen_canvas_compositor_frame_sink.h
+++ b/content/browser/renderer_host/offscreen_canvas_compositor_frame_sink.h
@@ -16,11 +16,13 @@ class OffscreenCanvasCompositorFrameSink
public cc::SurfaceFactoryClient {
public:
OffscreenCanvasCompositorFrameSink(
+ uint32_t canvas_id,
const cc::SurfaceId& surface_id,
cc::mojom::MojoCompositorFrameSinkClientPtr client);
~OffscreenCanvasCompositorFrameSink() override;
- static void Create(const cc::SurfaceId& surface_id,
+ static void Create(uint32_t canvas_id,
+ const cc::SurfaceId& surface_id,
cc::mojom::MojoCompositorFrameSinkClientPtr client,
cc::mojom::MojoCompositorFrameSinkRequest request);
@@ -34,15 +36,22 @@ class OffscreenCanvasCompositorFrameSink
const gfx::Rect& damage_rect) override;
void SetBeginFrameSource(cc::BeginFrameSource* begin_frame_source) override;
+ base::WeakPtr<OffscreenCanvasCompositorFrameSink> GetWeakPtr() {
+ return weak_factory_.GetWeakPtr();
+ }
+
private:
void DidReceiveCompositorFrameAck();
+ int canvas_id_;
cc::SurfaceId surface_id_;
std::unique_ptr<cc::SurfaceFactory> surface_factory_;
cc::mojom::MojoCompositorFrameSinkClientPtr client_;
int ack_pending_count_ = 0;
cc::ReturnedResourceArray surface_returned_resources_;
+ base::WeakPtrFactory<OffscreenCanvasCompositorFrameSink> weak_factory_;
+
DISALLOW_COPY_AND_ASSIGN(OffscreenCanvasCompositorFrameSink);
};

Powered by Google App Engine
This is Rietveld 408576698