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

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

Issue 1127293003: Update mojo sdk to rev f84766d3b6420b7cf6a113d9d65d73cb5fe18d90 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: formatting Created 5 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
Index: third_party/mojo/src/mojo/public/cpp/application/service_provider_impl.h
diff --git a/third_party/mojo/src/mojo/public/cpp/application/service_provider_impl.h b/third_party/mojo/src/mojo/public/cpp/application/service_provider_impl.h
index 5ef58545e34388b85c7c19a05bd82f7546abdf18..ed4de3a9312f32b18f989b92f4bce69f8a5e70ed 100644
--- a/third_party/mojo/src/mojo/public/cpp/application/service_provider_impl.h
+++ b/third_party/mojo/src/mojo/public/cpp/application/service_provider_impl.h
@@ -5,14 +5,14 @@
#ifndef MOJO_PUBLIC_APPLICATION_SERVICE_PROVIDER_IMPL_H_
#define MOJO_PUBLIC_APPLICATION_SERVICE_PROVIDER_IMPL_H_
-#include "mojo/public/cpp/application/lib/service_connector.h"
+#include <string>
+
+#include "mojo/public/cpp/application/lib/interface_factory_connector.h"
+#include "mojo/public/cpp/application/lib/service_connector_registry.h"
#include "mojo/public/cpp/bindings/binding.h"
#include "mojo/public/interfaces/application/service_provider.mojom.h"
namespace mojo {
-namespace internal {
-class ServiceConnectorBase;
-}
// Implements a registry that can be used to expose services to another app.
class ServiceProviderImpl : public ServiceProvider {
@@ -28,26 +28,23 @@ class ServiceProviderImpl : public ServiceProvider {
template <typename Interface>
void AddService(InterfaceFactory<Interface>* factory) {
- AddServiceConnector(
- new internal::InterfaceFactoryConnector<Interface>(factory));
+ SetServiceConnectorForName(
+ new internal::InterfaceFactoryConnector<Interface>(factory),
+ Interface::Name_);
}
private:
- typedef std::map<std::string, internal::ServiceConnectorBase*>
- NameToServiceConnectorMap;
-
// Overridden from ServiceProvider:
void ConnectToService(const String& service_name,
ScopedMessagePipeHandle client_handle) override;
- void AddServiceConnector(internal::ServiceConnectorBase* service_connector);
- void RemoveServiceConnector(
- internal::ServiceConnectorBase* service_connector);
-
- NameToServiceConnectorMap service_connectors_;
+ void SetServiceConnectorForName(ServiceConnector* service_connector,
+ const std::string& interface_name);
Binding<ServiceProvider> binding_;
+ internal::ServiceConnectorRegistry service_connector_registry_;
+
MOJO_DISALLOW_COPY_AND_ASSIGN(ServiceProviderImpl);
};

Powered by Google App Engine
This is Rietveld 408576698