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 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 namespace { | 44 namespace { |
45 | 45 |
46 class EnsureTerminateMessageFilter : public IPC::ChannelProxy::MessageFilter { | 46 class EnsureTerminateMessageFilter : public IPC::ChannelProxy::MessageFilter { |
47 public: | 47 public: |
48 EnsureTerminateMessageFilter() {} | 48 EnsureTerminateMessageFilter() {} |
49 | 49 |
50 protected: | 50 protected: |
51 virtual ~EnsureTerminateMessageFilter() {} | 51 virtual ~EnsureTerminateMessageFilter() {} |
52 | 52 |
53 // IPC::ChannelProxy::MessageFilter: | 53 // IPC::ChannelProxy::MessageFilter: |
54 virtual void OnChannelError() { | 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 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); |
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
181 } | 181 } |
182 | 182 |
183 Send(new PluginProcessHostMsg_ChannelCreated(channel_handle)); | 183 Send(new PluginProcessHostMsg_ChannelCreated(channel_handle)); |
184 } | 184 } |
185 | 185 |
186 void PluginThread::OnNotifyRenderersOfPendingShutdown() { | 186 void PluginThread::OnNotifyRenderersOfPendingShutdown() { |
187 PluginChannel::NotifyRenderersOfPendingShutdown(); | 187 PluginChannel::NotifyRenderersOfPendingShutdown(); |
188 } | 188 } |
189 | 189 |
190 } // namespace content | 190 } // namespace content |
OLD | NEW |