diff options
Diffstat (limited to 'chrome/plugin/plugin_thread.cc')
-rw-r--r-- | chrome/plugin/plugin_thread.cc | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/chrome/plugin/plugin_thread.cc b/chrome/plugin/plugin_thread.cc index 2f9c2ec..2701f5b 100644 --- a/chrome/plugin/plugin_thread.cc +++ b/chrome/plugin/plugin_thread.cc @@ -103,24 +103,23 @@ void PluginThread::CleanUp() { } void PluginThread::OnCreateChannel( -#if defined(OS_POSIX) - base::FileDescriptor socket, -#endif int process_id, bool off_the_record) { - int fd = -1; -#if defined(OS_POSIX) - fd = socket.fd; -#endif - std::string channel_name; scoped_refptr<PluginChannel> channel = - PluginChannel::GetPluginChannel(process_id, owner_loop(), fd); + PluginChannel::GetPluginChannel(process_id, owner_loop()); + IPC::ChannelHandle channel_handle; if (channel.get()) { - channel_name = channel->channel_name(); + channel_handle.name = channel->channel_name(); +#if defined(OS_POSIX) + // On POSIX, pass the renderer-side FD. Also mark it as auto-close so that + // it gets closed after it has been sent. + int renderer_fd = channel->DisownRendererFd(); + channel_handle.socket = base::FileDescriptor(renderer_fd, true); +#endif channel->set_off_the_record(off_the_record); } - Send(new PluginProcessHostMsg_ChannelCreated(channel_name)); + Send(new PluginProcessHostMsg_ChannelCreated(channel_handle)); } void PluginThread::OnPluginMessage(const std::vector<unsigned char> &data) { |