| 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 SERVICES_SERVICE_MANAGER_PUBLIC_CPP_INTERFACE_REGISTRY_H_ | 5 #ifndef SERVICES_SERVICE_MANAGER_PUBLIC_CPP_INTERFACE_REGISTRY_H_ |
| 6 #define SERVICES_SERVICE_MANAGER_PUBLIC_CPP_INTERFACE_REGISTRY_H_ | 6 #define SERVICES_SERVICE_MANAGER_PUBLIC_CPP_INTERFACE_REGISTRY_H_ |
| 7 | 7 |
| 8 #include <list> | 8 #include <list> |
| 9 #include <memory> | 9 #include <memory> |
| 10 #include <queue> | 10 #include <queue> |
| (...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 143 // requests will be queued internally and dispatched once ResumeBinding() is | 143 // requests will be queued internally and dispatched once ResumeBinding() is |
| 144 // called. | 144 // called. |
| 145 void PauseBinding(); | 145 void PauseBinding(); |
| 146 | 146 |
| 147 // Resumes incoming interface request binding. | 147 // Resumes incoming interface request binding. |
| 148 void ResumeBinding(); | 148 void ResumeBinding(); |
| 149 | 149 |
| 150 // Populates a set with the interface names this registry can bind. | 150 // Populates a set with the interface names this registry can bind. |
| 151 void GetInterfaceNames(std::set<std::string>* interface_names); | 151 void GetInterfaceNames(std::set<std::string>* interface_names); |
| 152 | 152 |
| 153 // Sets a closure to be run when the InterfaceProvider pipe is closed. | 153 // Sets a closure to be run when the InterfaceProvider pipe is closed. Note |
| 154 // that by the time any added closure is invoked, the InterfaceRegistry may |
| 155 // have been deleted. |
| 154 void AddConnectionLostClosure(const base::Closure& connection_lost_closure); | 156 void AddConnectionLostClosure(const base::Closure& connection_lost_closure); |
| 155 | 157 |
| 156 private: | 158 private: |
| 157 using InterfaceNameToBinderMap = | 159 using InterfaceNameToBinderMap = |
| 158 std::map<std::string, std::unique_ptr<InterfaceBinder>>; | 160 std::map<std::string, std::unique_ptr<InterfaceBinder>>; |
| 159 | 161 |
| 160 // mojom::InterfaceProvider: | 162 // mojom::InterfaceProvider: |
| 161 void GetInterface(const std::string& interface_name, | 163 void GetInterface(const std::string& interface_name, |
| 162 mojo::ScopedMessagePipeHandle handle) override; | 164 mojo::ScopedMessagePipeHandle handle) override; |
| 163 | 165 |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 215 std::list<base::Closure> connection_lost_closures_; | 217 std::list<base::Closure> connection_lost_closures_; |
| 216 | 218 |
| 217 base::WeakPtrFactory<InterfaceRegistry> weak_factory_; | 219 base::WeakPtrFactory<InterfaceRegistry> weak_factory_; |
| 218 | 220 |
| 219 DISALLOW_COPY_AND_ASSIGN(InterfaceRegistry); | 221 DISALLOW_COPY_AND_ASSIGN(InterfaceRegistry); |
| 220 }; | 222 }; |
| 221 | 223 |
| 222 } // namespace service_manager | 224 } // namespace service_manager |
| 223 | 225 |
| 224 #endif // SERVICES_SERVICE_MANAGER_PUBLIC_CPP_INTERFACE_REGISTRY_H_ | 226 #endif // SERVICES_SERVICE_MANAGER_PUBLIC_CPP_INTERFACE_REGISTRY_H_ |
| OLD | NEW |