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

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

Issue 2182643003: Remove shell::Connection* parameter to InterfaceFactory<T>::Create() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 4 years, 5 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/interface_registry.cc
diff --git a/services/shell/public/cpp/lib/interface_registry.cc b/services/shell/public/cpp/lib/interface_registry.cc
index b585eaee26654e0908cc5ed5ded2914e38909b1d..cb00cc9c739da738ff235926b6b7818c6965faf2 100644
--- a/services/shell/public/cpp/lib/interface_registry.cc
+++ b/services/shell/public/cpp/lib/interface_registry.cc
@@ -64,7 +64,11 @@ void InterfaceRegistry::GetInterface(const mojo::String& interface_name,
auto iter = name_to_binder_.find(interface_name);
if (iter != name_to_binder_.end()) {
- iter->second->BindInterface(connection_, interface_name, std::move(handle));
+ Identity remote_identity =
+ connection_ ? connection_->GetRemoteIdentity() : Identity();
+ iter->second->BindInterface(remote_identity,
+ interface_name,
+ std::move(handle));
} else if (connection_ && !connection_->AllowsInterface(interface_name)) {
LOG(ERROR) << "Connection CapabilityFilter prevented binding to "
<< "interface: " << interface_name << " connection_name:"
@@ -72,6 +76,8 @@ void InterfaceRegistry::GetInterface(const mojo::String& interface_name,
<< connection_->GetRemoteIdentity().name();
} else if (!default_binder_.is_null()) {
default_binder_.Run(interface_name, std::move(handle));
+ } else {
+ LOG(ERROR) << "Failed to locate a binder for interface: " << interface_name;
}
}

Powered by Google App Engine
This is Rietveld 408576698