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

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

Issue 1776513003: Allow client process information to be passed via Connector::Connect(). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 4 years, 9 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
« no previous file with comments | « mojo/shell/public/cpp/connector.h ('k') | mojo/shell/public/interfaces/BUILD.gn » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/shell/public/cpp/lib/connector_impl.cc
diff --git a/mojo/shell/public/cpp/lib/connector_impl.cc b/mojo/shell/public/cpp/lib/connector_impl.cc
index cc12dbb01dd13b7d7c73d2e25153b4a1341f3ed8..74edbe4d1e8bc5d91b328f93caa938114b764334 100644
--- a/mojo/shell/public/cpp/lib/connector_impl.cc
+++ b/mojo/shell/public/cpp/lib/connector_impl.cc
@@ -61,10 +61,28 @@ scoped_ptr<Connection> ConnectorImpl::Connect(ConnectParams* params) {
params->target().name(), params->target(),
shell::mojom::kInvalidInstanceID, std::move(remote_interfaces),
std::move(local_request), allowed, Connection::State::PENDING));
+
+ shell::mojom::ShellClientFactoryPtr shell_client_factory;
+ shell::mojom::PIDReceiverRequest pid_receiver_request;
+ params->TakeClientProcessConnection(&shell_client_factory,
+ &pid_receiver_request);
+ shell::mojom::ClientProcessConnectionPtr client_process_connection;
+ if (shell_client_factory.is_bound() && pid_receiver_request.is_pending()) {
+ client_process_connection = shell::mojom::ClientProcessConnection::New();
+ client_process_connection->shell_client_factory =
+ shell_client_factory.PassInterface().PassHandle();
+ client_process_connection->pid_receiver_request =
+ pid_receiver_request.PassMessagePipe();
+ } else if (shell_client_factory.is_bound() ||
+ pid_receiver_request.is_pending()) {
+ NOTREACHED() << "If one of shell_client_factory or pid_receiver_request is"
+ << "valid, both must be valid.";
+ return std::move(registry);
+ }
connector_->Connect(
shell::mojom::Identity::From(params->target()),
std::move(remote_request), std::move(local_interfaces),
- registry->GetConnectCallback());
+ std::move(client_process_connection), registry->GetConnectCallback());
return std::move(registry);
}
« no previous file with comments | « mojo/shell/public/cpp/connector.h ('k') | mojo/shell/public/interfaces/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698