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

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: 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/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>
« no previous file with comments | « no previous file | mojo/public/cpp/application/interface_provider.h » ('j') | mojo/public/cpp/application/interface_provider.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698