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())); | |
143 IPC::ChannelHandle channel_handle; | 142 IPC::ChannelHandle channel_handle; |
144 if (channel.get()) { | 143 if (channel.get()) { |
145 channel_handle.name = channel->channel_handle().name; | 144 channel_handle.name = channel->channel_handle().name; |
146 #if defined(OS_POSIX) | 145 #if defined(OS_POSIX) |
147 // On POSIX, pass the renderer-side FD. | 146 // On POSIX, pass the renderer-side FD. |
148 channel_handle.socket = | 147 channel_handle.socket = |
149 base::FileDescriptor(channel->TakeRendererFileDescriptor()); | 148 base::FileDescriptor(channel->TakeRendererFileDescriptor()); |
150 #endif | 149 #endif |
151 channel->set_incognito(incognito); | 150 channel->set_incognito(incognito); |
152 } | 151 } |
153 | 152 |
154 Send(new PluginProcessHostMsg_ChannelCreated(channel_handle)); | 153 Send(new PluginProcessHostMsg_ChannelCreated(channel_handle)); |
155 } | 154 } |
156 | 155 |
157 void PluginThread::OnNotifyRenderersOfPendingShutdown() { | 156 void PluginThread::OnNotifyRenderersOfPendingShutdown() { |
158 PluginChannel::NotifyRenderersOfPendingShutdown(); | 157 PluginChannel::NotifyRenderersOfPendingShutdown(); |
159 } | 158 } |
160 | 159 |
161 } // namespace content | 160 } // namespace content |
OLD | NEW |