OLD | NEW |
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 // Helpers for using |ServiceProvider|s. | 5 // Helpers for using |ServiceProvider|s. |
6 | 6 |
7 #ifndef MOJO_PUBLIC_CPP_APPLICATION_CONNECT_H_ | 7 #ifndef MOJO_PUBLIC_CPP_APPLICATION_CONNECT_H_ |
8 #define MOJO_PUBLIC_CPP_APPLICATION_CONNECT_H_ | 8 #define MOJO_PUBLIC_CPP_APPLICATION_CONNECT_H_ |
9 | 9 |
10 #include "mojo/public/cpp/bindings/interface_handle.h" | 10 #include "mojo/public/cpp/bindings/interface_handle.h" |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
56 ServiceProviderPtr service_provider; | 56 ServiceProviderPtr service_provider; |
57 application_connector->ConnectToApplication( | 57 application_connector->ConnectToApplication( |
58 application_url, GetProxy(&service_provider), nullptr); | 58 application_url, GetProxy(&service_provider), nullptr); |
59 ConnectToService(service_provider.get(), request.Pass()); | 59 ConnectToService(service_provider.get(), request.Pass()); |
60 } | 60 } |
61 | 61 |
62 // Helper for getting an |InterfaceHandle<ApplicationConnector>| (which can be | 62 // Helper for getting an |InterfaceHandle<ApplicationConnector>| (which can be |
63 // passed to any thread) from the shell. | 63 // passed to any thread) from the shell. |
64 InterfaceHandle<ApplicationConnector> CreateApplicationConnector(Shell* shell); | 64 InterfaceHandle<ApplicationConnector> CreateApplicationConnector(Shell* shell); |
65 | 65 |
| 66 // Helper for "duplicating" a |ApplicationConnector| (typically, from an |
| 67 // |ApplicationConnectorPtr|, getting another independent |
| 68 // |InterfaceHandle<ApplicationConnector>|). |
| 69 InterfaceHandle<ApplicationConnector> DuplicateApplicationConnector( |
| 70 ApplicationConnector* application_connector); |
| 71 |
66 } // namespace mojo | 72 } // namespace mojo |
67 | 73 |
68 #endif // MOJO_PUBLIC_CPP_APPLICATION_CONNECT_H_ | 74 #endif // MOJO_PUBLIC_CPP_APPLICATION_CONNECT_H_ |
OLD | NEW |