| 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_);
|
| }
|
|
|