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

Unified Diff: services/shell/public/cpp/lib/connection_impl.cc

Issue 2075003002: Separate Remote InterfaceProvider again, and add a new client lib type for it. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 4 years, 6 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: 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();
}
« no previous file with comments | « services/shell/public/cpp/lib/connection_impl.h ('k') | services/shell/public/cpp/lib/interface_registry.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698