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

Unified Diff: examples/apptest/example_service_application.cc

Issue 731293003: Use Binding instead of InterfaceImpl for ExampleService. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Sync and rebase. Created 6 years, 1 month 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/apptest/example_service_impl.h » ('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 993bda38dd437c312a442fbbe40f51eefa7b49d1..59a3535cefd9956c69e20262118572267dc37fb6 100644
--- a/examples/apptest/example_service_application.cc
+++ b/examples/apptest/example_service_application.cc
@@ -16,10 +16,17 @@ ExampleServiceApplication::~ExampleServiceApplication() {}
bool ExampleServiceApplication::ConfigureIncomingConnection(
ApplicationConnection* connection) {
- connection->AddService(&example_service_factory_);
+ connection->AddService<ExampleService>(this);
return true;
}
+void ExampleServiceApplication::Create(
+ ApplicationConnection* connection,
+ InterfaceRequest<ExampleService> request) {
+ // Not leaked: ExampleServiceImpl is strongly bound to the pipe.
+ new ExampleServiceImpl(request.Pass());
+}
+
} // namespace mojo
MojoResult MojoMain(MojoHandle shell_handle) {
« no previous file with comments | « examples/apptest/example_service_application.h ('k') | examples/apptest/example_service_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698