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

Unified Diff: examples/indirect_service/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/indirect_service/indirect_integer_service.cc ('k') | services/device_info/device_info.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: examples/indirect_service/integer_service.cc
diff --git a/examples/indirect_service/integer_service.cc b/examples/indirect_service/integer_service.cc
index dac270376f4167841fec94a4958c8bd260eb2efd..0db7eaf2fe2a9559dc43f9f091c335d80b5e86db 100644
--- a/examples/indirect_service/integer_service.cc
+++ b/examples/indirect_service/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/strong_binding.h"
@@ -29,10 +27,9 @@ class IntegerServiceImpl : public IntegerService {
StrongBinding<IntegerService> binding_;
};
-class IntegerServiceAppDelegate : public ApplicationDelegate {
+class IntegerServiceApp : public ApplicationImplBase {
public:
- bool ConfigureIncomingConnection(
- ServiceProviderImpl* service_provider_impl) override {
+ bool OnAcceptConnection(ServiceProviderImpl* service_provider_impl) override {
service_provider_impl->AddService<IntegerService>(
[](const ConnectionContext& connection_context,
InterfaceRequest<IntegerService> request) {
@@ -46,9 +43,7 @@ class IntegerServiceAppDelegate : public ApplicationDelegate {
} // namespace mojo
MojoResult MojoMain(MojoHandle application_request) {
- mojo::ApplicationRunner runner(
- std::unique_ptr<mojo::examples::IntegerServiceAppDelegate>(
- new mojo::examples::IntegerServiceAppDelegate));
- return runner.Run(application_request);
+ mojo::examples::IntegerServiceApp integer_service_app;
+ return mojo::RunMainApplication(application_request, &integer_service_app);
}
« no previous file with comments | « examples/indirect_service/indirect_integer_service.cc ('k') | services/device_info/device_info.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698