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

Side by Side Diff: services/service_manager/public/cpp/lib/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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "services/service_manager/public/cpp/service.h" 5 #include "services/service_manager/public/cpp/service.h"
6 6
7 #include "services/service_manager/public/cpp/service_context.h"
8 #include "services/service_manager/public/cpp/service_info.h"
9
10 namespace service_manager { 7 namespace service_manager {
11 8
12 Service::Service() {}
13 Service::~Service() {} 9 Service::~Service() {}
14 10
15 void Service::OnStart(const ServiceInfo& info) {} 11 void Service::OnStart(ServiceContext* context) {}
16
17 bool Service::OnConnect(const ServiceInfo& remote_info,
18 InterfaceRegistry* registry) {
19 return false;
20 }
21 12
22 bool Service::OnStop() { return true; } 13 bool Service::OnStop() { return true; }
23 14
24 Connector* Service::connector() {
25 return context_->connector();
26 }
27
28 ServiceContext* Service::context() {
29 return context_.get();
30 }
31
32 void Service::set_context(std::unique_ptr<ServiceContext> context) {
33 context_ = std::move(context);
34 }
35
36 } // namespace service_manager 15 } // namespace service_manager
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698