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

Unified Diff: mojo/public/cpp/bindings/tests/versioning_test_service.cc

Issue 2004493002: Add a mojo::RunApplication() for running implementations of ApplicationImplBase. (Closed) Base URL: https://github.com/domokit/mojo.git@work790_environment_no_instantiate
Patch Set: rebased 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 | « mojo/public/cpp/application/run_application.h ('k') | mojo/services/log/cpp/log_client.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/public/cpp/bindings/tests/versioning_test_service.cc
diff --git a/mojo/public/cpp/bindings/tests/versioning_test_service.cc b/mojo/public/cpp/bindings/tests/versioning_test_service.cc
index cba93f90275bcf7a9c697fb26b8b9ed0de461a43..3f7d5036c9aae22e970fe506e247558df2056782 100644
--- a/mojo/public/cpp/bindings/tests/versioning_test_service.cc
+++ b/mojo/public/cpp/bindings/tests/versioning_test_service.cc
@@ -6,8 +6,8 @@
#include <memory>
#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"
#include "mojo/public/cpp/system/macros.h"
@@ -90,15 +90,17 @@ class HumanResourceDatabaseImpl : public HumanResourceDatabase {
std::map<uint64_t, EmployeeInfo*> employees_;
StrongBinding<HumanResourceDatabase> strong_binding_;
+
+ MOJO_DISALLOW_COPY_AND_ASSIGN(HumanResourceDatabaseImpl);
};
-class HumanResourceSystemServer : public ApplicationDelegate {
+class HumanResourceSystemServer : public ApplicationImplBase {
public:
HumanResourceSystemServer() {}
+ ~HumanResourceSystemServer() override {}
- // ApplicationDelegate implementation.
- bool ConfigureIncomingConnection(
- ServiceProviderImpl* service_provider_impl) override {
+ // |ApplicationImplBase| overrides:
+ bool OnAcceptConnection(ServiceProviderImpl* service_provider_impl) override {
service_provider_impl->AddService<HumanResourceDatabase>(
[](const ConnectionContext& connection_context,
InterfaceRequest<HumanResourceDatabase> hr_db_request) {
@@ -108,6 +110,9 @@ class HumanResourceSystemServer : public ApplicationDelegate {
});
return true;
}
+
+ private:
+ MOJO_DISALLOW_COPY_AND_ASSIGN(HumanResourceSystemServer);
};
} // namespace versioning
@@ -115,9 +120,7 @@ class HumanResourceSystemServer : public ApplicationDelegate {
} // namespace mojo
MojoResult MojoMain(MojoHandle application_request) {
- mojo::ApplicationRunner runner(
- std::unique_ptr<mojo::test::versioning::HumanResourceSystemServer>(
- new mojo::test::versioning::HumanResourceSystemServer()));
-
- return runner.Run(application_request);
+ mojo::test::versioning::HumanResourceSystemServer hr_system_server;
+ mojo::RunApplication(application_request, &hr_system_server);
+ return MOJO_RESULT_OK;
}
« no previous file with comments | « mojo/public/cpp/application/run_application.h ('k') | mojo/services/log/cpp/log_client.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698