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

Unified Diff: examples/echo/echo_client_sync.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/echo/echo_client.cc ('k') | examples/indirect_service/indirect_service_demo.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: examples/echo/echo_client_sync.cc
diff --git a/examples/echo/echo_client_sync.cc b/examples/echo/echo_client_sync.cc
index 8fb9357afcf8c156db939613bc90bd433fa66123..50e52152a11fcb3d32f839d4743d136a08110739 100644
--- a/examples/echo/echo_client_sync.cc
+++ b/examples/echo/echo_client_sync.cc
@@ -6,15 +6,11 @@
// is the blocking, synchronous version of mojom interface calls (typically used
// via InterfacePtr<>).
-#include <memory>
-#include <utility>
-
#include "examples/echo/echo.mojom-sync.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/bindings/synchronous_interface_ptr.h"
#include "mojo/public/cpp/environment/logging.h"
#include "mojo/public/cpp/utility/run_loop.h"
@@ -22,12 +18,11 @@
namespace mojo {
namespace examples {
-class EchoClientDelegate : public ApplicationDelegate {
+class EchoClientApp : public ApplicationImplBase {
public:
- void Initialize(ApplicationImpl* app) override {
+ void OnInitialize() override {
SynchronousInterfacePtr<Echo> echo;
- ConnectToService(app->shell(), "mojo:echo_server",
- GetSynchronousProxy(&echo));
+ ConnectToService(shell(), "mojo:echo_server", GetSynchronousProxy(&echo));
mojo::String out = "yo!";
MOJO_CHECK(echo->EchoString("hello", &out));
@@ -40,8 +35,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/echo/echo_client.cc ('k') | examples/indirect_service/indirect_service_demo.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698