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

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

Issue 858103002: Remove [Client=] annotation from ServiceProvider (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: rebase for trybots (no code changes from ps2) Created 5 years, 11 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/service_provider_impl.h
diff --git a/mojo/public/cpp/application/service_provider_impl.h b/mojo/public/cpp/application/service_provider_impl.h
index 45ad7b8456ea8e14c1df5a1fc235ecde2cebea53..a449124f39c1eca1bfb15ad0e5f85ff24472f8dd 100644
--- a/mojo/public/cpp/application/service_provider_impl.h
+++ b/mojo/public/cpp/application/service_provider_impl.h
@@ -6,57 +6,44 @@
#define MOJO_PUBLIC_APPLICATION_SERVICE_PROVIDER_IMPL_H_
#include "mojo/public/cpp/application/lib/service_connector.h"
+#include "mojo/public/cpp/bindings/binding.h"
#include "mojo/public/interfaces/application/service_provider.mojom.h"
namespace mojo {
namespace internal {
-class WeakServiceProvider;
class ServiceConnectorBase;
}
// Implements a registry that can be used to expose services to another app.
-class ServiceProviderImpl : public InterfaceImpl<ServiceProvider> {
+class ServiceProviderImpl : public ServiceProvider {
public:
ServiceProviderImpl();
+ explicit ServiceProviderImpl(InterfaceRequest<ServiceProvider> request);
~ServiceProviderImpl() override;
+ void Bind(InterfaceRequest<ServiceProvider> request);
+
template <typename Interface>
void AddService(InterfaceFactory<Interface>* factory) {
AddServiceConnector(
new internal::InterfaceFactoryConnector<Interface>(factory));
}
- // Returns an instance of a ServiceProvider that weakly wraps this impl's
- // connection to some other app. Whereas the lifetime of an instance of
- // ServiceProviderImpl is bound to the lifetime of the pipe it
- // encapsulates, the lifetime of the ServiceProvider instance returned by this
- // method is assumed by the caller. After the pipe is closed
- // ConnectToService() calls on this object will be silently dropped.
- // This method must only be called once per ServiceProviderImpl.
- ServiceProvider* CreateRemoteServiceProvider();
-
private:
typedef std::map<std::string, internal::ServiceConnectorBase*>
NameToServiceConnectorMap;
- friend class internal::WeakServiceProvider;
-
// Overridden from ServiceProvider:
void ConnectToService(const String& service_name,
ScopedMessagePipeHandle client_handle) override;
- // Overridden from InterfaceImpl:
- void OnConnectionError() override;
-
void AddServiceConnector(internal::ServiceConnectorBase* service_connector);
void RemoveServiceConnector(
internal::ServiceConnectorBase* service_connector);
- void ClearRemote();
-
NameToServiceConnectorMap service_connectors_;
- internal::WeakServiceProvider* remote_;
+ Binding<ServiceProvider> binding_;
MOJO_DISALLOW_COPY_AND_ASSIGN(ServiceProviderImpl);
};
« no previous file with comments | « mojo/public/cpp/application/lib/weak_service_provider.cc ('k') | mojo/public/cpp/bindings/interface_request.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698