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

Unified Diff: mojo/public/cpp/application/lib/service_connector.h

Issue 337533002: Introduce internal::ServiceRegistry to prepare for ServiceProvider split. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merge problems Created 6 years, 6 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/lib/service_connector.h
diff --git a/mojo/public/cpp/application/lib/service_connector.h b/mojo/public/cpp/application/lib/service_connector.h
index b52140b03b82e9d7c0e628ffe2fb14feb6de8024..30786adb55dd1dd64e219c064386e09b1bd15bff 100644
--- a/mojo/public/cpp/application/lib/service_connector.h
+++ b/mojo/public/cpp/application/lib/service_connector.h
@@ -9,6 +9,7 @@
#include <vector>
+#include "mojo/public/cpp/application/lib/service_registry.h"
#include "mojo/public/interfaces/service_provider/service_provider.mojom.h"
namespace mojo {
@@ -41,6 +42,8 @@ private:
}
ServiceConnector<ServiceImpl, Context>* service_connector_;
+
+ MOJO_DISALLOW_COPY_AND_ASSIGN(ServiceConnection);
};
template <typename ServiceImpl, typename Context>
@@ -60,33 +63,19 @@ struct ServiceConstructor<ServiceImpl, void> {
class ServiceConnectorBase {
public:
- class Owner : public ServiceProvider {
- public:
- Owner();
- Owner(ScopedMessagePipeHandle service_provider_handle);
- virtual ~Owner();
- virtual void AddServiceConnector(
- internal::ServiceConnectorBase* service_connector) = 0;
- virtual void RemoveServiceConnector(
- internal::ServiceConnectorBase* service_connector) = 0;
-
- protected:
- void set_service_connector_owner(ServiceConnectorBase* service_connector,
- Owner* owner) {
- service_connector->owner_ = owner;
- }
- ServiceProviderPtr service_provider_;
- };
- ServiceConnectorBase(const std::string& name) : name_(name), owner_(NULL) {}
+ ServiceConnectorBase(const std::string& name);
virtual ~ServiceConnectorBase();
virtual void ConnectToService(const std::string& url,
const std::string& name,
ScopedMessagePipeHandle client_handle) = 0;
std::string name() const { return name_; }
+ void set_registry(ServiceRegistry* registry) { registry_ = registry; }
protected:
std::string name_;
- Owner* owner_;
+ ServiceRegistry* registry_;
+
+ MOJO_DISALLOW_COPY_AND_ASSIGN(ServiceConnectorBase);
};
template <class ServiceImpl, typename Context=void>
@@ -134,6 +123,8 @@ class ServiceConnector : public internal::ServiceConnectorBase {
typedef std::vector<ServiceImpl*> ConnectionList;
ConnectionList connections_;
Context* context_;
+
+ MOJO_DISALLOW_COPY_AND_ASSIGN(ServiceConnector);
};
} // namespace internal

Powered by Google App Engine
This is Rietveld 408576698