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

Unified Diff: examples/hello_mojo/hello_mojo_server.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_server.cc
diff --git a/examples/hello_mojo/hello_mojo_server.cc b/examples/hello_mojo/hello_mojo_server.cc
index 6ad9a5259cc1bc31997547776ca70a8d1bd56098..2cde005534ead56a01cdcfb2450a54505d49e729 100644
--- a/examples/hello_mojo/hello_mojo_server.cc
+++ b/examples/hello_mojo/hello_mojo_server.cc
@@ -2,14 +2,13 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include <memory>
#include <string>
#include <utility>
#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_runner.h"
+#include "mojo/public/cpp/application/application_impl_base.h"
+#include "mojo/public/cpp/application/run_application.h"
#include "mojo/public/cpp/application/service_provider_impl.h"
#include "mojo/public/cpp/bindings/interface_request.h"
#include "mojo/public/cpp/bindings/strong_binding.h"
@@ -37,13 +36,13 @@ class HelloMojoImpl : public HelloMojo {
MOJO_DISALLOW_COPY_AND_ASSIGN(HelloMojoImpl);
};
-class HelloMojoServerApp : public mojo::ApplicationDelegate {
+class HelloMojoServerApp : public mojo::ApplicationImplBase {
public:
HelloMojoServerApp() {}
~HelloMojoServerApp() override {}
- // |mojo::ApplicationDelegate| implementation:
- bool ConfigureIncomingConnection(
+ // |mojo::ApplicationImplBase| override:
+ bool OnAcceptConnection(
mojo::ServiceProviderImpl* service_provider_impl) override {
service_provider_impl->AddService<HelloMojo>(
[](const mojo::ConnectionContext& connection_context,
@@ -60,7 +59,6 @@ class HelloMojoServerApp : public mojo::ApplicationDelegate {
} // namespace
MojoResult MojoMain(MojoHandle application_request) {
- return mojo::ApplicationRunner(std::unique_ptr<mojo::ApplicationDelegate>(
- new HelloMojoServerApp()))
- .Run(application_request);
+ HelloMojoServerApp hello_mojo_server_app;
+ return mojo::RunMainApplication(application_request, &hello_mojo_server_app);
}

Powered by Google App Engine
This is Rietveld 408576698