| 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);
|
| }
|
|
|