| 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 d014a4dca565beb5e94583bc76a84d24ed2a4693..520420810df641da7f93cd657f74e20e1e911ceb 100644
|
| --- a/services/shell/public/cpp/lib/connection_impl.cc
|
| +++ b/services/shell/public/cpp/lib/connection_impl.cc
|
| @@ -19,35 +19,40 @@ namespace internal {
|
| ////////////////////////////////////////////////////////////////////////////////
|
| // ConnectionImpl, public:
|
|
|
| +ConnectionImpl::ConnectionImpl()
|
| + : allow_all_interfaces_(true),
|
| + weak_factory_(this) {}
|
| +
|
| ConnectionImpl::ConnectionImpl(
|
| const std::string& connection_name,
|
| const Identity& remote,
|
| uint32_t remote_id,
|
| - shell::mojom::InterfaceProviderPtr remote_interfaces,
|
| - shell::mojom::InterfaceProviderRequest local_interfaces,
|
| const CapabilityRequest& capability_request,
|
| State initial_state)
|
| : connection_name_(connection_name),
|
| remote_(remote),
|
| remote_id_(remote_id),
|
| state_(initial_state),
|
| - 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) {
|
| - interfaces_.Bind(std::move(local_interfaces));
|
| }
|
|
|
| -ConnectionImpl::ConnectionImpl()
|
| - : interfaces_(this),
|
| - remote_interfaces_(nullptr),
|
| - allow_all_interfaces_(true),
|
| - weak_factory_(this) {}
|
| -
|
| ConnectionImpl::~ConnectionImpl() {}
|
|
|
| +void ConnectionImpl::SetExposedInterfaces(
|
| + std::unique_ptr<InterfaceRegistry> exposed_interfaces) {
|
| + exposed_interfaces_owner_ = std::move(exposed_interfaces);
|
| + set_exposed_interfaces(exposed_interfaces_owner_.get());
|
| +}
|
| +
|
| +void ConnectionImpl::SetRemoteInterfaces(
|
| + std::unique_ptr<InterfaceProvider> remote_interfaces) {
|
| + remote_interfaces_owner_ = std::move(remote_interfaces);
|
| + set_remote_interfaces(remote_interfaces_owner_.get());
|
| +}
|
| +
|
| shell::mojom::Connector::ConnectCallback ConnectionImpl::GetConnectCallback() {
|
| return base::Bind(&ConnectionImpl::OnConnectionCompleted,
|
| weak_factory_.GetWeakPtr());
|
| @@ -69,7 +74,7 @@ const Identity& ConnectionImpl::GetRemoteIdentity() const {
|
| }
|
|
|
| void ConnectionImpl::SetConnectionLostClosure(const base::Closure& handler) {
|
| - remote_interfaces_.SetConnectionLostClosure(handler);
|
| + remote_interfaces_->SetConnectionLostClosure(handler);
|
| }
|
|
|
| shell::mojom::ConnectResult ConnectionImpl::GetResult() const {
|
| @@ -98,15 +103,15 @@ bool ConnectionImpl::AllowsInterface(const std::string& interface_name) const {
|
| }
|
|
|
| mojom::InterfaceProvider* ConnectionImpl::GetRemoteInterfaceProvider() {
|
| - return remote_interfaces_.get();
|
| + return remote_interfaces_->get();
|
| }
|
|
|
| InterfaceRegistry* ConnectionImpl::GetInterfaceRegistry() {
|
| - return &interfaces_;
|
| + return exposed_interfaces_;
|
| }
|
|
|
| InterfaceProvider* ConnectionImpl::GetRemoteInterfaces() {
|
| - return &remote_interfaces_;
|
| + return remote_interfaces_;
|
| }
|
|
|
| base::WeakPtr<Connection> ConnectionImpl::GetWeakPtr() {
|
|
|