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

Unified Diff: third_party/WebKit/Source/platform/WebTaskRunner.cpp

Issue 2876513002: Use WTF::TimeDelta to specify delays on WebTaskRunner (Closed)
Patch Set: mac fix Created 3 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/platform/WebTaskRunner.cpp
diff --git a/third_party/WebKit/Source/platform/WebTaskRunner.cpp b/third_party/WebKit/Source/platform/WebTaskRunner.cpp
index 8bd0ea344cb59dc3792e2cb6ddd883014eb4ca2c..8bdfe5747ab8f8103ff2809f558b9332fba83941 100644
--- a/third_party/WebKit/Source/platform/WebTaskRunner.cpp
+++ b/third_party/WebKit/Source/platform/WebTaskRunner.cpp
@@ -127,10 +127,9 @@ void WebTaskRunner::PostTask(const WebTraceLocation& location,
void WebTaskRunner::PostDelayedTask(const WebTraceLocation& location,
std::unique_ptr<CrossThreadClosure> task,
- long long delay_ms) {
+ TimeDelta delay) {
ToSingleThreadTaskRunner()->PostDelayedTask(
- location, base::Bind(&RunCrossThreadClosure, base::Passed(&task)),
- base::TimeDelta::FromMilliseconds(delay_ms));
+ location, base::Bind(&RunCrossThreadClosure, base::Passed(&task)), delay);
}
void WebTaskRunner::PostTask(const WebTraceLocation& location,
@@ -141,10 +140,9 @@ void WebTaskRunner::PostTask(const WebTraceLocation& location,
void WebTaskRunner::PostDelayedTask(const WebTraceLocation& location,
std::unique_ptr<WTF::Closure> task,
- long long delay_ms) {
+ TimeDelta delay) {
ToSingleThreadTaskRunner()->PostDelayedTask(
- location, ConvertToBaseCallback(std::move(task)),
- base::TimeDelta::FromMilliseconds(delay_ms));
+ location, ConvertToBaseCallback(std::move(task)), delay);
}
TaskHandle WebTaskRunner::PostCancellableTask(
@@ -161,14 +159,14 @@ TaskHandle WebTaskRunner::PostCancellableTask(
TaskHandle WebTaskRunner::PostDelayedCancellableTask(
const WebTraceLocation& location,
std::unique_ptr<WTF::Closure> task,
- long long delay_ms) {
+ TimeDelta delay) {
DCHECK(RunsTasksOnCurrentThread());
RefPtr<TaskHandle::Runner> runner =
AdoptRef(new TaskHandle::Runner(std::move(task)));
PostDelayedTask(location,
WTF::Bind(&TaskHandle::Runner::Run, runner->AsWeakPtr(),
TaskHandle(runner)),
- delay_ms);
+ delay);
return TaskHandle(runner);
}
« no previous file with comments | « third_party/WebKit/Source/platform/WebTaskRunner.h ('k') | third_party/WebKit/Source/platform/WebTaskRunnerTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698