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

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

Issue 2090773003: Add ability to bind a different InterfaceRegistry/InterfaceProvider to an incoming Connection. (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/connector_impl.cc
diff --git a/services/shell/public/cpp/lib/connector_impl.cc b/services/shell/public/cpp/lib/connector_impl.cc
index 1bd9e68924ceae8ffc2601469b9afb26974e2ee9..3d757d9b148187b0792f25ab703233e50fe3001e 100644
--- a/services/shell/public/cpp/lib/connector_impl.cc
+++ b/services/shell/public/cpp/lib/connector_impl.cc
@@ -60,8 +60,25 @@ std::unique_ptr<Connection> ConnectorImpl::Connect(ConnectParams* params) {
std::unique_ptr<internal::ConnectionImpl> registry(
new internal::ConnectionImpl(
params->target().name(), params->target(), mojom::kInvalidInstanceID,
- std::move(remote_interfaces), std::move(local_request), request,
- Connection::State::PENDING));
+ request, Connection::State::PENDING));
+ if (params->exposed_interfaces()) {
+ params->exposed_interfaces()->Bind(std::move(local_request));
+ registry->set_exposed_interfaces(params->exposed_interfaces());
+ } else {
+ std::unique_ptr<InterfaceRegistry> exposed_interfaces(
+ new InterfaceRegistry(registry.get()));
+ exposed_interfaces->Bind(std::move(local_request));
+ registry->SetExposedInterfaces(std::move(exposed_interfaces));
+ }
+ if (params->remote_interfaces()) {
+ params->remote_interfaces()->Bind(std::move(remote_interfaces));
+ registry->set_remote_interfaces(params->remote_interfaces());
+ } else {
+ std::unique_ptr<InterfaceProvider> remote_interface_provider(
+ new InterfaceProvider);
+ remote_interface_provider->Bind(std::move(remote_interfaces));
+ registry->SetRemoteInterfaces(std::move(remote_interface_provider));
+ }
mojom::ShellClientPtr shell_client;
mojom::PIDReceiverRequest pid_receiver_request;
« no previous file with comments | « services/shell/public/cpp/lib/connection_impl.cc ('k') | services/shell/public/cpp/lib/interface_provider.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698