Chromium Code Reviews| Index: content/plugin/plugin_channel.cc |
| =================================================================== |
| --- content/plugin/plugin_channel.cc (revision 86295) |
| +++ content/plugin/plugin_channel.cc (working copy) |
| @@ -32,9 +32,19 @@ |
| } |
| }; |
| +class PluginProcessExitTask : public Task { |
| + public: |
| + void Run() { |
| + base::KillProcess(base::GetCurrentProcessHandle(), 0, false); |
| + } |
| +}; |
| + |
| // How long we wait before releasing the plugin process. |
| const int kPluginReleaseTimeMs = 5 * 60 * 1000; // 5 minutes |
| +// How long we wait before forcibly shutting down the process. |
| +const int kPluginProcessTerminateTimeoutMs = 3000; |
| + |
| } // namespace |
| // If a sync call to the renderer results in a modal dialog, we need to have a |
| @@ -85,9 +95,17 @@ |
| return channel_->Send(message); |
| } |
|
jam
2011/05/24 20:46:13
nit: extra line
ananta
2011/05/24 20:56:26
Done.
|
| + |
| private: |
| void OnFilterAdded(IPC::Channel* channel) { channel_ = channel; } |
| + virtual void OnChannelError() { |
| + // Ensure that we don't wait indefinitely for the plugin to shutdown. |
|
jam
2011/05/24 20:46:13
nit: can you please add just one extra line to say
ananta
2011/05/24 20:56:26
Done.
|
| + MessageLoop::current()->PostDelayedTask(FROM_HERE, |
| + new PluginProcessExitTask(), |
| + kPluginProcessTerminateTimeoutMs); |
| + } |
| + |
| bool OnMessageReceived(const IPC::Message& message) { |
| IPC_BEGIN_MESSAGE_MAP(PluginChannel::MessageFilter, message) |
| IPC_MESSAGE_HANDLER_DELAY_REPLY(PluginMsg_Init, OnInit) |