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

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

Issue 2144733005: [WIP] cc: Plumb SurfaceId from clients Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Ensure only SurfaceFactoy and tests can update hierarchy 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..8e6f08b33e74cab0ecb66e20ab65e81b71af04b6 100644
--- a/content/browser/renderer_host/offscreen_canvas_surface_impl.cc
+++ b/content/browser/renderer_host/offscreen_canvas_surface_impl.cc
@@ -21,7 +21,7 @@ void OffscreenCanvasSurfaceImpl::Create(
OffscreenCanvasSurfaceImpl::OffscreenCanvasSurfaceImpl(
mojo::InterfaceRequest<blink::mojom::OffscreenCanvasSurface> request)
- : id_allocator_(CreateSurfaceIdAllocator()),
+ : id_allocator_(new cc::SurfaceIdAllocator(AllocateSurfaceClientId())),
binding_(this, std::move(request)) {}
OffscreenCanvasSurfaceImpl::~OffscreenCanvasSurfaceImpl() {
@@ -30,8 +30,6 @@ OffscreenCanvasSurfaceImpl::~OffscreenCanvasSurfaceImpl() {
// avoid their destruction errors.
if (surface_factory_)
surface_factory_->DidDestroySurfaceManager();
- if (id_allocator_)
- id_allocator_->DidDestroySurfaceManager();
}
surface_factory_->Destroy(surface_id_);
}
@@ -49,7 +47,8 @@ void OffscreenCanvasSurfaceImpl::RequestSurfaceCreation(
const cc::SurfaceId& surface_id) {
cc::SurfaceManager* manager = GetSurfaceManager();
if (!surface_factory_) {
- surface_factory_ = base::MakeUnique<cc::SurfaceFactory>(manager, this);
+ surface_factory_ = base::MakeUnique<cc::SurfaceFactory>(
+ surface_id.client_id(), manager, this);
}
surface_factory_->Create(surface_id);
}
« no previous file with comments | « content/browser/renderer_host/delegated_frame_host.cc ('k') | content/browser/renderer_host/render_widget_host_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698