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

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

Issue 1769163002: Add a instance groups to Connect(), and introduce an Identity struct. (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/lib/connection_impl.cc ('k') | mojo/shell/public/cpp/lib/identity.cc » ('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 9adeebdd2b8d2566fbed2bbe1b61fca791ba9ad6..cc12dbb01dd13b7d7c73d2e25153b4a1341f3ed8 100644
--- a/mojo/shell/public/cpp/lib/connector_impl.cc
+++ b/mojo/shell/public/cpp/lib/connector_impl.cc
@@ -4,14 +4,15 @@
#include "mojo/shell/public/cpp/lib/connector_impl.h"
+#include "mojo/shell/public/cpp/identity.h"
#include "mojo/shell/public/cpp/lib/connection_impl.h"
namespace mojo {
+Connector::ConnectParams::ConnectParams(const Identity& target)
+ : target_(target) {}
Connector::ConnectParams::ConnectParams(const std::string& name)
- : name_(name),
- user_id_(shell::mojom::kInheritUserID) {
-}
+ : target_(name, shell::mojom::kInheritUserID) {}
Connector::ConnectParams::~ConnectParams() {}
ConnectorImpl::ConnectorImpl(shell::mojom::ConnectorPtrInfo unbound_state)
@@ -43,7 +44,6 @@ scoped_ptr<Connection> ConnectorImpl::Connect(ConnectParams* params) {
DCHECK(thread_checker_->CalledOnValidThread());
DCHECK(params);
- std::string application_name = params->name();
// We allow all interfaces on outgoing connections since we are presumably in
// a position to know who we're talking to.
// TODO(beng): We should filter outgoing interfaces also. The shell must pass
@@ -58,14 +58,13 @@ scoped_ptr<Connection> ConnectorImpl::Connect(ConnectParams* params) {
shell::mojom::InterfaceProviderRequest remote_request =
GetProxy(&remote_interfaces);
scoped_ptr<internal::ConnectionImpl> registry(new internal::ConnectionImpl(
- application_name, application_name, shell::mojom::kInvalidInstanceID,
- params->user_id(), std::move(remote_interfaces), std::move(local_request),
- allowed, Connection::State::PENDING));
- connector_->Connect(application_name,
- params->user_id(),
- std::move(remote_request),
- std::move(local_interfaces),
- registry->GetConnectCallback());
+ params->target().name(), params->target(),
+ shell::mojom::kInvalidInstanceID, std::move(remote_interfaces),
+ std::move(local_request), allowed, Connection::State::PENDING));
+ connector_->Connect(
+ shell::mojom::Identity::From(params->target()),
+ std::move(remote_request), std::move(local_interfaces),
+ registry->GetConnectCallback());
return std::move(registry);
}
« no previous file with comments | « mojo/shell/public/cpp/lib/connection_impl.cc ('k') | mojo/shell/public/cpp/lib/identity.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698