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

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: Address review concerns 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 {
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* remote_service_provider() {
29 return remote_service_provider_.get();
30 }
31
32 void BindRemoteServiceProvider(
33 ScopedMessagePipeHandle service_provider_handle);
34
35 // ServiceProvider method.
36 virtual void ConnectToService(const mojo::String& service_url,
37 const mojo::String& service_name,
38 ScopedMessagePipeHandle client_handle,
39 const mojo::String& requestor_url)
40 MOJO_OVERRIDE;
41
42 private:
43 Application* application_;
44 typedef std::map<std::string, ServiceConnectorBase*>
45 NameToServiceConnectorMap;
46 NameToServiceConnectorMap name_to_service_connector_;
47 ServiceProviderPtr remote_service_provider_;
48
49 MOJO_DISALLOW_COPY_AND_ASSIGN(ServiceRegistry);
50 };
51
52 } // namespace internal
53 } // namespace mojo
54
55 #endif // MOJO_PUBLIC_CPP_APPLICATION_LIB_SERVICE_REGISTRY_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698