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

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

Issue 9185026: Convert use of int ms to TimeDelta in files owned by brettw. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Explicitly include base/time.h in header file. Created 8 years, 11 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
« no previous file with comments | « content/plugin/plugin_channel.cc ('k') | content/ppapi_plugin/broker_process_dispatcher.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) 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/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_USES_GTK) 9 #if defined(TOOLKIT_USES_GTK)
10 #include <gtk/gtk.h> 10 #include <gtk/gtk.h>
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 namespace { 42 namespace {
43 43
44 class EnsureTerminateMessageFilter : public IPC::ChannelProxy::MessageFilter { 44 class EnsureTerminateMessageFilter : public IPC::ChannelProxy::MessageFilter {
45 public: 45 public:
46 EnsureTerminateMessageFilter() {} 46 EnsureTerminateMessageFilter() {}
47 ~EnsureTerminateMessageFilter() {} 47 ~EnsureTerminateMessageFilter() {}
48 48
49 private: 49 private:
50 virtual void OnChannelError() { 50 virtual void OnChannelError() {
51 // How long we wait before forcibly shutting down the process. 51 // How long we wait before forcibly shutting down the process.
52 const int kPluginProcessTerminateTimeoutMs = 3000; 52 const base::TimeDelta kPluginProcessTerminateTimeout =
53 base::TimeDelta::FromSeconds(3);
53 // Ensure that we don't wait indefinitely for the plugin to shutdown. 54 // Ensure that we don't wait indefinitely for the plugin to shutdown.
54 // as the browser does not terminate plugin processes on shutdown. 55 // as the browser does not terminate plugin processes on shutdown.
55 // We achieve this by posting an exit process task on the IO thread. 56 // We achieve this by posting an exit process task on the IO thread.
56 MessageLoop::current()->PostDelayedTask( 57 MessageLoop::current()->PostDelayedTask(
57 FROM_HERE, 58 FROM_HERE,
58 base::Bind(&EnsureTerminateMessageFilter::Terminate, this), 59 base::Bind(&EnsureTerminateMessageFilter::Terminate, this),
59 kPluginProcessTerminateTimeoutMs); 60 kPluginProcessTerminateTimeout);
60 } 61 }
61 62
62 void Terminate() { 63 void Terminate() {
63 base::KillProcess(base::GetCurrentProcessHandle(), 0, false); 64 base::KillProcess(base::GetCurrentProcessHandle(), 0, false);
64 } 65 }
65 }; 66 };
66 67
67 } // namespace 68 } // namespace
68 69
69 static base::LazyInstance<base::ThreadLocalPointer<PluginThread> > lazy_tls = 70 static base::LazyInstance<base::ThreadLocalPointer<PluginThread> > lazy_tls =
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
168 #endif 169 #endif
169 channel->set_incognito(incognito); 170 channel->set_incognito(incognito);
170 } 171 }
171 172
172 Send(new PluginProcessHostMsg_ChannelCreated(channel_handle)); 173 Send(new PluginProcessHostMsg_ChannelCreated(channel_handle));
173 } 174 }
174 175
175 void PluginThread::OnNotifyRenderersOfPendingShutdown() { 176 void PluginThread::OnNotifyRenderersOfPendingShutdown() {
176 PluginChannel::NotifyRenderersOfPendingShutdown(); 177 PluginChannel::NotifyRenderersOfPendingShutdown();
177 } 178 }
OLDNEW
« no previous file with comments | « content/plugin/plugin_channel.cc ('k') | content/ppapi_plugin/broker_process_dispatcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698