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

Side by Side Diff: mojo/public/cpp/application/lib/service_registry.h

Issue 337533002: Introduce internal::ServiceRegistry to prepare for ServiceProvider split. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merge problems Created 6 years, 6 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 | Annotate | Revision Log
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef MOJO_PUBLIC_CPP_APPLICATION_LIB_SERVICE_REGISTRY_H_
6 #define MOJO_PUBLIC_CPP_APPLICATION_LIB_SERVICE_REGISTRY_H_
7
8 #include "mojo/public/interfaces/service_provider/service_provider.mojom.h"
9
10 namespace mojo {
11
12 class Application;
13
14 namespace internal {
15
16 class ServiceConnectorBase;
17
18 class ServiceRegistry : public ServiceProvider {
darin (slow to review) 2014/06/12 16:11:51 since the ServiceRegistry is a ServiceProvider and
DaveMoore 2014/06/12 16:28:14 Done.
19 public:
20 ServiceRegistry(Application* application);
21 ServiceRegistry(Application* application,
22 ScopedMessagePipeHandle service_provider_handle);
23 virtual ~ServiceRegistry();
24
25 void AddServiceConnector(ServiceConnectorBase* service_connector);
26 void RemoveServiceConnector(ServiceConnectorBase* service_connector);
27
28 ServiceProvider* service_provider() { return service_provider_.get(); }
29 void BindServiceProvider(ScopedMessagePipeHandle service_provider_handle);
30
31 // ServiceProvider method.
32 virtual void ConnectToService(const mojo::String& service_url,
33 const mojo::String& service_name,
34 ScopedMessagePipeHandle client_handle,
35 const mojo::String& requestor_url)
36 MOJO_OVERRIDE;
37
38 private:
39 Application* application_;
40 typedef std::map<std::string, ServiceConnectorBase*>
41 NameToServiceConnectorMap;
42 NameToServiceConnectorMap name_to_service_connector_;
43 ServiceProviderPtr service_provider_;
44
45 MOJO_DISALLOW_COPY_AND_ASSIGN(ServiceRegistry);
46 };
47
48 } // namespace internal
49 } // namespace mojo
50
51 #endif // MOJO_PUBLIC_CPP_APPLICATION_LIB_SERVICE_REGISTRY_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698