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

Unified Diff: examples/surfaces_app/child_app.cc

Issue 1537803002: Revert "Delete the Surfaces service." (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 5 years 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
« no previous file with comments | « examples/surfaces_app/child.mojom ('k') | examples/surfaces_app/child_gl_app.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: examples/surfaces_app/child_app.cc
diff --git a/examples/surfaces_app/child_app.cc b/examples/surfaces_app/child_app.cc
new file mode 100644
index 0000000000000000000000000000000000000000..14292232464ccf97c679ff843118b65f8ed0e220
--- /dev/null
+++ b/examples/surfaces_app/child_app.cc
@@ -0,0 +1,51 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "base/macros.h"
+#include "examples/surfaces_app/child_impl.h"
+#include "mojo/application/application_runner_chromium.h"
+#include "mojo/public/c/system/main.h"
+#include "mojo/public/cpp/application/application_connection.h"
+#include "mojo/public/cpp/application/application_delegate.h"
+#include "mojo/public/cpp/application/application_impl.h"
+#include "mojo/public/cpp/bindings/string.h"
+
+namespace mojo {
+namespace examples {
+
+class ChildApp : public ApplicationDelegate, public InterfaceFactory<Child> {
+ public:
+ ChildApp() {}
+ ~ChildApp() override {}
+
+ void Initialize(ApplicationImpl* app) override {
+ surfaces_service_connection_ =
+ app->ConnectToApplication("mojo:surfaces_service");
+ }
+
+ // ApplicationDelegate implementation.
+ bool ConfigureIncomingConnection(ApplicationConnection* connection) override {
+ connection->AddService(this);
+ return true;
+ }
+
+ // InterfaceFactory<Child> implementation.
+ void Create(ApplicationConnection* connection,
+ InterfaceRequest<Child> request) override {
+ new ChildImpl(surfaces_service_connection_, request.Pass());
+ }
+
+ private:
+ ApplicationConnection* surfaces_service_connection_;
+
+ DISALLOW_COPY_AND_ASSIGN(ChildApp);
+};
+
+} // namespace examples
+} // namespace mojo
+
+MojoResult MojoMain(MojoHandle application_request) {
+ mojo::ApplicationRunnerChromium runner(new mojo::examples::ChildApp);
+ return runner.Run(application_request);
+}
« no previous file with comments | « examples/surfaces_app/child.mojom ('k') | examples/surfaces_app/child_gl_app.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698