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

Unified Diff: mojo/shell/public/cpp/lib/connection_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.h ('k') | mojo/shell/public/cpp/lib/connector_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/shell/public/cpp/lib/connection_impl.cc
diff --git a/mojo/shell/public/cpp/lib/connection_impl.cc b/mojo/shell/public/cpp/lib/connection_impl.cc
index 3541f5570fb1933203695fcdd471fe706a966d27..d3585e7061867b6e7ff7043de7db5e37c7744e10 100644
--- a/mojo/shell/public/cpp/lib/connection_impl.cc
+++ b/mojo/shell/public/cpp/lib/connection_impl.cc
@@ -21,18 +21,16 @@ namespace internal {
ConnectionImpl::ConnectionImpl(
const std::string& connection_name,
- const std::string& remote_name,
+ const Identity& remote,
uint32_t remote_id,
- const std::string& remote_user_id,
shell::mojom::InterfaceProviderPtr remote_interfaces,
shell::mojom::InterfaceProviderRequest local_interfaces,
const std::set<std::string>& allowed_interfaces,
State initial_state)
: connection_name_(connection_name),
- remote_name_(remote_name),
- state_(initial_state),
+ remote_(remote),
remote_id_(remote_id),
- remote_user_id_(remote_user_id),
+ state_(initial_state),
local_registry_(std::move(local_interfaces), this),
remote_interfaces_(std::move(remote_interfaces)),
allowed_interfaces_(allowed_interfaces),
@@ -59,12 +57,8 @@ const std::string& ConnectionImpl::GetConnectionName() {
return connection_name_;
}
-const std::string& ConnectionImpl::GetRemoteApplicationName() {
- return remote_name_;
-}
-
-const std::string& ConnectionImpl::GetRemoteUserID() const {
- return remote_user_id_;
+const Identity& ConnectionImpl::GetRemoteIdentity() const {
+ return remote_;
}
void ConnectionImpl::SetConnectionLostClosure(const Closure& handler) {
@@ -118,7 +112,7 @@ void ConnectionImpl::OnConnectionCompleted(shell::mojom::ConnectResult result,
state_ = result_ == shell::mojom::ConnectResult::SUCCEEDED ?
State::CONNECTED : State::DISCONNECTED;
remote_id_ = target_application_id;
- remote_user_id_= target_user_id;
+ remote_.set_user_id(target_user_id);
std::vector<Closure> callbacks;
callbacks.swap(connection_completed_callbacks_);
for (auto callback : callbacks)
« no previous file with comments | « mojo/shell/public/cpp/lib/connection_impl.h ('k') | mojo/shell/public/cpp/lib/connector_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698