| OLD | NEW |
| 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" |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 // - Add a manifest to the new service. | 21 // - Add a manifest to the new service. |
| 22 // - Update manifests of services that are going to use this new service. e.g. | 22 // - Update manifests of services that are going to use this new service. e.g. |
| 23 // chrome_manifest. | 23 // chrome_manifest. |
| 24 // - Add the new serivce to be a data_dep of the service that is using this | 24 // - Add the new serivce to be a data_dep of the service that is using this |
| 25 // new service. | 25 // new service. |
| 26 // - Add the new service to chrome_mash's deps section and packaged_services | 26 // - Add the new service to chrome_mash's deps section and packaged_services |
| 27 // section. | 27 // section. |
| 28 // - Add the new service to mash_browser_tests's deps section and | 28 // - Add the new service to mash_browser_tests's deps section and |
| 29 // packaged_services section. | 29 // packaged_services section. |
| 30 // - Add an entry for the new service in MashPackagedService::CreateService(). | 30 // - Add an entry for the new service in MashPackagedService::CreateService(). |
| 31 class MashPackagedService | 31 class MashPackagedService : public service_manager::Service, |
| 32 : public shell::Service, | 32 public service_manager::mojom::ServiceFactory, |
| 33 public shell::mojom::ServiceFactory, | 33 public service_manager::InterfaceFactory< |
| 34 public shell::InterfaceFactory<shell::mojom::ServiceFactory> { | 34 service_manager::mojom::ServiceFactory> { |
| 35 public: | 35 public: |
| 36 MashPackagedService(); | 36 MashPackagedService(); |
| 37 ~MashPackagedService() override; | 37 ~MashPackagedService() override; |
| 38 | 38 |
| 39 // shell::Service: | 39 // service_manager::Service: |
| 40 bool OnConnect(const shell::Identity& remote_identity, | 40 bool OnConnect(const service_manager::Identity& remote_identity, |
| 41 shell::InterfaceRegistry* registry) override; | 41 service_manager::InterfaceRegistry* registry) override; |
| 42 | 42 |
| 43 // shell::InterfaceFactory<ServiceFactory> | 43 // service_manager::InterfaceFactory<ServiceFactory> |
| 44 void Create(const shell::Identity& remote_identity, | 44 void Create(const service_manager::Identity& remote_identity, |
| 45 mojo::InterfaceRequest<ServiceFactory> request) override; | 45 mojo::InterfaceRequest<ServiceFactory> request) override; |
| 46 | 46 |
| 47 // ServiceFactory: | 47 // ServiceFactory: |
| 48 void CreateService(shell::mojom::ServiceRequest request, | 48 void CreateService(service_manager::mojom::ServiceRequest request, |
| 49 const std::string& mojo_name) override; | 49 const std::string& mojo_name) override; |
| 50 | 50 |
| 51 private: | 51 private: |
| 52 std::unique_ptr<shell::Service> CreateService(const std::string& name); | 52 std::unique_ptr<service_manager::Service> CreateService( |
| 53 const std::string& name); |
| 53 | 54 |
| 54 mojo::BindingSet<ServiceFactory> service_factory_bindings_; | 55 mojo::BindingSet<ServiceFactory> service_factory_bindings_; |
| 55 std::unique_ptr<shell::Service> service_; | 56 std::unique_ptr<service_manager::Service> service_; |
| 56 | 57 |
| 57 DISALLOW_COPY_AND_ASSIGN(MashPackagedService); | 58 DISALLOW_COPY_AND_ASSIGN(MashPackagedService); |
| 58 }; | 59 }; |
| 59 | 60 |
| 60 } // namespace mash | 61 } // namespace mash |
| 61 | 62 |
| 62 #endif // MASH_PACKAGE_MASH_PACKAGED_SERVICE_H_ | 63 #endif // MASH_PACKAGE_MASH_PACKAGED_SERVICE_H_ |
| OLD | NEW |