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

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

Issue 2479563005: Create manager to track OffscreenCanvasSurfaceImpl instances (Closed)
Patch Set: remove compositorframesink from manager 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.cc
diff --git a/content/browser/renderer_host/offscreen_canvas_compositor_frame_sink.cc b/content/browser/renderer_host/offscreen_canvas_compositor_frame_sink.cc
index 0c4d066e37895a768142f2491c6e6b1d489ce988..fbd8f8c54e0505a2c0749d3ba0bc0174215aed81 100644
--- a/content/browser/renderer_host/offscreen_canvas_compositor_frame_sink.cc
+++ b/content/browser/renderer_host/offscreen_canvas_compositor_frame_sink.cc
@@ -7,6 +7,7 @@
#include "cc/surfaces/surface.h"
#include "cc/surfaces/surface_manager.h"
#include "content/browser/compositor/surface_utils.h"
+#include "content/browser/renderer_host/offscreen_canvas_surface_manager.h"
#include "mojo/public/cpp/bindings/strong_binding.h"
namespace content {
@@ -14,12 +15,15 @@ namespace content {
OffscreenCanvasCompositorFrameSink::OffscreenCanvasCompositorFrameSink(
const cc::SurfaceId& surface_id,
cc::mojom::MojoCompositorFrameSinkClientPtr client)
- : surface_id_(surface_id), client_(std::move(client)) {
+ : surface_id_(surface_id), client_(std::move(client)), weak_factory_(this) {
cc::SurfaceManager* manager = GetSurfaceManager();
surface_factory_ = base::MakeUnique<cc::SurfaceFactory>(
surface_id_.frame_sink_id(), manager, this);
manager->RegisterFrameSinkId(surface_id_.frame_sink_id());
surface_factory_->Create(surface_id_.local_frame_id());
+
+ DCHECK(OffscreenCanvasSurfaceManager::GetInstance()->GetSurfaceInstance(
Fady Samuel 2016/11/14 21:15:40 Can we get rid of this?
xlai (Olivia) 2016/11/15 17:16:18 Done.
+ surface_id_.frame_sink_id()));
dcheng 2016/11/15 07:28:29 Do we need to check somewhere higher in the stack
xlai (Olivia) 2016/11/15 17:16:18 I'm removing it now. I think this DCHECK is better
}
OffscreenCanvasCompositorFrameSink::~OffscreenCanvasCompositorFrameSink() {

Powered by Google App Engine
This is Rietveld 408576698