Index: services/surfaces/surfaces_impl.cc |
diff --git a/services/surfaces/surfaces_impl.cc b/services/surfaces/surfaces_impl.cc |
index d99eb2cb17bc97f921024933f2c86b0e13b6cc15..083b6a4002b0c3ccac94bc64a1160cb176937d14 100644 |
--- a/services/surfaces/surfaces_impl.cc |
+++ b/services/surfaces/surfaces_impl.cc |
@@ -30,7 +30,6 @@ SurfacesImpl::SurfacesImpl(cc::SurfaceManager* manager, |
mojo::InterfaceRequest<mojo::Surface> request) |
: SurfacesImpl(manager, id_namespace, client) { |
binding_.Bind(request.Pass()); |
- binding_.client()->SetIdNamespace(id_namespace); |
} |
SurfacesImpl::SurfacesImpl(cc::SurfaceManager* manager, |
@@ -39,7 +38,6 @@ SurfacesImpl::SurfacesImpl(cc::SurfaceManager* manager, |
mojo::SurfacePtr* surface) |
: SurfacesImpl(manager, id_namespace, client) { |
binding_.Bind(surface); |
- binding_.client()->SetIdNamespace(id_namespace); |
} |
SurfacesImpl::~SurfacesImpl() { |
@@ -47,6 +45,15 @@ SurfacesImpl::~SurfacesImpl() { |
factory_.DestroyAll(); |
} |
+void SurfacesImpl::GetIdNamespace( |
+ const Surface::GetIdNamespaceCallback& callback) { |
+ callback.Run(id_namespace_); |
+} |
+ |
+void SurfacesImpl::SetResourceReturner(mojo::ResourceReturnerPtr returner) { |
+ returner_ = returner.Pass(); |
+} |
+ |
void SurfacesImpl::CreateSurface(uint32_t local_id) { |
factory_.Create(QualifyIdentifier(local_id)); |
} |
@@ -87,13 +94,13 @@ void SurfacesImpl::CreateGLES2BoundSurface( |
} |
void SurfacesImpl::ReturnResources(const cc::ReturnedResourceArray& resources) { |
- if (resources.empty()) |
+ if (resources.empty() || !returner_) |
return; |
mojo::Array<mojo::ReturnedResourcePtr> ret(resources.size()); |
for (size_t i = 0; i < resources.size(); ++i) { |
ret[i] = mojo::ReturnedResource::From(resources[i]); |
} |
- binding_.client()->ReturnResources(ret.Pass()); |
+ returner_->ReturnResources(ret.Pass()); |
} |
void SurfacesImpl::DisplayDamaged() { |