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

Unified Diff: components/exo/surface.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: components/exo/surface.cc
diff --git a/components/exo/surface.cc b/components/exo/surface.cc
index f4851060c1f1466befacc854585b927ac2890368..1e2026c28a34218ae05c622a10ee3b88aa339a48 100644
--- a/components/exo/surface.cc
+++ b/components/exo/surface.cc
@@ -192,7 +192,12 @@ void SurfaceFactoryOwner::SetBeginFrameSource(
////////////////////////////////////////////////////////////////////////////////
// SurfaceFactoryOwner, private:
-SurfaceFactoryOwner::~SurfaceFactoryOwner() {}
+SurfaceFactoryOwner::~SurfaceFactoryOwner() {
+ if (surface_factory_->manager()) {
+ surface_factory_->manager()->InvalidateSurfaceClientId(
+ id_allocator_->client_id());
+ }
+}
////////////////////////////////////////////////////////////////////////////////
// Surface, public:
@@ -210,8 +215,10 @@ Surface::Surface()
window_->SetEventTargeter(base::WrapUnique(new CustomWindowTargeter));
window_->set_owned_by_parent(false);
factory_owner_->surface_ = this;
- factory_owner_->id_allocator_ =
- aura::Env::GetInstance()->context_factory()->CreateSurfaceIdAllocator();
+ factory_owner_->id_allocator_.reset(new cc::SurfaceIdAllocator(
+ aura::Env::GetInstance()->context_factory()->AllocateSurfaceClientId()));
+ surface_manager_->RegisterSurfaceClientId(
+ factory_owner_->id_allocator_->client_id());
factory_owner_->surface_factory_.reset(
new cc::SurfaceFactory(surface_manager_, factory_owner_.get()));
aura::Env::GetInstance()->context_factory()->AddObserver(this);
« no previous file with comments | « cc/test/test_delegating_output_surface.cc ('k') | content/browser/compositor/gpu_process_transport_factory.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698