| 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 | |
| 230 content::GetContentClient()->browser()->PluginProcessHostCreated(this); | 224 content::GetContentClient()->browser()->PluginProcessHostCreated(this); |
| 231 AddFilter(new ResolveProxyMsgHelper(NULL)); | 225 AddFilter(new ResolveProxyMsgHelper(NULL)); |
| 232 | 226 |
| 233 return true; | 227 return true; |
| 234 } | 228 } |
| 235 | 229 |
| 236 void PluginProcessHost::ForceShutdown() { | 230 void PluginProcessHost::ForceShutdown() { |
| 237 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 231 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
| 238 Send(new PluginProcessMsg_NotifyRenderersOfPendingShutdown()); | 232 Send(new PluginProcessMsg_NotifyRenderersOfPendingShutdown()); |
| 239 BrowserChildProcessHost::ForceShutdown(); | 233 BrowserChildProcessHost::ForceShutdown(); |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 327 } | 321 } |
| 328 } | 322 } |
| 329 | 323 |
| 330 void PluginProcessHost::OnChannelCreated( | 324 void PluginProcessHost::OnChannelCreated( |
| 331 const IPC::ChannelHandle& channel_handle) { | 325 const IPC::ChannelHandle& channel_handle) { |
| 332 Client* client = sent_requests_.front(); | 326 Client* client = sent_requests_.front(); |
| 333 | 327 |
| 334 client->OnChannelOpened(channel_handle); | 328 client->OnChannelOpened(channel_handle); |
| 335 sent_requests_.pop(); | 329 sent_requests_.pop(); |
| 336 } | 330 } |
| OLD | NEW |