OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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(OS_MACOSX) | 9 #if defined(OS_MACOSX) |
10 #include <CoreFoundation/CoreFoundation.h> | 10 #include <CoreFoundation/CoreFoundation.h> |
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
131 IPC_MESSAGE_HANDLER(PluginProcessMsg_NotifyRenderersOfPendingShutdown, | 131 IPC_MESSAGE_HANDLER(PluginProcessMsg_NotifyRenderersOfPendingShutdown, |
132 OnNotifyRenderersOfPendingShutdown) | 132 OnNotifyRenderersOfPendingShutdown) |
133 IPC_MESSAGE_UNHANDLED(handled = false) | 133 IPC_MESSAGE_UNHANDLED(handled = false) |
134 IPC_END_MESSAGE_MAP() | 134 IPC_END_MESSAGE_MAP() |
135 return handled; | 135 return handled; |
136 } | 136 } |
137 | 137 |
138 void PluginThread::OnCreateChannel(int renderer_id, | 138 void PluginThread::OnCreateChannel(int renderer_id, |
139 bool incognito) { | 139 bool incognito) { |
140 scoped_refptr<PluginChannel> channel(PluginChannel::GetPluginChannel( | 140 scoped_refptr<PluginChannel> channel(PluginChannel::GetPluginChannel( |
141 renderer_id, ChildProcess::current()->io_task_runner())); | 141 renderer_id, ChildProcess::current()->io_task_runner(), |
| 142 GetAttachmentBroker())); |
142 IPC::ChannelHandle channel_handle; | 143 IPC::ChannelHandle channel_handle; |
143 if (channel.get()) { | 144 if (channel.get()) { |
144 channel_handle.name = channel->channel_handle().name; | 145 channel_handle.name = channel->channel_handle().name; |
145 #if defined(OS_POSIX) | 146 #if defined(OS_POSIX) |
146 // On POSIX, pass the renderer-side FD. | 147 // On POSIX, pass the renderer-side FD. |
147 channel_handle.socket = | 148 channel_handle.socket = |
148 base::FileDescriptor(channel->TakeRendererFileDescriptor()); | 149 base::FileDescriptor(channel->TakeRendererFileDescriptor()); |
149 #endif | 150 #endif |
150 channel->set_incognito(incognito); | 151 channel->set_incognito(incognito); |
151 } | 152 } |
152 | 153 |
153 Send(new PluginProcessHostMsg_ChannelCreated(channel_handle)); | 154 Send(new PluginProcessHostMsg_ChannelCreated(channel_handle)); |
154 } | 155 } |
155 | 156 |
156 void PluginThread::OnNotifyRenderersOfPendingShutdown() { | 157 void PluginThread::OnNotifyRenderersOfPendingShutdown() { |
157 PluginChannel::NotifyRenderersOfPendingShutdown(); | 158 PluginChannel::NotifyRenderersOfPendingShutdown(); |
158 } | 159 } |
159 | 160 |
160 } // namespace content | 161 } // namespace content |
OLD | NEW |