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

Unified Diff: examples/hello_mojo/hello_mojo_client.cc

Issue 2015643002: Add (optional) options to Run[Main]Application(). (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: doh Created 4 years, 7 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/hello_mojo/hello_mojo_client.cc
diff --git a/examples/hello_mojo/hello_mojo_client.cc b/examples/hello_mojo/hello_mojo_client.cc
index 402174d229d5cac3c34a46a8bf2032f8b30aeae9..c0305a2fbffe33f7fbac085dd2ac03a3630d641c 100644
--- a/examples/hello_mojo/hello_mojo_client.cc
+++ b/examples/hello_mojo/hello_mojo_client.cc
@@ -4,15 +4,13 @@
#include <stdio.h>
-#include <memory>
#include <string>
#include "examples/hello_mojo/hello_mojo.mojom.h"
#include "mojo/public/c/system/main.h"
-#include "mojo/public/cpp/application/application_delegate.h"
-#include "mojo/public/cpp/application/application_impl.h"
-#include "mojo/public/cpp/application/application_runner.h"
+#include "mojo/public/cpp/application/application_impl_base.h"
#include "mojo/public/cpp/application/connect.h"
+#include "mojo/public/cpp/application/run_application.h"
#include "mojo/public/cpp/system/macros.h"
#include "mojo/public/cpp/utility/run_loop.h"
@@ -20,13 +18,13 @@ using examples::HelloMojoPtr;
namespace {
-class HelloMojoClientApp : public mojo::ApplicationDelegate {
+class HelloMojoClientApp : public mojo::ApplicationImplBase {
public:
HelloMojoClientApp() {}
~HelloMojoClientApp() override {}
- void Initialize(mojo::ApplicationImpl* application) override {
- mojo::ConnectToService(application->shell(), "mojo:hello_mojo_server",
+ void OnInitialize() override {
+ mojo::ConnectToService(shell(), "mojo:hello_mojo_server",
GetProxy(&hello_mojo_));
DoIt("hello");
@@ -48,7 +46,6 @@ class HelloMojoClientApp : public mojo::ApplicationDelegate {
} // namespace
MojoResult MojoMain(MojoHandle application_request) {
- return mojo::ApplicationRunner(std::unique_ptr<mojo::ApplicationDelegate>(
- new HelloMojoClientApp()))
- .Run(application_request);
+ HelloMojoClientApp hello_mojo_client_app;
+ return mojo::RunMainApplication(application_request, &hello_mojo_client_app);
}

Powered by Google App Engine
This is Rietveld 408576698