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

Unified Diff: services/shell/service_manager.cc

Issue 2179023004: Make Service own ServiceContext. (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
« no previous file with comments | « services/shell/service_manager.h ('k') | services/shell/tests/connect/connect_test_app.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: services/shell/service_manager.cc
diff --git a/services/shell/service_manager.cc b/services/shell/service_manager.cc
index 453e6a185f3b096a475e572d6ed97740366f4f4b..90893f5e20e99d8c1d9509fe134789d868ccddd1 100644
--- a/services/shell/service_manager.cc
+++ b/services/shell/service_manager.cc
@@ -413,7 +413,7 @@ class ServiceManager::Instance
return;
}
pid_ = pid;
- service_manager_->NotifyPIDAvailable(id_, pid_);
+ service_manager_->NotifyPIDAvailable(identity_, pid_);
}
void OnServiceLost(base::WeakPtr<shell::ServiceManager> service_manager) {
@@ -594,11 +594,11 @@ void ServiceManager::OnInstanceError(Instance* instance) {
// Remove the Service Manager.
auto it = identity_to_instance_.find(identity);
DCHECK(it != identity_to_instance_.end());
- int id = instance->id();
identity_to_instance_.erase(it);
- listeners_.ForAllPtrs([this, id](mojom::ServiceManagerListener* listener) {
- listener->OnServiceStopped(id);
- });
+ listeners_.ForAllPtrs(
+ [this, identity](mojom::ServiceManagerListener* listener) {
+ listener->OnServiceStopped(mojom::Identity::From(identity));
+ });
delete instance;
if (!instance_quit_callback_.is_null())
instance_quit_callback_.Run(identity);
@@ -650,10 +650,12 @@ ServiceManager::Instance* ServiceManager::GetExistingInstance(
return nullptr;
}
-void ServiceManager::NotifyPIDAvailable(uint32_t id, base::ProcessId pid) {
- listeners_.ForAllPtrs([id, pid](mojom::ServiceManagerListener* listener) {
- listener->OnServiceStarted(id, pid);
- });
+void ServiceManager::NotifyPIDAvailable(const Identity& identity,
+ base::ProcessId pid) {
+ listeners_.ForAllPtrs(
+ [identity, pid](mojom::ServiceManagerListener* listener) {
+ listener->OnServiceStarted(mojom::Identity::From(identity), pid);
+ });
}
bool ServiceManager::ConnectToExistingInstance(
« no previous file with comments | « services/shell/service_manager.h ('k') | services/shell/tests/connect/connect_test_app.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698