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) { |