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

Unified Diff: mojo/services/test_service/test_service_application.cc

Issue 380413003: Mojo: Use InterfaceFactory<Interface> for service registration (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: some InterfaceProvider impls for common cases Created 6 years, 5 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
Index: mojo/services/test_service/test_service_application.cc
diff --git a/mojo/services/test_service/test_service_application.cc b/mojo/services/test_service/test_service_application.cc
index 097f368bc6593e45abeae8c594b9e0a23f669738..b605b8b64d5d75e2e9ce7676466a58621ba56b96 100644
--- a/mojo/services/test_service/test_service_application.cc
+++ b/mojo/services/test_service/test_service_application.cc
@@ -22,11 +22,23 @@ TestServiceApplication::~TestServiceApplication() {
bool TestServiceApplication::ConfigureIncomingConnection(
ApplicationConnection* connection) {
- connection->AddService<TestServiceImpl>(this);
- connection->AddService<TestTimeServiceImpl>();
+ connection->AddServiceProvider<TestService>(this);
+ connection->AddServiceProvider<TestTimeService>(this);
return true;
}
+void TestServiceApplication::BindToRequest(
+ ApplicationConnection* connection,
+ InterfaceRequest<TestService> request) {
+ mojo::BindToRequest(new TestServiceImpl(connection, this), &request);
+}
+
+void TestServiceApplication::BindToRequest(
+ ApplicationConnection* connection,
+ InterfaceRequest<TestTimeService> request) {
+ mojo::BindToRequest(new TestTimeServiceImpl(connection), &request);
+}
+
void TestServiceApplication::AddRef() {
assert(ref_count_ >= 0);
ref_count_++;

Powered by Google App Engine
This is Rietveld 408576698