| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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_CHILD_CONNECTION_H_ | 5 #ifndef CONTENT_BROWSER_MOJO_MOJO_CHILD_CONNECTION_H_ |
| 6 #define CONTENT_BROWSER_MOJO_MOJO_CHILD_CONNECTION_H_ | 6 #define CONTENT_BROWSER_MOJO_MOJO_CHILD_CONNECTION_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 #include "mojo/shell/public/interfaces/shell.mojom.h" | 11 #include "services/shell/public/interfaces/shell.mojom.h" |
| 12 | 12 |
| 13 namespace mojo { | 13 namespace mojo { |
| 14 class Connection; | 14 class Connection; |
| 15 } | 15 } |
| 16 | 16 |
| 17 namespace content { | 17 namespace content { |
| 18 | 18 |
| 19 class RenderProcessHost; | 19 class RenderProcessHost; |
| 20 | 20 |
| 21 // Establish a mojo::Connection to the child process, using a pipe created for | 21 // Establish a mojo::Connection to the child process, using a pipe created for |
| 22 // that purpose. Returns a token that should be passed to the child process and | 22 // that purpose. Returns a token that should be passed to the child process and |
| 23 // exchanged for a pipe there. That pipe can in turn be passed to | 23 // exchanged for a pipe there. That pipe can in turn be passed to |
| 24 // MojoShellConnectionImpl::BindToMessagePipe() to initialize the child's | 24 // MojoShellConnectionImpl::BindToMessagePipe() to initialize the child's |
| 25 // shell connection. | 25 // shell connection. |
| 26 std::string MojoConnectToChild(int child_process_id, | 26 std::string MojoConnectToChild(int child_process_id, |
| 27 int instance_id, | 27 int instance_id, |
| 28 RenderProcessHost* render_process_host); | 28 RenderProcessHost* render_process_host); |
| 29 | 29 |
| 30 // Returns a mojo connection to the provided render process host. This | 30 // Returns a mojo connection to the provided render process host. This |
| 31 // connection was opened when MojoConnectToChild() was called. | 31 // connection was opened when MojoConnectToChild() was called. |
| 32 mojo::Connection* GetMojoConnection(RenderProcessHost* render_process_host); | 32 mojo::Connection* GetMojoConnection(RenderProcessHost* render_process_host); |
| 33 | 33 |
| 34 } // namespace content | 34 } // namespace content |
| 35 | 35 |
| 36 #endif // CONTENT_BROWSER_MOJO_MOJO_CHILD_CONNECTION_H_ | 36 #endif // CONTENT_BROWSER_MOJO_MOJO_CHILD_CONNECTION_H_ |
| OLD | NEW |