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

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

Issue 1195003002: Mandoline: Introduce ApplicationConnection::CloseConnection (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed comments Created 5 years, 5 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
1 // Copyright 2014 The Chromium Authors. All rights reserved. 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 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 MOJO_APPLICATION_PUBLIC_CPP_LIB_SERVICE_REGISTRY_H_ 5 #ifndef MOJO_APPLICATION_PUBLIC_CPP_LIB_SERVICE_REGISTRY_H_
6 #define MOJO_APPLICATION_PUBLIC_CPP_LIB_SERVICE_REGISTRY_H_ 6 #define MOJO_APPLICATION_PUBLIC_CPP_LIB_SERVICE_REGISTRY_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "mojo/application/public/cpp/application_connection.h" 10 #include "mojo/application/public/cpp/application_connection.h"
(...skipping 11 matching lines...) Expand all
22 // applications, allowing customization of which services are published to the 22 // applications, allowing customization of which services are published to the
23 // other. 23 // other.
24 class ServiceRegistry : public ServiceProvider, public ApplicationConnection { 24 class ServiceRegistry : public ServiceProvider, public ApplicationConnection {
25 public: 25 public:
26 ServiceRegistry(); 26 ServiceRegistry();
27 ServiceRegistry(ApplicationImpl* application_impl, 27 ServiceRegistry(ApplicationImpl* application_impl,
28 const std::string& connection_url, 28 const std::string& connection_url,
29 const std::string& remote_url, 29 const std::string& remote_url,
30 ServiceProviderPtr remote_services, 30 ServiceProviderPtr remote_services,
31 InterfaceRequest<ServiceProvider> local_services); 31 InterfaceRequest<ServiceProvider> local_services);
32 ~ServiceRegistry() override;
33 32
34 // ApplicationConnection overrides. 33 // ApplicationConnection overrides.
35 void SetServiceConnector(ServiceConnector* service_connector) override; 34 void SetServiceConnector(ServiceConnector* service_connector) override;
36 void SetServiceConnectorForName(ServiceConnector* service_connector, 35 void SetServiceConnectorForName(ServiceConnector* service_connector,
37 const std::string& interface_name) override; 36 const std::string& interface_name) override;
38 const std::string& GetConnectionURL() override; 37 const std::string& GetConnectionURL() override;
39 const std::string& GetRemoteApplicationURL() override; 38 const std::string& GetRemoteApplicationURL() override;
40 ServiceProvider* GetServiceProvider() override; 39 ServiceProvider* GetServiceProvider() override;
41 40
42 void RemoveServiceConnectorForName(const std::string& interface_name); 41 void RemoveServiceConnectorForName(const std::string& interface_name);
43 42
44 private: 43 private:
44 // ApplicationConnection overrides.
45 void OnCloseConnection() override;
46
45 // ServiceProvider method. 47 // ServiceProvider method.
46 void ConnectToService(const mojo::String& service_name, 48 void ConnectToService(const mojo::String& service_name,
47 ScopedMessagePipeHandle client_handle) override; 49 ScopedMessagePipeHandle client_handle) override;
48 50
49 ApplicationImpl* application_impl_; 51 ApplicationImpl* application_impl_;
50 const std::string connection_url_; 52 const std::string connection_url_;
51 const std::string remote_url_; 53 const std::string remote_url_;
52 54
53 private: 55 private:
56 ~ServiceRegistry() override;
sky 2015/06/30 16:41:46 Move definition to match new position of declarati
Fady Samuel 2015/06/30 17:31:19 Done.
54 void RemoveServiceConnectorForNameInternal(const std::string& interface_name); 57 void RemoveServiceConnectorForNameInternal(const std::string& interface_name);
55 58
56 Application* application_; 59 Application* application_;
57 Binding<ServiceProvider> local_binding_; 60 Binding<ServiceProvider> local_binding_;
58 ServiceProviderPtr remote_service_provider_; 61 ServiceProviderPtr remote_service_provider_;
59 ServiceConnectorRegistry service_connector_registry_; 62 ServiceConnectorRegistry service_connector_registry_;
60 63
61 MOJO_DISALLOW_COPY_AND_ASSIGN(ServiceRegistry); 64 MOJO_DISALLOW_COPY_AND_ASSIGN(ServiceRegistry);
62 }; 65 };
63 66
64 } // namespace internal 67 } // namespace internal
65 } // namespace mojo 68 } // namespace mojo
66 69
67 #endif // MOJO_APPLICATION_PUBLIC_CPP_LIB_SERVICE_REGISTRY_H_ 70 #endif // MOJO_APPLICATION_PUBLIC_CPP_LIB_SERVICE_REGISTRY_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698