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

Unified Diff: mojo/public/cpp/application/application.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 | « content/renderer/render_thread_impl.cc ('k') | mojo/public/cpp/application/connect.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/public/cpp/application/application.h
diff --git a/mojo/public/cpp/application/application.h b/mojo/public/cpp/application/application.h
index 9f426b7bbd05d6a0f6b5eaa06bb87587cbfd0a76..99742faea94b47a47f1522766c0682d98e4b4463 100644
--- a/mojo/public/cpp/application/application.h
+++ b/mojo/public/cpp/application/application.h
@@ -78,12 +78,14 @@ class Application : public internal::ServiceConnectorBase::Owner {
template <typename Impl, typename Context>
void AddService(Context* context) {
- AddServiceConnector(new internal::ServiceConnector<Impl, Context>(context));
+ AddServiceConnector(
+ new internal::ServiceConnector<Impl, Context>(Impl::Name_, context));
}
template <typename Impl>
void AddService() {
- AddServiceConnector(new internal::ServiceConnector<Impl, void>(NULL));
+ AddServiceConnector(
+ new internal::ServiceConnector<Impl, void>(Impl::Name_, NULL));
}
template <typename Interface>
@@ -100,6 +102,7 @@ class Application : public internal::ServiceConnectorBase::Owner {
// Override this to dispatch to correct service when there's more than one.
// TODO(davemoore): Augment this with name registration.
virtual void ConnectToService(const mojo::String& url,
+ const mojo::String& name,
ScopedMessagePipeHandle client_handle)
MOJO_OVERRIDE;
@@ -116,8 +119,9 @@ class Application : public internal::ServiceConnectorBase::Owner {
virtual void RemoveServiceConnector(
internal::ServiceConnectorBase* service_connector) MOJO_OVERRIDE;
- typedef std::vector<internal::ServiceConnectorBase*> ServiceConnectorList;
- ServiceConnectorList service_connectors_;
+ typedef std::map<std::string, internal::ServiceConnectorBase*>
+ NameToServiceConnectorMap;
+ NameToServiceConnectorMap name_to_service_connector_;
};
} // namespace mojo
« no previous file with comments | « content/renderer/render_thread_impl.cc ('k') | mojo/public/cpp/application/connect.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698