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

Unified Diff: examples/echo/echo_client.cc

Issue 2012873003: More ApplicationDelegate/ApplicationRunner[Chromium] conversion. (Closed) Base URL: https://github.com/domokit/mojo.git@work791_run_app_options
Patch Set: 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
« no previous file with comments | « examples/bank_app/customer.cc ('k') | examples/echo/echo_client_sync.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: examples/echo/echo_client.cc
diff --git a/examples/echo/echo_client.cc b/examples/echo/echo_client.cc
index 0dd1dd1dcfe70929a62eef11f9dff33e3e2a05e0..beef9c11bbb12bb73a62006f7d348dd3fc679a5f 100644
--- a/examples/echo/echo_client.cc
+++ b/examples/echo/echo_client.cc
@@ -2,15 +2,12 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include <memory>
-
#include "base/logging.h"
#include "examples/echo/echo.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/utility/run_loop.h"
namespace mojo {
@@ -24,10 +21,10 @@ class ResponsePrinter {
}
};
-class EchoClientDelegate : public ApplicationDelegate {
+class EchoClientApp : public ApplicationImplBase {
public:
- void Initialize(ApplicationImpl* app) override {
- ConnectToService(app->shell(), "mojo:echo_server", GetProxy(&echo_));
+ void OnInitialize() override {
+ ConnectToService(shell(), "mojo:echo_server", GetProxy(&echo_));
echo_->EchoString("hello world", ResponsePrinter());
}
@@ -40,8 +37,6 @@ class EchoClientDelegate : public ApplicationDelegate {
} // namespace mojo
MojoResult MojoMain(MojoHandle application_request) {
- mojo::ApplicationRunner runner(
- std::unique_ptr<mojo::examples::EchoClientDelegate>(
- new mojo::examples::EchoClientDelegate()));
- return runner.Run(application_request);
+ mojo::examples::EchoClientApp echo_client_app;
+ return mojo::RunMainApplication(application_request, &echo_client_app);
}
« no previous file with comments | « examples/bank_app/customer.cc ('k') | examples/echo/echo_client_sync.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698