Index: services/shell/public/cpp/interface_registry.h |
diff --git a/services/shell/public/cpp/interface_registry.h b/services/shell/public/cpp/interface_registry.h |
index e2c26332bd191bc8a647002dced81cbe8dbbee01..5d03d46fd53dcafa66425b62c0d41a6f969934a7 100644 |
--- a/services/shell/public/cpp/interface_registry.h |
+++ b/services/shell/public/cpp/interface_registry.h |
@@ -51,10 +51,6 @@ class InterfaceRegistry : public mojom::InterfaceProvider { |
base::WrapUnique(binder), interface_name); |
} |
- void RemoveInterfaceBinderForName(const std::string& interface_name) { |
- registry_->RemoveInterfaceBinderForName(interface_name); |
- } |
- |
private: |
InterfaceRegistry* registry_; |
DISALLOW_COPY_AND_ASSIGN(TestApi); |
@@ -68,8 +64,7 @@ class InterfaceRegistry : public mojom::InterfaceProvider { |
explicit InterfaceRegistry(Connection* connection); |
// Construct with an InterfaceProviderRequest and a Connection (which may be |
// null, see note above about filtering). |
- InterfaceRegistry(mojom::InterfaceProviderPtr remote_interfaces, |
- mojom::InterfaceProviderRequest local_interfaces_request, |
+ InterfaceRegistry(mojom::InterfaceProviderRequest local_interfaces_request, |
Connection* connection); |
~InterfaceRegistry() override; |
@@ -77,12 +72,7 @@ class InterfaceRegistry : public mojom::InterfaceProvider { |
// constructor. |
mojom::InterfaceProviderPtr TakeClientHandle(); |
Ken Rockot(use gerrit already)
2016/06/16 23:48:58
Given that you're adding a Bind method, let's get
|
- // Returns a raw pointer to the remote InterfaceProvider. |
- mojom::InterfaceProvider* GetRemoteInterfaces(); |
- |
- // Sets a closure to be run when the remote InterfaceProvider pipe is closed. |
- void SetRemoteInterfacesConnectionLostClosure( |
- const base::Closure& connection_lost_closure); |
+ void Bind(mojom::InterfaceProviderRequest local_interfaces_request); |
Ken Rockot(use gerrit already)
2016/06/16 23:48:58
nit: Document this, specifically worth noting that
|
// Allows |Interface| to be exposed via this registry. Requests to bind will |
// be handled by |factory|. Returns true if the interface was exposed, false |
@@ -109,23 +99,11 @@ class InterfaceRegistry : public mojom::InterfaceProvider { |
Interface::Name_); |
} |
- // Binds |ptr| to an implementation of Interface in the remote application. |
- // |ptr| can immediately be used to start sending requests to the remote |
- // interface. |
template <typename Interface> |
- void GetInterface(mojo::InterfacePtr<Interface>* ptr) { |
- mojo::MessagePipe pipe; |
- ptr->Bind(mojo::InterfacePtrInfo<Interface>(std::move(pipe.handle0), 0u)); |
- |
- // Local binders can be registered via TestApi. |
- auto it = name_to_binder_.find(Interface::Name_); |
- if (it != name_to_binder_.end()) { |
- it->second->BindInterface(connection_, Interface::Name_, |
- std::move(pipe.handle1)); |
- return; |
- } |
- remote_interfaces_->GetInterface(Interface::Name_, std::move(pipe.handle1)); |
+ void RemoveInterface() { |
+ RemoveInterface(Interface::Name_); |
} |
+ void RemoveInterface(const std::string& name); |
private: |
using NameToInterfaceBinderMap = |
@@ -140,16 +118,12 @@ class InterfaceRegistry : public mojom::InterfaceProvider { |
bool SetInterfaceBinderForName(std::unique_ptr<InterfaceBinder> binder, |
const std::string& name); |
- void RemoveInterfaceBinderForName(const std::string& interface_name); |
- |
mojom::InterfaceProviderPtr client_handle_; |
mojo::Binding<mojom::InterfaceProvider> binding_; |
Connection* connection_; |
NameToInterfaceBinderMap name_to_binder_; |
- mojom::InterfaceProviderPtr remote_interfaces_; |
- |
DISALLOW_COPY_AND_ASSIGN(InterfaceRegistry); |
}; |