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

Unified Diff: examples/apptest/example_service_application.cc

Issue 1975253002: ApplicationConnection devolution, part 2.1. (Closed) Base URL: https://github.com/domokit/mojo.git@work792-x-work791_service_registry_spimpl
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/apptest/example_service_application.h ('k') | examples/bank_app/bank.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: examples/apptest/example_service_application.cc
diff --git a/examples/apptest/example_service_application.cc b/examples/apptest/example_service_application.cc
index 0487194fdba9352658fdde63a1ff149933028cad..de483b59b7e7c8e3078c47eeb5610ecef7c4015b 100644
--- a/examples/apptest/example_service_application.cc
+++ b/examples/apptest/example_service_application.cc
@@ -18,17 +18,15 @@ ExampleServiceApplication::~ExampleServiceApplication() {}
bool ExampleServiceApplication::ConfigureIncomingConnection(
ApplicationConnection* connection) {
- connection->AddService<ExampleService>(this);
+ connection->GetServiceProviderImpl().AddService<ExampleService>(
+ [](const ConnectionContext& connection_context,
+ InterfaceRequest<ExampleService> example_service_request) {
+ // Not leaked: ExampleServiceImpl is strongly bound to the pipe.
+ new ExampleServiceImpl(example_service_request.Pass());
+ });
return true;
}
-void ExampleServiceApplication::Create(
- const ConnectionContext& connection_context,
- InterfaceRequest<ExampleService> request) {
- // Not leaked: ExampleServiceImpl is strongly bound to the pipe.
- new ExampleServiceImpl(request.Pass());
-}
-
} // namespace mojo
MojoResult MojoMain(MojoHandle application_request) {
« no previous file with comments | « examples/apptest/example_service_application.h ('k') | examples/bank_app/bank.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698