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

Unified Diff: sky/compositor/surface_holder.cc

Issue 871373015: De-Client Surface interface (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 11 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: sky/compositor/surface_holder.cc
diff --git a/sky/compositor/surface_holder.cc b/sky/compositor/surface_holder.cc
index e46490226ef21a453ac7cec4986e32c8aed6be4e..3b130cee56d5dd0645447879049d552144848d2e 100644
--- a/sky/compositor/surface_holder.cc
+++ b/sky/compositor/surface_holder.cc
@@ -17,12 +17,20 @@ SurfaceHolder::Client::~Client() {
}
SurfaceHolder::SurfaceHolder(Client* client, mojo::Shell* shell)
- : client_(client), id_namespace_(0u), local_id_(0u), weak_factory_(this) {
+ : client_(client),
+ id_namespace_(0u),
+ local_id_(0u),
+ returner_binding_(this),
+ weak_factory_(this) {
mojo::ServiceProviderPtr service_provider;
shell->ConnectToApplication("mojo:surfaces_service",
mojo::GetProxy(&service_provider), nullptr);
mojo::ConnectToService(service_provider.get(), &surface_);
- surface_.set_client(this);
+ surface_->GetIdNamespace(
+ base::Bind(&SurfaceHolder::SetIdNamespace, base::Unretained(this)));
+ mojo::ResourceReturnerPtr returner_ptr;
+ returner_binding_.Bind(GetProxy(&returner_ptr));
+ surface_->SetResourceReturner(returner_ptr.Pass());
}
SurfaceHolder::~SurfaceHolder() {
@@ -65,9 +73,6 @@ void SurfaceHolder::SetIdNamespace(uint32_t id_namespace) {
void SurfaceHolder::ReturnResources(
mojo::Array<mojo::ReturnedResourcePtr> resources) {
- // TODO(abarth): The surface service shouldn't spam us with empty calls.
- if (!resources.size())
- return;
client_->ReturnResources(resources.Pass());
}

Powered by Google App Engine
This is Rietveld 408576698