Index: mojo/dbus/dbus_external_service.h |
diff --git a/mojo/dbus/dbus_external_service.h b/mojo/dbus/dbus_external_service.h |
index 77e9e4be2df38d630a280a3f25e58405f8e3c105..46b51f0fd790f7619f96cd2f0ecdfdf8ec304297 100644 |
--- a/mojo/dbus/dbus_external_service.h |
+++ b/mojo/dbus/dbus_external_service.h |
@@ -50,8 +50,10 @@ class DBusExternalServiceBase { |
}; |
template <class ServiceImpl> |
-class DBusExternalService : public DBusExternalServiceBase, |
- public ApplicationDelegate { |
+class DBusExternalService |
+ : public DBusExternalServiceBase, |
+ public ApplicationDelegate, |
+ public InterfaceFactory<typename ServiceImpl::ImplementedInterface> { |
public: |
explicit DBusExternalService(const std::string& service_name) |
: DBusExternalServiceBase(service_name) { |
@@ -60,10 +62,17 @@ class DBusExternalService : public DBusExternalServiceBase, |
virtual bool ConfigureIncomingConnection(ApplicationConnection* connection) |
MOJO_OVERRIDE { |
- connection->AddService<ServiceImpl>(); |
+ connection->AddServiceFactory(this); |
return true; |
} |
+ virtual void Create( |
+ ApplicationConnection* connection, |
+ InterfaceRequest<typename ServiceImpl::ImplementedInterface> request) |
+ MOJO_OVERRIDE { |
+ mojo::BindToRequest(new ServiceImpl, &request); |
+ } |
+ |
protected: |
virtual void Connect(ScopedMessagePipeHandle client_handle) OVERRIDE { |
external_service_.reset(BindToPipe(new Impl(this), client_handle.Pass())); |