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

Unified Diff: services/service_manager/service_manager.cc

Issue 2435153004: Change Service contract to pass ServiceInfo instead of Identity (Closed)
Patch Set: . Created 4 years, 2 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/service_manager/service_manager.cc
diff --git a/services/service_manager/service_manager.cc b/services/service_manager/service_manager.cc
index 606ff04f2253cce52c600275d03050d183d3535e..ef2efc173b910a69ca53dba395f436b34faf1a54 100644
--- a/services/service_manager/service_manager.cc
+++ b/services/service_manager/service_manager.cc
@@ -254,9 +254,10 @@ class ServiceManager::Instance
uint32_t id() const { return id_; }
// Service:
- bool OnConnect(const Identity& remote_identity,
+ bool OnConnect(const ServiceInfo& remote_info,
InterfaceRegistry* registry) override {
- Instance* source = service_manager_->GetExistingInstance(remote_identity);
+ Instance* source =
+ service_manager_->GetExistingInstance(remote_info.identity);
DCHECK(source);
if (HasCapability(source->GetConnectionSpec(),
kCapability_ServiceManager)) {
@@ -574,7 +575,7 @@ mojom::ServiceRequest ServiceManager::StartEmbedderService(
////////////////////////////////////////////////////////////////////////////////
// ServiceManager, Service implementation:
-bool ServiceManager::OnConnect(const Identity& remote_identity,
+bool ServiceManager::OnConnect(const ServiceInfo& remote_info,
InterfaceRegistry* registry) {
// The only interface we expose is mojom::ServiceManager, and access to this
// interface is brokered by a policy specific to each caller, managed by the
@@ -582,13 +583,13 @@ bool ServiceManager::OnConnect(const Identity& remote_identity,
// caller's instance to continue.
Instance* instance = nullptr;
for (const auto& entry : identity_to_instance_) {
- if (entry.first == remote_identity) {
+ if (entry.first == remote_info.identity) {
instance = entry.second;
break;
}
}
DCHECK(instance);
- return instance->OnConnect(remote_identity, registry);
+ return instance->OnConnect(remote_info, registry);
}
////////////////////////////////////////////////////////////////////////////////
« no previous file with comments | « services/service_manager/service_manager.h ('k') | services/service_manager/tests/connect/connect_test_app.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698