Index: services/shell/public/cpp/lib/connection_impl.cc |
diff --git a/services/shell/public/cpp/lib/connection_impl.cc b/services/shell/public/cpp/lib/connection_impl.cc |
index acafa89ee5cc66564360f10da54f59777ce94ef9..d6ebd70f995aa8ec472f7f278cf2faa806227bd4 100644 |
--- a/services/shell/public/cpp/lib/connection_impl.cc |
+++ b/services/shell/public/cpp/lib/connection_impl.cc |
@@ -31,18 +31,18 @@ ConnectionImpl::ConnectionImpl( |
remote_(remote), |
remote_id_(remote_id), |
state_(initial_state), |
- interfaces_(std::move(remote_interfaces), |
- std::move(local_interfaces), |
- this), |
+ interfaces_(this), |
+ remote_interfaces_(std::move(remote_interfaces)), |
capability_request_(capability_request), |
allow_all_interfaces_(capability_request.interfaces.size() == 1 && |
capability_request.interfaces.count("*") == 1), |
- weak_factory_(this) {} |
+ weak_factory_(this) { |
+ interfaces_.Bind(std::move(local_interfaces)); |
+} |
ConnectionImpl::ConnectionImpl() |
- : interfaces_(shell::mojom::InterfaceProviderPtr(), |
- shell::mojom::InterfaceProviderRequest(), |
- this), |
+ : interfaces_(this), |
+ remote_interfaces_(nullptr), |
allow_all_interfaces_(true), |
weak_factory_(this) {} |
@@ -69,7 +69,7 @@ const Identity& ConnectionImpl::GetRemoteIdentity() const { |
} |
void ConnectionImpl::SetConnectionLostClosure(const base::Closure& handler) { |
- interfaces_.SetRemoteInterfacesConnectionLostClosure(handler); |
+ remote_interfaces_.SetConnectionLostClosure(handler); |
} |
shell::mojom::ConnectResult ConnectionImpl::GetResult() const { |
@@ -97,10 +97,18 @@ bool ConnectionImpl::AllowsInterface(const std::string& interface_name) const { |
capability_request_.interfaces.count(interface_name); |
} |
+mojom::InterfaceProvider* ConnectionImpl::GetRemoteInterfaceProvider() { |
+ return remote_interfaces_.GetInterfaceProvider(); |
+} |
+ |
InterfaceRegistry* ConnectionImpl::GetInterfaceRegistry() { |
return &interfaces_; |
} |
+RemoteInterfaceRegistry* ConnectionImpl::GetRemoteInterfaceRegistry() { |
+ return &remote_interfaces_; |
+} |
+ |
base::WeakPtr<Connection> ConnectionImpl::GetWeakPtr() { |
return weak_factory_.GetWeakPtr(); |
} |