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

Unified Diff: examples/apptest/example_service_application.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/apptest/example_service_application.cc
diff --git a/examples/apptest/example_service_application.cc b/examples/apptest/example_service_application.cc
index f35817339c3f1e249867b413a88a7e6c326b7da0..578bf5913f3da689ae3092febbb50ef16391c605 100644
--- a/examples/apptest/example_service_application.cc
+++ b/examples/apptest/example_service_application.cc
@@ -4,10 +4,8 @@
#include "examples/apptest/example_service_application.h"
-#include <memory>
-
#include "mojo/public/c/system/main.h"
-#include "mojo/public/cpp/application/application_runner.h"
+#include "mojo/public/cpp/application/run_application.h"
#include "mojo/public/cpp/application/service_provider_impl.h"
namespace mojo {
@@ -16,7 +14,7 @@ ExampleServiceApplication::ExampleServiceApplication() {}
ExampleServiceApplication::~ExampleServiceApplication() {}
-bool ExampleServiceApplication::ConfigureIncomingConnection(
+bool ExampleServiceApplication::OnAcceptConnection(
ServiceProviderImpl* service_provider_impl) {
service_provider_impl->AddService<ExampleService>(
[](const ConnectionContext& connection_context,
@@ -30,8 +28,7 @@ bool ExampleServiceApplication::ConfigureIncomingConnection(
} // namespace mojo
MojoResult MojoMain(MojoHandle application_request) {
- mojo::ApplicationRunner runner(
- std::unique_ptr<mojo::ExampleServiceApplication>(
- new mojo::ExampleServiceApplication()));
- return runner.Run(application_request);
+ mojo::ExampleServiceApplication example_service_application;
+ return mojo::RunMainApplication(application_request,
+ &example_service_application);
}

Powered by Google App Engine
This is Rietveld 408576698