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(TOOLKIT_GTK) | 9 #if defined(TOOLKIT_GTK) |
10 #include <gtk/gtk.h> | 10 #include <gtk/gtk.h> |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
51 virtual ~EnsureTerminateMessageFilter() {} | 51 virtual ~EnsureTerminateMessageFilter() {} |
52 | 52 |
53 // IPC::ChannelProxy::MessageFilter: | 53 // IPC::ChannelProxy::MessageFilter: |
54 virtual void OnChannelError() OVERRIDE { | 54 virtual void OnChannelError() OVERRIDE { |
55 // How long we wait before forcibly shutting down the process. | 55 // How long we wait before forcibly shutting down the process. |
56 const base::TimeDelta kPluginProcessTerminateTimeout = | 56 const base::TimeDelta kPluginProcessTerminateTimeout = |
57 base::TimeDelta::FromSeconds(3); | 57 base::TimeDelta::FromSeconds(3); |
58 // Ensure that we don't wait indefinitely for the plugin to shutdown. | 58 // Ensure that we don't wait indefinitely for the plugin to shutdown. |
59 // as the browser does not terminate plugin processes on shutdown. | 59 // as the browser does not terminate plugin processes on shutdown. |
60 // We achieve this by posting an exit process task on the IO thread. | 60 // We achieve this by posting an exit process task on the IO thread. |
61 MessageLoop::current()->PostDelayedTask( | 61 base::MessageLoop::current()->PostDelayedTask( |
62 FROM_HERE, | 62 FROM_HERE, |
63 base::Bind(&EnsureTerminateMessageFilter::Terminate, this), | 63 base::Bind(&EnsureTerminateMessageFilter::Terminate, this), |
64 kPluginProcessTerminateTimeout); | 64 kPluginProcessTerminateTimeout); |
65 } | 65 } |
66 | 66 |
67 private: | 67 private: |
68 void Terminate() { | 68 void Terminate() { |
69 base::KillProcess(base::GetCurrentProcessHandle(), 0, false); | 69 base::KillProcess(base::GetCurrentProcessHandle(), 0, false); |
70 } | 70 } |
71 }; | 71 }; |
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
184 } | 184 } |
185 | 185 |
186 Send(new PluginProcessHostMsg_ChannelCreated(channel_handle)); | 186 Send(new PluginProcessHostMsg_ChannelCreated(channel_handle)); |
187 } | 187 } |
188 | 188 |
189 void PluginThread::OnNotifyRenderersOfPendingShutdown() { | 189 void PluginThread::OnNotifyRenderersOfPendingShutdown() { |
190 PluginChannel::NotifyRenderersOfPendingShutdown(); | 190 PluginChannel::NotifyRenderersOfPendingShutdown(); |
191 } | 191 } |
192 | 192 |
193 } // namespace content | 193 } // namespace content |
OLD | NEW |