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

Side by Side Diff: mash/package/mash_packaged_service.h

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
« no previous file with comments | « mash/login/login.cc ('k') | mash/package/mash_packaged_service.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 #ifndef MASH_PACKAGE_MASH_PACKAGED_SERVICE_H_ 5 #ifndef MASH_PACKAGE_MASH_PACKAGED_SERVICE_H_
6 #define MASH_PACKAGE_MASH_PACKAGED_SERVICE_H_ 6 #define MASH_PACKAGE_MASH_PACKAGED_SERVICE_H_
7 7
8 #include <memory> 8 #include <memory>
9 9
10 #include "mojo/public/cpp/bindings/binding_set.h" 10 #include "mojo/public/cpp/bindings/binding_set.h"
11 #include "services/service_manager/public/cpp/interface_factory.h" 11 #include "services/service_manager/public/cpp/interface_factory.h"
12 #include "services/service_manager/public/cpp/service.h" 12 #include "services/service_manager/public/cpp/service.h"
13 #include "services/service_manager/public/interfaces/service_factory.mojom.h" 13 #include "services/service_manager/public/interfaces/service_factory.mojom.h"
14 14
15 namespace service_manager {
16 class ServiceContext;
17 }
18
15 namespace mash { 19 namespace mash {
16 20
17 // MashPackagedService is a Service implementation that starts all the mash 21 // MashPackagedService is a Service implementation that starts all the mash
18 // apps. It's used when mash is packaged inside chrome or tests. To use you'll 22 // apps. It's used when mash is packaged inside chrome or tests. To use you'll
19 // need a manifest similar to what is used by chrome and browser_tests. 23 // need a manifest similar to what is used by chrome and browser_tests.
20 // Things to do when adding a new service/app: 24 // Things to do when adding a new service/app:
21 // - Add a manifest to the new service. 25 // - Add a manifest to the new service.
22 // - Update manifests of services that are going to use this new service. e.g. 26 // - Update manifests of services that are going to use this new service. e.g.
23 // chrome_manifest. 27 // chrome_manifest.
24 // - Add the new serivce to be a data_dep of the service that is using this 28 // - Add the new serivce to be a data_dep of the service that is using this
(...skipping 20 matching lines...) Expand all
45 mojo::InterfaceRequest<ServiceFactory> request) override; 49 mojo::InterfaceRequest<ServiceFactory> request) override;
46 50
47 // ServiceFactory: 51 // ServiceFactory:
48 void CreateService(service_manager::mojom::ServiceRequest request, 52 void CreateService(service_manager::mojom::ServiceRequest request,
49 const std::string& mojo_name) override; 53 const std::string& mojo_name) override;
50 54
51 private: 55 private:
52 std::unique_ptr<service_manager::Service> CreateService( 56 std::unique_ptr<service_manager::Service> CreateService(
53 const std::string& name); 57 const std::string& name);
54 58
59 std::unique_ptr<service_manager::ServiceContext> context_;
55 mojo::BindingSet<ServiceFactory> service_factory_bindings_; 60 mojo::BindingSet<ServiceFactory> service_factory_bindings_;
56 std::unique_ptr<service_manager::Service> service_;
57 61
58 DISALLOW_COPY_AND_ASSIGN(MashPackagedService); 62 DISALLOW_COPY_AND_ASSIGN(MashPackagedService);
59 }; 63 };
60 64
61 } // namespace mash 65 } // namespace mash
62 66
63 #endif // MASH_PACKAGE_MASH_PACKAGED_SERVICE_H_ 67 #endif // MASH_PACKAGE_MASH_PACKAGED_SERVICE_H_
OLDNEW
« no previous file with comments | « mash/login/login.cc ('k') | mash/package/mash_packaged_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698