OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 CONTENT_BROWSER_MOJO_MOJO_SHELL_CLIENT_HOST_H_ | 5 #ifndef CONTENT_BROWSER_MOJO_MOJO_SHELL_CLIENT_HOST_H_ |
6 #define CONTENT_BROWSER_MOJO_MOJO_SHELL_CLIENT_HOST_H_ | 6 #define CONTENT_BROWSER_MOJO_MOJO_SHELL_CLIENT_HOST_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/process/process_handle.h" | 10 #include "base/process/process_handle.h" |
11 | 11 |
| 12 namespace mojo { |
| 13 class ApplicationConnection; |
| 14 } |
| 15 |
12 namespace content { | 16 namespace content { |
13 | 17 |
14 class RenderProcessHost; | 18 class RenderProcessHost; |
15 | 19 |
16 // Creates a communication channel between the external Mojo shell and the | 20 // Creates a communication channel between the external Mojo shell and the |
17 // child. The server handle of this channel is shared with the external shell | 21 // child. The server handle of this channel is shared with the external shell |
18 // via Mojo IPC and the client handle is shared with the child via Chrome IPC. | 22 // via Mojo IPC and the client handle is shared with the child via Chrome IPC. |
19 // |child_process_id| is used to uniquify the child in the external shell's | 23 // |child_process_id| is used to uniquify the child in the external shell's |
20 // instance map. | 24 // instance map. |
21 void RegisterChildWithExternalShell(int child_process_id, | 25 void RegisterChildWithExternalShell(int child_process_id, |
22 base::ProcessHandle process_handle, | 26 base::ProcessHandle process_handle, |
23 RenderProcessHost* render_process_host); | 27 RenderProcessHost* render_process_host); |
24 | 28 |
25 // Returns the URL associated with an instance corresponding to the renderer | 29 // Returns the URL associated with an instance corresponding to the renderer |
26 // process in the external shell. This URL can be passed to | 30 // process in the external shell. This URL can be passed to |
27 // ConnectToApplication() to open a new connection to this renderer. | 31 // ConnectToApplication() to open a new connection to this renderer. |
28 std::string GetMojoApplicationInstanceURL( | 32 std::string GetMojoApplicationInstanceURL( |
29 RenderProcessHost* render_process_host); | 33 RenderProcessHost* render_process_host); |
30 | 34 |
| 35 // Returns the RenderProcessHost ID associated with the mojo app URL. |
| 36 int GetRenderProcessIDFromConnection(mojo::ApplicationConnection* connection); |
| 37 |
31 } // namespace content | 38 } // namespace content |
32 | 39 |
33 #endif // CONTENT_BROWSER_MOJO_MOJO_SHELL_CLIENT_HOST_H_ | 40 #endif // CONTENT_BROWSER_MOJO_MOJO_SHELL_CLIENT_HOST_H_ |
OLD | NEW |