OLD | NEW |
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 #ifndef SERVICES_SHELL_PUBLIC_CPP_SERVICE_CONTEXT_H_ | 5 #ifndef SERVICES_SHELL_PUBLIC_CPP_SERVICE_CONTEXT_H_ |
6 #define SERVICES_SHELL_PUBLIC_CPP_SERVICE_CONTEXT_H_ | 6 #define SERVICES_SHELL_PUBLIC_CPP_SERVICE_CONTEXT_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 #include <utility> | 9 #include <utility> |
10 #include <vector> | 10 #include <vector> |
(...skipping 12 matching lines...) Expand all Loading... |
23 // Encapsulates a connection to the Service Manager in two parts: | 23 // Encapsulates a connection to the Service Manager in two parts: |
24 // - a bound InterfacePtr to mojom::Connector, the primary mechanism | 24 // - a bound InterfacePtr to mojom::Connector, the primary mechanism |
25 // by which the instantiating service connects to other services, | 25 // by which the instantiating service connects to other services, |
26 // brokered by the Service Manager. | 26 // brokered by the Service Manager. |
27 // - a bound InterfaceRequest of mojom::Service, an interface used by the | 27 // - a bound InterfaceRequest of mojom::Service, an interface used by the |
28 // Service Manager to inform this service of lifecycle events and | 28 // Service Manager to inform this service of lifecycle events and |
29 // inbound connections brokered by it. | 29 // inbound connections brokered by it. |
30 // | 30 // |
31 // This class should be used in two scenarios: | 31 // This class should be used in two scenarios: |
32 // - During early startup to bind the mojom::ServiceRequest obtained from | 32 // - During early startup to bind the mojom::ServiceRequest obtained from |
33 // the Service Manager, typically in response to either MojoMain() or main(). | 33 // the Service Manager, typically in response to either ServiceMain() or |
| 34 // main(). |
34 // - In an implementation of mojom::ServiceFactory to bind the | 35 // - In an implementation of mojom::ServiceFactory to bind the |
35 // mojom::ServiceRequest passed via CreateService. In this scenario there can | 36 // mojom::ServiceRequest passed via CreateService. In this scenario there can |
36 // be many instances of this class per process. | 37 // be many instances of this class per process. |
37 // | 38 // |
38 // Instances of this class are constructed with an implementation of the Service | 39 // Instances of this class are constructed with an implementation of the Service |
39 // Manager Client Lib's Service interface. See documentation in service.h | 40 // Manager Client Lib's Service interface. See documentation in service.h |
40 // for details. | 41 // for details. |
41 // | 42 // |
42 class ServiceContext : public mojom::Service { | 43 class ServiceContext : public mojom::Service { |
43 public: | 44 public: |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
94 bool should_run_connection_lost_closure_ = false; | 95 bool should_run_connection_lost_closure_ = false; |
95 | 96 |
96 base::Closure connection_lost_closure_; | 97 base::Closure connection_lost_closure_; |
97 | 98 |
98 DISALLOW_COPY_AND_ASSIGN(ServiceContext); | 99 DISALLOW_COPY_AND_ASSIGN(ServiceContext); |
99 }; | 100 }; |
100 | 101 |
101 } // namespace shell | 102 } // namespace shell |
102 | 103 |
103 #endif // SERVICES_SHELL_PUBLIC_CPP_SERVICE_CONTEXT_H_ | 104 #endif // SERVICES_SHELL_PUBLIC_CPP_SERVICE_CONTEXT_H_ |
OLD | NEW |