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

Unified Diff: examples/indirect_service/indirect_integer_service.cc

Issue 2019743002: Yet more ApplicationDelegate/ApplicationRunner conversion. (Closed) Base URL: https://github.com/domokit/mojo.git@master
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_server.cc ('k') | examples/indirect_service/integer_service.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: examples/indirect_service/indirect_integer_service.cc
diff --git a/examples/indirect_service/indirect_integer_service.cc b/examples/indirect_service/indirect_integer_service.cc
index 6d9425c5a50e74217a3c25769fb908d3e1a9f1b1..f8dc3c9e92ffc4c61ba243b96ccc09e168761f3a 100644
--- a/examples/indirect_service/indirect_integer_service.cc
+++ b/examples/indirect_service/indirect_integer_service.cc
@@ -2,12 +2,10 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include <memory>
-
#include "examples/indirect_service/indirect_service_demo.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/binding.h"
#include "mojo/public/cpp/bindings/strong_binding.h"
@@ -49,10 +47,9 @@ private:
StrongBinding<IndirectIntegerService> binding_;
};
-class IndirectIntegerServiceAppDelegate : public ApplicationDelegate {
+class IndirectIntegerServiceApp : public ApplicationImplBase {
public:
- bool ConfigureIncomingConnection(
- ServiceProviderImpl* service_provider_impl) override {
+ bool OnAcceptConnection(ServiceProviderImpl* service_provider_impl) override {
service_provider_impl->AddService<IndirectIntegerService>(
[](const ConnectionContext& connection_context,
InterfaceRequest<IndirectIntegerService> request) {
@@ -66,8 +63,7 @@ class IndirectIntegerServiceAppDelegate : public ApplicationDelegate {
} // namespace mojo
MojoResult MojoMain(MojoHandle application_request) {
- mojo::ApplicationRunner runner(
- std::unique_ptr<mojo::examples::IndirectIntegerServiceAppDelegate>(
- new mojo::examples::IndirectIntegerServiceAppDelegate()));
- return runner.Run(application_request);
+ mojo::examples::IndirectIntegerServiceApp indirect_integer_service_app;
+ return mojo::RunMainApplication(application_request,
+ &indirect_integer_service_app);
}
« no previous file with comments | « examples/echo/echo_server.cc ('k') | examples/indirect_service/integer_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698