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_SHELL_PUBLIC_CPP_INTERFACE_REGISTRY_H_ | 5 #ifndef SERVICES_SHELL_PUBLIC_CPP_INTERFACE_REGISTRY_H_ |
6 #define SERVICES_SHELL_PUBLIC_CPP_INTERFACE_REGISTRY_H_ | 6 #define SERVICES_SHELL_PUBLIC_CPP_INTERFACE_REGISTRY_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 #include <queue> | 9 #include <queue> |
10 #include <set> | 10 #include <set> |
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
120 // requests will be queued internally and dispatched once ResumeBinding() is | 120 // requests will be queued internally and dispatched once ResumeBinding() is |
121 // called. | 121 // called. |
122 void PauseBinding(); | 122 void PauseBinding(); |
123 | 123 |
124 // Resumes incoming interface request binding. | 124 // Resumes incoming interface request binding. |
125 void ResumeBinding(); | 125 void ResumeBinding(); |
126 | 126 |
127 // Populates a set with the interface names this registry can bind. | 127 // Populates a set with the interface names this registry can bind. |
128 void GetInterfaceNames(std::set<std::string>* interface_names); | 128 void GetInterfaceNames(std::set<std::string>* interface_names); |
129 | 129 |
| 130 // Sets a closure to be run when the InterfaceProvider pipe is closed. |
| 131 void SetConnectionLostClosure(const base::Closure& connection_lost_closure); |
| 132 |
130 private: | 133 private: |
131 using NameToInterfaceBinderMap = | 134 using NameToInterfaceBinderMap = |
132 std::map<std::string, std::unique_ptr<InterfaceBinder>>; | 135 std::map<std::string, std::unique_ptr<InterfaceBinder>>; |
133 | 136 |
134 // mojom::InterfaceProvider: | 137 // mojom::InterfaceProvider: |
135 void GetInterface(const mojo::String& interface_name, | 138 void GetInterface(const mojo::String& interface_name, |
136 mojo::ScopedMessagePipeHandle handle) override; | 139 mojo::ScopedMessagePipeHandle handle) override; |
137 | 140 |
138 // Returns true if the binder was set, false if it was not set (e.g. by | 141 // Returns true if the binder was set, false if it was not set (e.g. by |
139 // some filtering policy preventing this interface from being exposed). | 142 // some filtering policy preventing this interface from being exposed). |
(...skipping 17 matching lines...) Expand all Loading... |
157 pending_interface_requests_; | 160 pending_interface_requests_; |
158 | 161 |
159 base::WeakPtrFactory<InterfaceRegistry> weak_factory_; | 162 base::WeakPtrFactory<InterfaceRegistry> weak_factory_; |
160 | 163 |
161 DISALLOW_COPY_AND_ASSIGN(InterfaceRegistry); | 164 DISALLOW_COPY_AND_ASSIGN(InterfaceRegistry); |
162 }; | 165 }; |
163 | 166 |
164 } // namespace shell | 167 } // namespace shell |
165 | 168 |
166 #endif // SERVICES_SHELL_PUBLIC_CPP_INTERFACE_REGISTRY_H_ | 169 #endif // SERVICES_SHELL_PUBLIC_CPP_INTERFACE_REGISTRY_H_ |
OLD | NEW |