| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #include "content/plugin/plugin_thread.h" | 5 #include "content/plugin/plugin_thread.h" |
| 6 | 6 |
| 7 #include "build/build_config.h" | 7 #include "build/build_config.h" |
| 8 | 8 |
| 9 #if defined(TOOLKIT_USES_GTK) | 9 #if defined(TOOLKIT_USES_GTK) |
| 10 #include <gtk/gtk.h> | 10 #include <gtk/gtk.h> |
| (...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 150 | 150 |
| 151 void PluginThread::OnCreateChannel(int renderer_id, | 151 void PluginThread::OnCreateChannel(int renderer_id, |
| 152 bool incognito) { | 152 bool incognito) { |
| 153 scoped_refptr<PluginChannel> channel(PluginChannel::GetPluginChannel( | 153 scoped_refptr<PluginChannel> channel(PluginChannel::GetPluginChannel( |
| 154 renderer_id, ChildProcess::current()->io_message_loop_proxy())); | 154 renderer_id, ChildProcess::current()->io_message_loop_proxy())); |
| 155 IPC::ChannelHandle channel_handle; | 155 IPC::ChannelHandle channel_handle; |
| 156 if (channel.get()) { | 156 if (channel.get()) { |
| 157 channel_handle.name = channel->channel_handle().name; | 157 channel_handle.name = channel->channel_handle().name; |
| 158 #if defined(OS_POSIX) | 158 #if defined(OS_POSIX) |
| 159 // On POSIX, pass the renderer-side FD. | 159 // On POSIX, pass the renderer-side FD. |
| 160 channel_handle.socket = base::FileDescriptor(channel->renderer_fd(), false); | 160 channel_handle.socket = |
| 161 base::FileDescriptor(channel->TakeClientFileDescriptor(), true); |
| 161 #endif | 162 #endif |
| 162 channel->set_incognito(incognito); | 163 channel->set_incognito(incognito); |
| 163 } | 164 } |
| 164 | 165 |
| 165 Send(new PluginProcessHostMsg_ChannelCreated(channel_handle)); | 166 Send(new PluginProcessHostMsg_ChannelCreated(channel_handle)); |
| 166 } | 167 } |
| 167 | 168 |
| 168 void PluginThread::OnNotifyRenderersOfPendingShutdown() { | 169 void PluginThread::OnNotifyRenderersOfPendingShutdown() { |
| 169 PluginChannel::NotifyRenderersOfPendingShutdown(); | 170 PluginChannel::NotifyRenderersOfPendingShutdown(); |
| 170 } | 171 } |
| OLD | NEW |