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

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

Issue 2166423002: ui::ContextFactory should not create SurfaceIdAllocators (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed Dana's nit Created 4 years, 5 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.cc
diff --git a/content/browser/renderer_host/offscreen_canvas_surface_impl.cc b/content/browser/renderer_host/offscreen_canvas_surface_impl.cc
index 5689bff4b0192c45746ad98092453689972df6d1..a3ed311c56208e9f6d41b047c5e5050c91db9f16 100644
--- a/content/browser/renderer_host/offscreen_canvas_surface_impl.cc
+++ b/content/browser/renderer_host/offscreen_canvas_surface_impl.cc
@@ -21,8 +21,10 @@ void OffscreenCanvasSurfaceImpl::Create(
OffscreenCanvasSurfaceImpl::OffscreenCanvasSurfaceImpl(
mojo::InterfaceRequest<blink::mojom::OffscreenCanvasSurface> request)
- : id_allocator_(CreateSurfaceIdAllocator()),
- binding_(this, std::move(request)) {}
+ : id_allocator_(new cc::SurfaceIdAllocator(AllocateSurfaceClientId())),
+ binding_(this, std::move(request)) {
+ GetSurfaceManager()->RegisterSurfaceClientId(id_allocator_->client_id());
+}
OffscreenCanvasSurfaceImpl::~OffscreenCanvasSurfaceImpl() {
if (!GetSurfaceManager()) {
@@ -30,8 +32,8 @@ OffscreenCanvasSurfaceImpl::~OffscreenCanvasSurfaceImpl() {
// avoid their destruction errors.
if (surface_factory_)
surface_factory_->DidDestroySurfaceManager();
- if (id_allocator_)
- id_allocator_->DidDestroySurfaceManager();
+ } else {
+ GetSurfaceManager()->InvalidateSurfaceClientId(id_allocator_->client_id());
}
surface_factory_->Destroy(surface_id_);
}

Powered by Google App Engine
This is Rietveld 408576698