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

Unified Diff: examples/surfaces_app/surfaces_app.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: examples/surfaces_app/surfaces_app.cc
diff --git a/examples/surfaces_app/surfaces_app.cc b/examples/surfaces_app/surfaces_app.cc
index ae08a3712451a1956fdc83dc511b0c87961fb0a2..d8f40f3c1b2d9209dad7b2d4634b347c3fa3ce28 100644
--- a/examples/surfaces_app/surfaces_app.cc
+++ b/examples/surfaces_app/surfaces_app.cc
@@ -27,7 +27,7 @@ namespace examples {
static const uint32_t kLocalId = 1u;
-class SurfacesApp : public ApplicationDelegate, public SurfaceClient {
+class SurfacesApp : public ApplicationDelegate {
public:
SurfacesApp() : id_namespace_(0u), weak_factory_(this) {}
~SurfacesApp() override {}
@@ -37,7 +37,8 @@ class SurfacesApp : public ApplicationDelegate, public SurfaceClient {
connection->ConnectToService("mojo:native_viewport_service", &viewport_);
connection->ConnectToService("mojo:surfaces_service", &surface_);
- surface_.set_client(this);
+ surface_->GetIdNamespace(
+ base::Bind(&SurfacesApp::SetIdNamespace, base::Unretained(this)));
embedder_.reset(new Embedder(kLocalId, surface_.get()));
size_ = gfx::Size(800, 600);
@@ -85,16 +86,12 @@ class SurfacesApp : public ApplicationDelegate, public SurfaceClient {
}
private:
- // SurfaceClient implementation.
- void SetIdNamespace(uint32_t id_namespace) override {
+ void SetIdNamespace(uint32_t id_namespace) {
auto qualified_id = mojo::SurfaceId::New();
qualified_id->id_namespace = id_namespace;
qualified_id->local = kLocalId;
viewport_->SubmittedFrame(qualified_id.Pass());
}
- void ReturnResources(Array<ReturnedResourcePtr> resources) override {
- DCHECK(!resources.size());
- }
void OnCreatedNativeViewport(uint64_t native_viewport_id,
mojo::ViewportMetricsPtr metrics) {}

Powered by Google App Engine
This is Rietveld 408576698