Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(61)

Side by Side Diff: content/plugin/plugin_thread.cc

Issue 14335017: content: Use base::MessageLoop. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 7 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « content/plugin/plugin_main.cc ('k') | content/plugin/webplugin_delegate_stub.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « content/plugin/plugin_main.cc ('k') | content/plugin/webplugin_delegate_stub.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698