Chromium Code Reviews| Index: content/ppapi_plugin/ppapi_thread.cc |
| diff --git a/content/ppapi_plugin/ppapi_thread.cc b/content/ppapi_plugin/ppapi_thread.cc |
| index ea5e4bc341e1bb6fa2524a3f7a1e4f85b2c32f2c..df2e875bd8db1ee14c2baf6abbfa6aa8bf543e38 100644 |
| --- a/content/ppapi_plugin/ppapi_thread.cc |
| +++ b/content/ppapi_plugin/ppapi_thread.cc |
| @@ -39,6 +39,7 @@ |
| #include "ipc/ipc_platform_file.h" |
| #include "ipc/ipc_sync_channel.h" |
| #include "ipc/ipc_sync_message_filter.h" |
| +#include "mojo/public/cpp/system/message_pipe.h" |
| #include "ppapi/c/dev/ppp_network_state_dev.h" |
| #include "ppapi/c/pp_errors.h" |
| #include "ppapi/c/ppp.h" |
| @@ -492,6 +493,8 @@ bool PpapiThread::SetupChannel(base::ProcessId renderer_pid, |
| plugin_handle.name = IPC::Channel::GenerateVerifiedChannelID( |
| base::StringPrintf( |
| "%d.r%d", base::GetCurrentProcId(), renderer_child_id)); |
| + mojo::MessagePipe message_pipe; |
| + plugin_handle.mojo_handle = message_pipe.handle0.release(); |
| ppapi::proxy::ProxyChannel* dispatcher = NULL; |
| bool init_result = false; |
| @@ -524,14 +527,7 @@ bool PpapiThread::SetupChannel(base::ProcessId renderer_pid, |
| } |
| handle->name = plugin_handle.name; |
| -#if defined(OS_POSIX) |
| - // On POSIX, transfer ownership of the renderer-side (client) FD. |
| - // This ensures this process will be notified when it is closed even if a |
| - // connection is not established. |
|
dcheng
2016/06/27 02:12:48
How come these checks aren't needed in the Mojo ve
Anand Mistry (off Chromium)
2016/06/27 02:25:59
fds are not used when using ChannelMojo (and the r
dcheng
2016/06/27 03:35:02
OK, so the Mojo handles here are always valid?
Anand Mistry (off Chromium)
2016/06/27 04:52:07
Here, yes. But not necessarily in the receive side
|
| - handle->socket = base::FileDescriptor(dispatcher->TakeRendererFD()); |
| - if (handle->socket.fd == -1) |
| - return false; |
| -#endif |
| + handle->mojo_handle = message_pipe.handle1.release(); |
| // From here, the dispatcher will manage its own lifetime according to the |
| // lifetime of the attached channel. |