Index: services/shell/public/cpp/lib/interface_registry.cc |
diff --git a/services/shell/public/cpp/lib/interface_registry.cc b/services/shell/public/cpp/lib/interface_registry.cc |
index d248dae83f0ae217543426c81f0352f694e97ffe..4510101c39f1334f47247a9fcf23295b6eb8eae5 100644 |
--- a/services/shell/public/cpp/lib/interface_registry.cc |
+++ b/services/shell/public/cpp/lib/interface_registry.cc |
@@ -9,15 +9,13 @@ |
namespace shell { |
InterfaceRegistry::InterfaceRegistry(Connection* connection) |
- : InterfaceRegistry(nullptr, nullptr, connection) {} |
+ : InterfaceRegistry(nullptr, connection) {} |
InterfaceRegistry::InterfaceRegistry( |
- mojom::InterfaceProviderPtr remote_interfaces, |
mojom::InterfaceProviderRequest local_interfaces_request, |
Connection* connection) |
: binding_(this), |
- connection_(connection), |
- remote_interfaces_(std::move(remote_interfaces)) { |
+ connection_(connection) { |
if (!local_interfaces_request.is_pending()) |
local_interfaces_request = GetProxy(&client_handle_); |
binding_.Bind(std::move(local_interfaces_request)); |
@@ -29,13 +27,15 @@ mojom::InterfaceProviderPtr InterfaceRegistry::TakeClientHandle() { |
return std::move(client_handle_); |
} |
-mojom::InterfaceProvider* InterfaceRegistry::GetRemoteInterfaces() { |
- return remote_interfaces_.get(); |
+void InterfaceRegistry::Bind( |
+ mojom::InterfaceProviderRequest local_interfaces_request) { |
+ binding_.Bind(std::move(local_interfaces_request)); |
} |
-void InterfaceRegistry::SetRemoteInterfacesConnectionLostClosure( |
- const base::Closure& connection_lost_closure) { |
- remote_interfaces_.set_connection_error_handler(connection_lost_closure); |
+void InterfaceRegistry::RemoveInterface(const std::string& name) { |
+ auto it = name_to_binder_.find(name); |
+ if (it != name_to_binder_.end()) |
+ name_to_binder_.erase(it); |
} |
// mojom::InterfaceProvider: |
@@ -57,19 +57,11 @@ bool InterfaceRegistry::SetInterfaceBinderForName( |
const std::string& interface_name) { |
if (!connection_ || |
(connection_ && connection_->AllowsInterface(interface_name))) { |
- RemoveInterfaceBinderForName(interface_name); |
+ RemoveInterface(interface_name); |
name_to_binder_[interface_name] = std::move(binder); |
return true; |
} |
return false; |
} |
-void InterfaceRegistry::RemoveInterfaceBinderForName( |
- const std::string& interface_name) { |
- NameToInterfaceBinderMap::iterator it = name_to_binder_.find(interface_name); |
- if (it == name_to_binder_.end()) |
- return; |
- name_to_binder_.erase(it); |
-} |
- |
} // namespace shell |