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

Unified Diff: mash/package/mash_packaged_service.cc

Issue 2476063002: Service Manager: Rework Service and ServiceContext lifetime (Closed)
Patch Set: . Created 4 years, 1 month 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 | « mash/package/mash_packaged_service.h ('k') | mash/quick_launch/quick_launch.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mash/package/mash_packaged_service.cc
diff --git a/mash/package/mash_packaged_service.cc b/mash/package/mash_packaged_service.cc
index 8cb9fb56f90c3fd942c06c8c5a3f88b9eecbb7c6..ee39940202b9456e04a919d27a9c8ef4b43eadde 100644
--- a/mash/package/mash_packaged_service.cc
+++ b/mash/package/mash_packaged_service.cc
@@ -44,14 +44,14 @@ void MashPackagedService::Create(
void MashPackagedService::CreateService(
service_manager::mojom::ServiceRequest request,
const std::string& mojo_name) {
- if (service_) {
+ if (context_) {
LOG(ERROR) << "request to create additional service " << mojo_name;
return;
}
- service_ = CreateService(mojo_name);
- if (service_) {
- service_->set_context(base::MakeUnique<service_manager::ServiceContext>(
- service_.get(), std::move(request)));
+ std::unique_ptr<service_manager::Service> service = CreateService(mojo_name);
+ if (service) {
+ context_.reset(new service_manager::ServiceContext(
+ std::move(service), std::move(request)));
return;
}
LOG(ERROR) << "unknown name " << mojo_name;
« no previous file with comments | « mash/package/mash_packaged_service.h ('k') | mash/quick_launch/quick_launch.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698