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

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

Issue 814543006: Move //mojo/{public, edk} underneath //third_party (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 5 years, 11 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
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/cpp/application/application_connection.h"
9 #include "mojo/public/interfaces/application/service_provider.mojom.h"
10
11 namespace mojo {
12
13 class Application;
14 class ApplicationImpl;
15
16 namespace internal {
17
18 class ServiceConnectorBase;
19
20 // A ServiceRegistry represents each half of a connection between two
21 // applications, allowing customization of which services are published to the
22 // other.
23 class ServiceRegistry : public ServiceProvider, public ApplicationConnection {
24 public:
25 ServiceRegistry();
26 ServiceRegistry(ApplicationImpl* application_impl,
27 const std::string& url,
28 ServiceProviderPtr remote_services,
29 InterfaceRequest<ServiceProvider> local_services);
30 ~ServiceRegistry() override;
31
32 // ApplicationConnection overrides.
33 void AddServiceConnector(ServiceConnectorBase* service_connector) override;
34 const std::string& GetRemoteApplicationURL() override;
35 ApplicationConnection* ConnectToApplication(const std::string& url) override;
36 ServiceProvider* GetServiceProvider() override;
37
38 virtual void RemoveServiceConnector(ServiceConnectorBase* service_connector);
39
40 private:
41 // ServiceProvider method.
42 void ConnectToService(const mojo::String& service_name,
43 ScopedMessagePipeHandle client_handle) override;
44
45 ApplicationImpl* application_impl_;
46 const std::string url_;
47
48 private:
49 bool RemoveServiceConnectorInternal(ServiceConnectorBase* service_connector);
50
51 Application* application_;
52 typedef std::map<std::string, ServiceConnectorBase*>
53 NameToServiceConnectorMap;
54 NameToServiceConnectorMap name_to_service_connector_;
55 Binding<ServiceProvider> local_binding_;
56 ServiceProviderPtr remote_service_provider_;
57
58 MOJO_DISALLOW_COPY_AND_ASSIGN(ServiceRegistry);
59 };
60
61 } // namespace internal
62 } // namespace mojo
63
64 #endif // MOJO_PUBLIC_CPP_APPLICATION_LIB_SERVICE_REGISTRY_H_
OLDNEW
« no previous file with comments | « mojo/public/cpp/application/lib/service_provider_impl.cc ('k') | mojo/public/cpp/application/lib/service_registry.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698