summaryrefslogtreecommitdiffstats
path: root/content
diff options
context:
space:
mode:
authortedvessenes@gmail.com <tedvessenes@gmail.com@0039d316-1c4b-4281-b951-d872f2087c98>2012-01-27 00:45:33 +0000
committertedvessenes@gmail.com <tedvessenes@gmail.com@0039d316-1c4b-4281-b951-d872f2087c98>2012-01-27 00:45:33 +0000
commit02798a98ff76ed7f21c446dfb76e9d46f561d5cf (patch)
tree8446dcbb05cf2630a715fe84e517f477f2f99546 /content
parent1d7382f2c7d71448dc1c2292ff104b814f1308ec (diff)
downloadchromium_src-02798a98ff76ed7f21c446dfb76e9d46f561d5cf.zip
chromium_src-02798a98ff76ed7f21c446dfb76e9d46f561d5cf.tar.gz
chromium_src-02798a98ff76ed7f21c446dfb76e9d46f561d5cf.tar.bz2
Convert use of int ms to TimeDelta in files owned by brettw.
BUG=108171 TEST= Review URL: http://codereview.chromium.org/9233018 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@119321 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content')
-rw-r--r--content/browser/browser_child_process_host_impl.cc7
-rw-r--r--content/browser/browser_thread_impl.cc5
-rw-r--r--content/browser/gamepad/gamepad_provider.cc2
-rw-r--r--content/browser/renderer_host/resource_dispatcher_host_uitest.cc4
-rw-r--r--content/ppapi_plugin/broker_process_dispatcher.cc6
-rw-r--r--content/ppapi_plugin/plugin_process_dispatcher.cc6
-rw-r--r--content/renderer/load_progress_tracker.cc10
-rw-r--r--content/renderer/render_widget.cc8
8 files changed, 26 insertions, 22 deletions
diff --git a/content/browser/browser_child_process_host_impl.cc b/content/browser/browser_child_process_host_impl.cc
index 54f8fcc..c5874df 100644
--- a/content/browser/browser_child_process_host_impl.cc
+++ b/content/browser/browser_child_process_host_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.
@@ -258,12 +258,13 @@ void BrowserChildProcessHostImpl::OnChildDisconnected() {
// disconnecting the channel so that the exit code and termination status
// become available. This is best effort -- if the process doesn't die
// within the time limit, this object gets destroyed.
- const int kExitCodeWaitMs = 250;
+ const base::TimeDelta kExitCodeWait =
+ base::TimeDelta::FromMilliseconds(250);
MessageLoop::current()->PostDelayedTask(
FROM_HERE,
base::Bind(&BrowserChildProcessHostImpl::OnChildDisconnected,
task_factory_.GetWeakPtr()),
- kExitCodeWaitMs);
+ kExitCodeWait);
#endif
return;
}
diff --git a/content/browser/browser_thread_impl.cc b/content/browser/browser_thread_impl.cc
index 0814a3c..155160b 100644
--- a/content/browser/browser_thread_impl.cc
+++ b/content/browser/browser_thread_impl.cc
@@ -161,10 +161,11 @@ bool BrowserThreadImpl::PostTaskHelper(
MessageLoop* message_loop = globals.threads[identifier] ?
globals.threads[identifier]->message_loop() : NULL;
if (message_loop) {
+ base::TimeDelta delay = base::TimeDelta::FromMilliseconds(delay_ms);
if (nestable) {
- message_loop->PostDelayedTask(from_here, task, delay_ms);
+ message_loop->PostDelayedTask(from_here, task, delay);
} else {
- message_loop->PostNonNestableDelayedTask(from_here, task, delay_ms);
+ message_loop->PostNonNestableDelayedTask(from_here, task, delay);
}
}
diff --git a/content/browser/gamepad/gamepad_provider.cc b/content/browser/gamepad/gamepad_provider.cc
index 4c00cc1..3c533c3 100644
--- a/content/browser/gamepad/gamepad_provider.cc
+++ b/content/browser/gamepad/gamepad_provider.cc
@@ -140,7 +140,7 @@ void GamepadProvider::ScheduleDoPoll() {
MessageLoop::current()->PostDelayedTask(
FROM_HERE,
base::Bind(&GamepadProvider::DoPoll, weak_factory_.GetWeakPtr()),
- kDesiredSamplingIntervalMs);
+ base::TimeDelta::FromMilliseconds(kDesiredSamplingIntervalMs));
}
GamepadHardwareBuffer* GamepadProvider::SharedMemoryAsHardwareBuffer() {
diff --git a/content/browser/renderer_host/resource_dispatcher_host_uitest.cc b/content/browser/renderer_host/resource_dispatcher_host_uitest.cc
index b46ae9f..8fbb16d 100644
--- a/content/browser/renderer_host/resource_dispatcher_host_uitest.cc
+++ b/content/browser/renderer_host/resource_dispatcher_host_uitest.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.
@@ -287,7 +287,7 @@ TEST_F(ResourceDispatcherTest, FAILS_CrossSiteAfterCrash) {
#endif
ASSERT_TRUE(tab->NavigateToURLAsync(GURL(chrome::kAboutCrashURL)));
// Wait for browser to notice the renderer crash.
- base::PlatformThread::Sleep(TestTimeouts::action_timeout_ms());
+ base::PlatformThread::Sleep(TestTimeouts::action_timeout());
// Navigate to a new cross-site page. The browser should not wait around for
// the old renderer's on{before}unload handlers to run.
diff --git a/content/ppapi_plugin/broker_process_dispatcher.cc b/content/ppapi_plugin/broker_process_dispatcher.cc
index 6fce803..7cdc0e34 100644
--- a/content/ppapi_plugin/broker_process_dispatcher.cc
+++ b/content/ppapi_plugin/broker_process_dispatcher.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.
@@ -11,7 +11,7 @@
namespace {
// How long we wait before releasing the broker process.
-const int kBrokerReleaseTimeMs = 30 * 1000; // 30 seconds.
+const int kBrokerReleaseTimeSeconds = 30;
} // namespace
@@ -34,5 +34,5 @@ BrokerProcessDispatcher::~BrokerProcessDispatcher() {
FROM_HERE,
base::Bind(&ChildProcess::ReleaseProcess,
base::Unretained(ChildProcess::current())),
- kBrokerReleaseTimeMs);
+ base::TimeDelta::FromSeconds(kBrokerReleaseTimeSeconds));
}
diff --git a/content/ppapi_plugin/plugin_process_dispatcher.cc b/content/ppapi_plugin/plugin_process_dispatcher.cc
index 1ac23d1..5d33e12 100644
--- a/content/ppapi_plugin/plugin_process_dispatcher.cc
+++ b/content/ppapi_plugin/plugin_process_dispatcher.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.
@@ -11,7 +11,7 @@
namespace {
// How long we wait before releasing the plugin process.
-const int kPluginReleaseTimeMs = 30 * 1000; // 30 seconds.
+const int kPluginReleaseTimeSeconds = 30;
} // namespace
@@ -32,5 +32,5 @@ PluginProcessDispatcher::~PluginProcessDispatcher() {
FROM_HERE,
base::Bind(&ChildProcess::ReleaseProcess,
base::Unretained(ChildProcess::current())),
- kPluginReleaseTimeMs);
+ base::TimeDelta::FromSeconds(kPluginReleaseTimeSeconds));
}
diff --git a/content/renderer/load_progress_tracker.cc b/content/renderer/load_progress_tracker.cc
index cc153f6..b7a14ba 100644
--- a/content/renderer/load_progress_tracker.cc
+++ b/content/renderer/load_progress_tracker.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.
@@ -51,9 +51,11 @@ void LoadProgressTracker::DidChangeLoadProgress(WebKit::WebFrame* frame,
// last updates. Also, since the message loop may be pretty busy when a page
// is loaded, it might not execute a posted task in a timely manner so we make
// sure to immediately send progress report if enough time has passed.
+ base::TimeDelta min_delay =
+ base::TimeDelta::FromMilliseconds(kMinimumDelayBetweenUpdatesMS);
if (progress == 1.0 || last_time_progress_sent_.is_null() ||
- (base::TimeTicks::Now() - last_time_progress_sent_).InMilliseconds() >
- kMinimumDelayBetweenUpdatesMS) {
+ base::TimeTicks::Now() - last_time_progress_sent_ >
+ min_delay) {
// If there is a pending task to send progress, it is now obsolete.
weak_factory_.InvalidateWeakPtrs();
SendChangeLoadProgress();
@@ -69,7 +71,7 @@ void LoadProgressTracker::DidChangeLoadProgress(WebKit::WebFrame* frame,
FROM_HERE,
base::Bind(&LoadProgressTracker::SendChangeLoadProgress,
weak_factory_.GetWeakPtr()),
- kMinimumDelayBetweenUpdatesMS);
+ min_delay);
}
void LoadProgressTracker::SendChangeLoadProgress() {
diff --git a/content/renderer/render_widget.cc b/content/renderer/render_widget.cc
index e60c793..dfdae16 100644
--- a/content/renderer/render_widget.cc
+++ b/content/renderer/render_widget.cc
@@ -676,13 +676,13 @@ void RenderWidget::AnimateIfNeeded() {
return;
// Target 60FPS if vsync is on. Go as fast as we can if vsync is off.
- int animationInterval = IsRenderingVSynced() ? 16 : 0;
+ base::TimeDelta animationInterval = IsRenderingVSynced() ?
+ base::TimeDelta::FromMilliseconds(16) : base::TimeDelta();
base::Time now = base::Time::Now();
if (now >= animation_floor_time_ || is_accelerated_compositing_active_) {
TRACE_EVENT0("renderer", "RenderWidget::AnimateIfNeeded")
- animation_floor_time_ = now +
- base::TimeDelta::FromMilliseconds(animationInterval);
+ animation_floor_time_ = now + animationInterval;
// Set a timer to call us back after animationInterval before
// running animation callbacks so that if a callback requests another
// we'll be sure to run it at the proper time.
@@ -705,7 +705,7 @@ void RenderWidget::AnimateIfNeeded() {
// base::Time::Now() has advanced past the animation_floor_time_. To
// avoid exposing this delay to javascript, we keep posting delayed
// tasks until base::Time::Now() has advanced far enough.
- int64 delay = (animation_floor_time_ - now).InMillisecondsRoundedUp();
+ base::TimeDelta delay = animation_floor_time_ - now;
animation_task_posted_ = true;
MessageLoop::current()->PostDelayedTask(
FROM_HERE, base::Bind(&RenderWidget::AnimationCallback, this), delay);