diff options
author | tedvessenes@gmail.com <tedvessenes@gmail.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-03-07 04:41:40 +0000 |
---|---|---|
committer | tedvessenes@gmail.com <tedvessenes@gmail.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-03-07 04:41:40 +0000 |
commit | 5896fa04bfa1bef627d6d9bb101326668bc29bb4 (patch) | |
tree | cc751999e5e87e0ab250d015e4b121e67fc47c15 | |
parent | 1813439565ec0222546b3e2fbaaf5d67ba639bfd (diff) | |
download | chromium_src-5896fa04bfa1bef627d6d9bb101326668bc29bb4.zip chromium_src-5896fa04bfa1bef627d6d9bb101326668bc29bb4.tar.gz chromium_src-5896fa04bfa1bef627d6d9bb101326668bc29bb4.tar.bz2 |
Convert uses of int ms to TimeDelta in content/browser, ipc, and webkit/plugins.
R=jam@chromium.org
BUG=108171
Review URL: http://codereview.chromium.org/9572035
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@125324 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | content/browser/plugin_data_remover_impl.cc | 4 | ||||
-rw-r--r-- | content/browser/renderer_host/database_message_filter.cc | 4 | ||||
-rw-r--r-- | content/browser/renderer_host/render_widget_host_unittest.cc | 14 | ||||
-rw-r--r-- | content/browser/trace_controller.cc | 6 | ||||
-rw-r--r-- | ipc/ipc_channel_posix_unittest.cc | 7 | ||||
-rw-r--r-- | ipc/ipc_sync_channel.cc | 2 | ||||
-rw-r--r-- | ipc/ipc_sync_channel_unittest.cc | 4 | ||||
-rw-r--r-- | webkit/plugins/ppapi/plugin_module.cc | 2 |
8 files changed, 25 insertions, 18 deletions
diff --git a/content/browser/plugin_data_remover_impl.cc b/content/browser/plugin_data_remover_impl.cc index 35fde09..e4d9bb4 100644 --- a/content/browser/plugin_data_remover_impl.cc +++ b/content/browser/plugin_data_remover_impl.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -84,7 +84,7 @@ class PluginDataRemoverImpl::Context BrowserThread::IO, FROM_HERE, base::Bind(&Context::OnTimeout, this), - kRemovalTimeoutMs); + base::TimeDelta::FromMilliseconds(kRemovalTimeoutMs)); } // Initialize on the IO thread. diff --git a/content/browser/renderer_host/database_message_filter.cc b/content/browser/renderer_host/database_message_filter.cc index cd6412e..1cebcb3 100644 --- a/content/browser/renderer_host/database_message_filter.cc +++ b/content/browser/renderer_host/database_message_filter.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -210,7 +210,7 @@ void DatabaseMessageFilter::DatabaseDeleteFile(const string16& vfs_file_name, BrowserThread::FILE, FROM_HERE, base::Bind(&DatabaseMessageFilter::DatabaseDeleteFile, this, vfs_file_name, sync_dir, reply_msg, reschedule_count - 1), - kDelayDeleteRetryMs); + base::TimeDelta::FromMilliseconds(kDelayDeleteRetryMs)); return; } } diff --git a/content/browser/renderer_host/render_widget_host_unittest.cc b/content/browser/renderer_host/render_widget_host_unittest.cc index f8213b9..b8665e4d 100644 --- a/content/browser/renderer_host/render_widget_host_unittest.cc +++ b/content/browser/renderer_host/render_widget_host_unittest.cc @@ -726,11 +726,11 @@ TEST_F(RenderWidgetHostTest, DontPostponeHangMonitorTimeout) { // Immediately try to add a long 30 second timeout. EXPECT_FALSE(host_->unresponsive_timer_fired()); - host_->StartHangMonitorTimeout(TimeDelta::FromMilliseconds(30000)); + host_->StartHangMonitorTimeout(TimeDelta::FromSeconds(30)); // Wait long enough for first timeout and see if it fired. - MessageLoop::current()->PostDelayedTask(FROM_HERE, - MessageLoop::QuitClosure(), 10); + MessageLoop::current()->PostDelayedTask( + FROM_HERE, MessageLoop::QuitClosure(), TimeDelta::FromMilliseconds(10)); MessageLoop::current()->Run(); EXPECT_TRUE(host_->unresponsive_timer_fired()); } @@ -747,8 +747,8 @@ TEST_F(RenderWidgetHostTest, StopAndStartHangMonitorTimeout) { host_->StartHangMonitorTimeout(TimeDelta::FromMilliseconds(10)); // Wait long enough for first timeout and see if it fired. - MessageLoop::current()->PostDelayedTask(FROM_HERE, - MessageLoop::QuitClosure(), 40); + MessageLoop::current()->PostDelayedTask( + FROM_HERE, MessageLoop::QuitClosure(), TimeDelta::FromMilliseconds(40)); MessageLoop::current()->Run(); EXPECT_TRUE(host_->unresponsive_timer_fired()); } @@ -767,8 +767,8 @@ TEST_F(RenderWidgetHostTest, MultipleInputEvents) { SendInputEventACK(WebInputEvent::RawKeyDown, true); // Wait long enough for first timeout and see if it fired. - MessageLoop::current()->PostDelayedTask(FROM_HERE, - MessageLoop::QuitClosure(), 40); + MessageLoop::current()->PostDelayedTask( + FROM_HERE, MessageLoop::QuitClosure(), TimeDelta::FromMilliseconds(40)); MessageLoop::current()->Run(); EXPECT_TRUE(host_->unresponsive_timer_fired()); } diff --git a/content/browser/trace_controller.cc b/content/browser/trace_controller.cc index 41770cd..3c669b4 100644 --- a/content/browser/trace_controller.cc +++ b/content/browser/trace_controller.cc @@ -97,10 +97,12 @@ void TraceController::InitStartupTracing(const CommandLine& command_line) { } OnTracingBegan(subscriber.get()); - BrowserThread::PostDelayedTask(BrowserThread::UI, FROM_HERE, + BrowserThread::PostDelayedTask( + BrowserThread::UI, + FROM_HERE, base::Bind(&AutoStopTraceSubscriberStdio::EndStartupTrace, base::Unretained(subscriber.release())), - delay_secs * 1000); + base::TimeDelta::FromSeconds(delay_secs)); } bool TraceController::GetKnownCategoriesAsync(TraceSubscriber* subscriber) { diff --git a/ipc/ipc_channel_posix_unittest.cc b/ipc/ipc_channel_posix_unittest.cc index e8856a9..b4ec401 100644 --- a/ipc/ipc_channel_posix_unittest.cc +++ b/ipc/ipc_channel_posix_unittest.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -177,7 +177,10 @@ void IPCChannelPosixTest::SpinRunLoop(int milliseconds) { // in the case of a bad test. Usually, the run loop will quit sooner than // that because all tests use a IPCChannelPosixTestListener which quits the // current run loop on any channel activity. - loop->PostDelayedTask(FROM_HERE, MessageLoop::QuitClosure(), milliseconds); + loop->PostDelayedTask( + FROM_HERE, + MessageLoop::QuitClosure(), + base::TimeDelta::FromMilliseconds(milliseconds)); loop->Run(); } diff --git a/ipc/ipc_sync_channel.cc b/ipc/ipc_sync_channel.cc index be8315c..b331779 100644 --- a/ipc/ipc_sync_channel.cc +++ b/ipc/ipc_sync_channel.cc @@ -445,7 +445,7 @@ bool SyncChannel::SendWithTimeout(Message* message, int timeout_ms) { context->ipc_message_loop()->PostDelayedTask( FROM_HERE, base::Bind(&SyncContext::OnSendTimeout, context.get(), message_id), - timeout_ms); + base::TimeDelta::FromMilliseconds(timeout_ms)); } // Wait for reply, or for any other incoming synchronous messages. diff --git a/ipc/ipc_sync_channel_unittest.cc b/ipc/ipc_sync_channel_unittest.cc index 81ca560..2b74ff4 100644 --- a/ipc/ipc_sync_channel_unittest.cc +++ b/ipc/ipc_sync_channel_unittest.cc @@ -1053,7 +1053,9 @@ class DoneEventRaceServer : public Worker { MessageLoop::current()->PostTask(FROM_HERE, base::Bind(&NestedCallback, this)); MessageLoop::current()->PostDelayedTask( - FROM_HERE, base::Bind(&TimeoutCallback), 9000); + FROM_HERE, + base::Bind(&TimeoutCallback), + base::TimeDelta::FromSeconds(9)); // Even though we have a timeout on the Send, it will succeed since for this // bug, the reply message comes back and is deserialized, however the done // event wasn't set. So we indirectly use the timeout task to notice if a diff --git a/webkit/plugins/ppapi/plugin_module.cc b/webkit/plugins/ppapi/plugin_module.cc index d296240..6865661 100644 --- a/webkit/plugins/ppapi/plugin_module.cc +++ b/webkit/plugins/ppapi/plugin_module.cc @@ -185,7 +185,7 @@ void CallOnMainThread(int delay_in_msec, GetMainThreadMessageLoop()->PostDelayedTask( FROM_HERE, base::Bind(callback.func, callback.user_data, result), - delay_in_msec); + base::TimeDelta::FromMilliseconds(delay_in_msec)); } } |