Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(505)

Side by Side Diff: services/service_manager/public/cpp/interface_registry.h

Issue 2695803004: Make browser process a singleton service (Closed)
Patch Set: . Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « mash/session/session.cc ('k') | services/service_manager/public/cpp/lib/interface_registry.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 147 matching lines...) Expand 10 before | Expand all | Expand 10 after
158 void ResumeBinding(); 158 void ResumeBinding();
159 159
160 // Populates a set with the interface names this registry can bind. 160 // Populates a set with the interface names this registry can bind.
161 void GetInterfaceNames(std::set<std::string>* interface_names); 161 void GetInterfaceNames(std::set<std::string>* interface_names);
162 162
163 // Sets a closure to be run when the InterfaceProvider pipe is closed. Note 163 // Sets a closure to be run when the InterfaceProvider pipe is closed. Note
164 // that by the time any added closure is invoked, the InterfaceRegistry may 164 // that by the time any added closure is invoked, the InterfaceRegistry may
165 // have been deleted. 165 // have been deleted.
166 void AddConnectionLostClosure(const base::Closure& connection_lost_closure); 166 void AddConnectionLostClosure(const base::Closure& connection_lost_closure);
167 167
168 // Binds a local interface request.
169 void BindInterface(const std::string& name,
170 mojo::ScopedMessagePipeHandle handle);
171
168 private: 172 private:
169 using InterfaceNameToBinderMap = 173 using InterfaceNameToBinderMap =
170 std::map<std::string, std::unique_ptr<InterfaceBinder>>; 174 std::map<std::string, std::unique_ptr<InterfaceBinder>>;
171 175
172 // mojom::InterfaceProvider: 176 // mojom::InterfaceProvider:
173 void GetInterface(const std::string& interface_name, 177 void GetInterface(const std::string& interface_name,
174 mojo::ScopedMessagePipeHandle handle) override; 178 mojo::ScopedMessagePipeHandle handle) override;
175 179
176 // Returns true if the binder was set, false if it was not set (e.g. by 180 // Returns true if the binder was set, false if it was not set (e.g. by
177 // some filtering policy preventing this interface from being exposed). 181 // some filtering policy preventing this interface from being exposed).
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
227 std::list<base::Closure> connection_lost_closures_; 231 std::list<base::Closure> connection_lost_closures_;
228 232
229 base::WeakPtrFactory<InterfaceRegistry> weak_factory_; 233 base::WeakPtrFactory<InterfaceRegistry> weak_factory_;
230 234
231 DISALLOW_COPY_AND_ASSIGN(InterfaceRegistry); 235 DISALLOW_COPY_AND_ASSIGN(InterfaceRegistry);
232 }; 236 };
233 237
234 } // namespace service_manager 238 } // namespace service_manager
235 239
236 #endif // SERVICES_SERVICE_MANAGER_PUBLIC_CPP_INTERFACE_REGISTRY_H_ 240 #endif // SERVICES_SERVICE_MANAGER_PUBLIC_CPP_INTERFACE_REGISTRY_H_
OLDNEW
« no previous file with comments | « mash/session/session.cc ('k') | services/service_manager/public/cpp/lib/interface_registry.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698