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/browser/plugin_process_host.h" | 5 #include "content/browser/plugin_process_host.h" |
6 | 6 |
7 #if defined(OS_WIN) | 7 #if defined(OS_WIN) |
8 #include <windows.h> | 8 #include <windows.h> |
9 #elif defined(OS_POSIX) | 9 #elif defined(OS_POSIX) |
10 #include <utility> // for pair<> | 10 #include <utility> // for pair<> |
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
214 | 214 |
215 Launch( | 215 Launch( |
216 #if defined(OS_WIN) | 216 #if defined(OS_WIN) |
217 FilePath(), | 217 FilePath(), |
218 #elif defined(OS_POSIX) | 218 #elif defined(OS_POSIX) |
219 false, | 219 false, |
220 env, | 220 env, |
221 #endif | 221 #endif |
222 cmd_line); | 222 cmd_line); |
223 | 223 |
| 224 // The plugin needs to be shutdown gracefully, i.e. NP_Shutdown needs to be |
| 225 // called on the plugin. The plugin process exits when it receives the |
| 226 // OnChannelError notification indicating that the browser plugin channel has |
| 227 // been destroyed. |
| 228 SetTerminateChildOnShutdown(false); |
| 229 |
224 content::GetContentClient()->browser()->PluginProcessHostCreated(this); | 230 content::GetContentClient()->browser()->PluginProcessHostCreated(this); |
225 AddFilter(new ResolveProxyMsgHelper(NULL)); | 231 AddFilter(new ResolveProxyMsgHelper(NULL)); |
226 | 232 |
227 return true; | 233 return true; |
228 } | 234 } |
229 | 235 |
230 void PluginProcessHost::ForceShutdown() { | 236 void PluginProcessHost::ForceShutdown() { |
231 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 237 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
232 Send(new PluginProcessMsg_NotifyRenderersOfPendingShutdown()); | 238 Send(new PluginProcessMsg_NotifyRenderersOfPendingShutdown()); |
233 BrowserChildProcessHost::ForceShutdown(); | 239 BrowserChildProcessHost::ForceShutdown(); |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
321 } | 327 } |
322 } | 328 } |
323 | 329 |
324 void PluginProcessHost::OnChannelCreated( | 330 void PluginProcessHost::OnChannelCreated( |
325 const IPC::ChannelHandle& channel_handle) { | 331 const IPC::ChannelHandle& channel_handle) { |
326 Client* client = sent_requests_.front(); | 332 Client* client = sent_requests_.front(); |
327 | 333 |
328 client->OnChannelOpened(channel_handle); | 334 client->OnChannelOpened(channel_handle); |
329 sent_requests_.pop(); | 335 sent_requests_.pop(); |
330 } | 336 } |
OLD | NEW |