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

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

Issue 304273004: Add name to services (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Get chrome to build Created 6 years, 7 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
« no previous file with comments | « mojo/public/cpp/application/lib/application.cc ('k') | mojo/public/cpp/bindings/lib/no_interface.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 3a7e596f084311b6b2193b44975c4e20735722c0..914b2a924e85614cb08c9eacf93f269c889a1b14 100644
--- a/mojo/public/cpp/application/lib/service_connector.h
+++ b/mojo/public/cpp/application/lib/service_connector.h
@@ -77,19 +77,23 @@ class ServiceConnectorBase {
}
ServiceProviderPtr service_provider_;
};
- ServiceConnectorBase() : owner_(NULL) {}
+ ServiceConnectorBase(const std::string& name) : name_(name), owner_(NULL) {}
virtual ~ServiceConnectorBase();
virtual void ConnectToService(const std::string& url,
+ const std::string& name,
ScopedMessagePipeHandle client_handle) = 0;
+ std::string name() const { return name_; }
protected:
+ std::string name_;
Owner* owner_;
};
template <class ServiceImpl, typename Context=void>
class ServiceConnector : public internal::ServiceConnectorBase {
public:
- ServiceConnector(Context* context = NULL) : context_(context) {}
+ ServiceConnector(const std::string& name, Context* context = NULL)
+ : ServiceConnectorBase(name), context_(context) {}
virtual ~ServiceConnector() {
ConnectionList doomed;
@@ -102,6 +106,7 @@ class ServiceConnector : public internal::ServiceConnectorBase {
}
virtual void ConnectToService(const std::string& url,
+ const std::string& name,
ScopedMessagePipeHandle handle) MOJO_OVERRIDE {
ServiceConnection<ServiceImpl, Context>* impl =
ServiceConstructor<ServiceImpl, Context>::New(context_);
« no previous file with comments | « mojo/public/cpp/application/lib/application.cc ('k') | mojo/public/cpp/bindings/lib/no_interface.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698