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_SERVICE_MANAGER_PUBLIC_CPP_SERVICE_CONTEXT_H_ | 5 #ifndef SERVICES_SERVICE_MANAGER_PUBLIC_CPP_SERVICE_CONTEXT_H_ |
6 #define SERVICES_SERVICE_MANAGER_PUBLIC_CPP_SERVICE_CONTEXT_H_ | 6 #define SERVICES_SERVICE_MANAGER_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 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
59 const Identity& identity() { return identity_; } | 59 const Identity& identity() { return identity_; } |
60 | 60 |
61 // Specify a function to be called when the connection to the service manager | 61 // Specify a function to be called when the connection to the service manager |
62 // is lost. | 62 // is lost. |
63 // Note that if connection has already been lost, then |closure| is called | 63 // Note that if connection has already been lost, then |closure| is called |
64 // immediately. | 64 // immediately. |
65 void SetConnectionLostClosure(const base::Closure& closure); | 65 void SetConnectionLostClosure(const base::Closure& closure); |
66 | 66 |
67 private: | 67 private: |
68 // mojom::Service: | 68 // mojom::Service: |
69 void OnStart(const Identity& identity, | 69 void OnStart(const ServiceInfo& info, |
70 const OnStartCallback& callback) override; | 70 const OnStartCallback& callback) override; |
71 void OnConnect(const Identity& source, | 71 void OnConnect(const ServiceInfo& source_info, |
72 mojom::InterfaceProviderRequest interfaces, | 72 mojom::InterfaceProviderRequest interfaces, |
73 const InterfaceSet& allowed_interfaces, | 73 const InterfaceSet& allowed_interfaces, |
74 const CapabilitySet& allowed_capabilities) override; | 74 const CapabilitySet& allowed_capabilities) override; |
75 | 75 |
76 void OnConnectionError(); | 76 void OnConnectionError(); |
77 | 77 |
78 // A callback called when OnStart() is run. | 78 // A callback called when OnStart() is run. |
79 base::Closure initialize_handler_; | 79 base::Closure initialize_handler_; |
80 | 80 |
81 // We track the lifetime of incoming connection registries as it more | 81 // We track the lifetime of incoming connection registries as it more |
(...skipping 11 matching lines...) Expand all Loading... |
93 bool should_run_connection_lost_closure_ = false; | 93 bool should_run_connection_lost_closure_ = false; |
94 | 94 |
95 base::Closure connection_lost_closure_; | 95 base::Closure connection_lost_closure_; |
96 | 96 |
97 DISALLOW_COPY_AND_ASSIGN(ServiceContext); | 97 DISALLOW_COPY_AND_ASSIGN(ServiceContext); |
98 }; | 98 }; |
99 | 99 |
100 } // namespace service_manager | 100 } // namespace service_manager |
101 | 101 |
102 #endif // SERVICES_SERVICE_MANAGER_PUBLIC_CPP_SERVICE_CONTEXT_H_ | 102 #endif // SERVICES_SERVICE_MANAGER_PUBLIC_CPP_SERVICE_CONTEXT_H_ |
OLD | NEW |