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

Unified Diff: mojo/public/cpp/application/application_connection.h

Issue 380413003: Mojo: Use InterfaceFactory<Interface> for service registration (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: specify ownership in the Bind call 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/public/cpp/application/application_connection.h
diff --git a/mojo/public/cpp/application/application_connection.h b/mojo/public/cpp/application/application_connection.h
index 2044af10a5a86cd935438839d92dc5a939abb25e..4aacab31e3e86023baa417fcb1881fc8e3e52084 100644
--- a/mojo/public/cpp/application/application_connection.h
+++ b/mojo/public/cpp/application/application_connection.h
@@ -7,6 +7,7 @@
#include <string>
+#include "mojo/public/cpp/application/interface_provider.h"
#include "mojo/public/cpp/application/lib/service_connector.h"
namespace mojo {
@@ -60,6 +61,12 @@ class ApplicationConnection {
context));
}
+ template <typename Interface>
+ void AddServiceProvider(InterfaceProvider<Interface>* provider) {
+ AddServiceConnector(
+ new internal::InterfaceProviderConnector<Interface>(provider));
+ }
+
// Impl’s constructor will receive one argument:
// Impl::Impl(Application::Context* app_context)
template <typename Impl>

Powered by Google App Engine
This is Rietveld 408576698