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

Unified Diff: content/browser/renderer_host/delegated_frame_host.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/delegated_frame_host.cc
diff --git a/content/browser/renderer_host/delegated_frame_host.cc b/content/browser/renderer_host/delegated_frame_host.cc
index f2801e57a6ea2555570455639197f81d23359c7f..626ce81bcac47d65e6bd052bb8883988c0ac6733 100644
--- a/content/browser/renderer_host/delegated_frame_host.cc
+++ b/content/browser/renderer_host/delegated_frame_host.cc
@@ -75,7 +75,10 @@ DelegatedFrameHost::DelegatedFrameHost(DelegatedFrameHostClient* client)
delegated_frame_evictor_(new DelegatedFrameEvictor(this)) {
ImageTransportFactory* factory = ImageTransportFactory::GetInstance();
factory->GetContextFactory()->AddObserver(this);
- id_allocator_ = factory->GetContextFactory()->CreateSurfaceIdAllocator();
+ id_allocator_.reset(new cc::SurfaceIdAllocator(
+ factory->GetContextFactory()->AllocateSurfaceClientId()));
+ factory->GetSurfaceManager()->RegisterSurfaceClientId(
+ id_allocator_->client_id());
factory->GetSurfaceManager()->RegisterSurfaceFactoryClient(
id_allocator_->client_id(), this);
}
@@ -818,6 +821,8 @@ DelegatedFrameHost::~DelegatedFrameHost() {
surface_factory_->Destroy(surface_id_);
factory->GetSurfaceManager()->UnregisterSurfaceFactoryClient(
id_allocator_->client_id());
+ factory->GetSurfaceManager()->InvalidateSurfaceClientId(
+ id_allocator_->client_id());
DCHECK(!vsync_manager_.get());
}

Powered by Google App Engine
This is Rietveld 408576698