Revert 140102 - Remove old PostDelayedTask interfaces that use int ms instead of TimeDelta.
Compile failed on ChromiumOS x86 and Tegra.

BUG=108171


Review URL: https://chromiumcodereview.appspot.com/9703053

TBR=tedvessenes@gmail.com
Review URL: https://chromiumcodereview.appspot.com/10496002

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@140109 0039d316-1c4b-4281-b951-d872f2087c98


CrOS-Libchrome-Original-Commit: ad5fb16613da3b87e9b271212616c6538494ba82
diff --git a/base/message_loop.cc b/base/message_loop.cc
index 5c3b2bf..a207659 100644
--- a/base/message_loop.cc
+++ b/base/message_loop.cc
@@ -258,37 +258,48 @@
 void MessageLoop::PostTask(
     const tracked_objects::Location& from_here, const base::Closure& task) {
   DCHECK(!task.is_null()) << from_here.ToString();
-  PendingTask pending_task(
-      from_here, task, CalculateDelayedRuntime(TimeDelta()), true);
+  PendingTask pending_task(from_here, task, CalculateDelayedRuntime(0), true);
   AddToIncomingQueue(&pending_task);
 }
 
 void MessageLoop::PostDelayedTask(
     const tracked_objects::Location& from_here,
     const base::Closure& task,
-    TimeDelta delay) {
+    int64 delay_ms) {
   DCHECK(!task.is_null()) << from_here.ToString();
-  PendingTask pending_task(
-      from_here, task, CalculateDelayedRuntime(delay), true);
+  PendingTask pending_task(from_here, task,
+                           CalculateDelayedRuntime(delay_ms), true);
   AddToIncomingQueue(&pending_task);
 }
 
+void MessageLoop::PostDelayedTask(
+    const tracked_objects::Location& from_here,
+    const base::Closure& task,
+    base::TimeDelta delay) {
+  PostDelayedTask(from_here, task, delay.InMillisecondsRoundedUp());
+}
+
 void MessageLoop::PostNonNestableTask(
     const tracked_objects::Location& from_here, const base::Closure& task) {
   DCHECK(!task.is_null()) << from_here.ToString();
-  PendingTask pending_task(
-      from_here, task, CalculateDelayedRuntime(TimeDelta()), false);
+  PendingTask pending_task(from_here, task, CalculateDelayedRuntime(0), false);
+  AddToIncomingQueue(&pending_task);
+}
+
+void MessageLoop::PostNonNestableDelayedTask(
+    const tracked_objects::Location& from_here, const base::Closure& task,
+    int64 delay_ms) {
+  DCHECK(!task.is_null()) << from_here.ToString();
+  PendingTask pending_task(from_here, task,
+                           CalculateDelayedRuntime(delay_ms), false);
   AddToIncomingQueue(&pending_task);
 }
 
 void MessageLoop::PostNonNestableDelayedTask(
     const tracked_objects::Location& from_here,
     const base::Closure& task,
-    TimeDelta delay) {
-  DCHECK(!task.is_null()) << from_here.ToString();
-  PendingTask pending_task(
-      from_here, task, CalculateDelayedRuntime(delay), false);
-  AddToIncomingQueue(&pending_task);
+    base::TimeDelta delay) {
+  PostNonNestableDelayedTask(from_here, task, delay.InMillisecondsRoundedUp());
 }
 
 void MessageLoop::Run() {
@@ -532,10 +543,11 @@
   return did_work;
 }
 
-TimeTicks MessageLoop::CalculateDelayedRuntime(TimeDelta delay) {
+TimeTicks MessageLoop::CalculateDelayedRuntime(int64 delay_ms) {
   TimeTicks delayed_run_time;
-  if (delay > TimeDelta()) {
-    delayed_run_time = TimeTicks::Now() + delay;
+  if (delay_ms > 0) {
+    delayed_run_time =
+        TimeTicks::Now() + TimeDelta::FromMilliseconds(delay_ms);
 
 #if defined(OS_WIN)
     if (high_resolution_timer_expiration_.is_null()) {
@@ -544,8 +556,8 @@
       // which as a percentage is pretty inaccurate.  So enable high
       // res timers for any timer which is within 2x of the granularity.
       // This is a tradeoff between accuracy and power management.
-      bool needs_high_res_timers = delay.InMilliseconds() <
-          (2 * base::Time::kMinLowResolutionThresholdMs);
+      bool needs_high_res_timers =
+          delay_ms < (2 * base::Time::kMinLowResolutionThresholdMs);
       if (needs_high_res_timers) {
         if (base::Time::ActivateHighResolutionTimer(true)) {
           high_resolution_timer_expiration_ = TimeTicks::Now() +
@@ -555,7 +567,7 @@
     }
 #endif
   } else {
-    DCHECK_EQ(delay.InMilliseconds(), 0) << "delay should not be negative";
+    DCHECK_EQ(delay_ms, 0) << "delay should not be negative";
   }
 
 #if defined(OS_WIN)
diff --git a/base/message_loop.h b/base/message_loop.h
index a92ff7e..d78b58a 100644
--- a/base/message_loop.h
+++ b/base/message_loop.h
@@ -165,6 +165,10 @@
 
   void PostDelayedTask(
       const tracked_objects::Location& from_here,
+      const base::Closure& task, int64 delay_ms);
+
+  void PostDelayedTask(
+      const tracked_objects::Location& from_here,
       const base::Closure& task,
       base::TimeDelta delay);
 
@@ -174,6 +178,10 @@
 
   void PostNonNestableDelayedTask(
       const tracked_objects::Location& from_here,
+      const base::Closure& task, int64 delay_ms);
+
+  void PostNonNestableDelayedTask(
+      const tracked_objects::Location& from_here,
       const base::Closure& task,
       base::TimeDelta delay);
 
@@ -441,7 +449,7 @@
   bool DeletePendingTasks();
 
   // Calculates the time at which a PendingTask should run.
-  base::TimeTicks CalculateDelayedRuntime(base::TimeDelta delay);
+  base::TimeTicks CalculateDelayedRuntime(int64 delay_ms);
 
   // Start recording histogram info about events and action IF it was enabled
   // and IF the statistics recorder can accept a registration of our histogram.
diff --git a/base/message_loop_proxy_impl.cc b/base/message_loop_proxy_impl.cc
index b4ca210..9f6cb1f 100644
--- a/base/message_loop_proxy_impl.cc
+++ b/base/message_loop_proxy_impl.cc
@@ -12,6 +12,24 @@
 MessageLoopProxyImpl::~MessageLoopProxyImpl() {
 }
 
+// This function will be removed later in the fixing of CR Bug #108171.
+bool MessageLoopProxyImpl::PostDelayedTask(
+    const tracked_objects::Location& from_here,
+    const base::Closure& task,
+    int64 delay_ms) {
+  return PostDelayedTask(
+      from_here, task, base::TimeDelta::FromMilliseconds(delay_ms));
+}
+
+// This function will be removed later in the fixing of CR Bug #108171.
+bool MessageLoopProxyImpl::PostNonNestableDelayedTask(
+    const tracked_objects::Location& from_here,
+    const base::Closure& task,
+    int64 delay_ms) {
+  return PostNonNestableDelayedTask(
+      from_here, task, base::TimeDelta::FromMilliseconds(delay_ms));
+}
+
 bool MessageLoopProxyImpl::PostDelayedTask(
     const tracked_objects::Location& from_here,
     const base::Closure& task,
diff --git a/base/message_loop_proxy_impl.h b/base/message_loop_proxy_impl.h
index fd28194..140c244 100644
--- a/base/message_loop_proxy_impl.h
+++ b/base/message_loop_proxy_impl.h
@@ -21,10 +21,17 @@
   // MessageLoopProxy implementation
   virtual bool PostDelayedTask(const tracked_objects::Location& from_here,
                                const base::Closure& task,
+                               int64 delay_ms) OVERRIDE;
+  virtual bool PostDelayedTask(const tracked_objects::Location& from_here,
+                               const base::Closure& task,
                                base::TimeDelta delay) OVERRIDE;
   virtual bool PostNonNestableDelayedTask(
       const tracked_objects::Location& from_here,
       const base::Closure& task,
+      int64 delay_ms) OVERRIDE;
+  virtual bool PostNonNestableDelayedTask(
+      const tracked_objects::Location& from_here,
+      const base::Closure& task,
       base::TimeDelta delay) OVERRIDE;
   virtual bool RunsTasksOnCurrentThread() const OVERRIDE;
 
diff --git a/base/sequenced_task_runner.cc b/base/sequenced_task_runner.cc
index 00d4048..bab7d1c 100644
--- a/base/sequenced_task_runner.cc
+++ b/base/sequenced_task_runner.cc
@@ -11,7 +11,7 @@
 bool SequencedTaskRunner::PostNonNestableTask(
     const tracked_objects::Location& from_here,
     const Closure& task) {
-  return PostNonNestableDelayedTask(from_here, task, base::TimeDelta());
+  return PostNonNestableDelayedTask(from_here, task, 0);
 }
 
 bool SequencedTaskRunner::DeleteSoonInternal(
diff --git a/base/sequenced_task_runner.h b/base/sequenced_task_runner.h
index 5e0c89f..0db9128 100644
--- a/base/sequenced_task_runner.h
+++ b/base/sequenced_task_runner.h
@@ -114,6 +114,11 @@
   virtual bool PostNonNestableDelayedTask(
       const tracked_objects::Location& from_here,
       const Closure& task,
+      int64 delay_ms) = 0;
+
+  virtual bool PostNonNestableDelayedTask(
+      const tracked_objects::Location& from_here,
+      const Closure& task,
       base::TimeDelta delay) = 0;
 
   // Submits a non-nestable task to delete the given object.  Returns
diff --git a/base/task_runner.cc b/base/task_runner.cc
index b0563d4..734674f 100644
--- a/base/task_runner.cc
+++ b/base/task_runner.cc
@@ -42,7 +42,7 @@
 
 bool TaskRunner::PostTask(const tracked_objects::Location& from_here,
                           const Closure& task) {
-  return PostDelayedTask(from_here, task, base::TimeDelta());
+  return PostDelayedTask(from_here, task, 0);
 }
 
 bool TaskRunner::PostTaskAndReply(
diff --git a/base/task_runner.h b/base/task_runner.h
index c1e1758..894eb87 100644
--- a/base/task_runner.h
+++ b/base/task_runner.h
@@ -72,6 +72,11 @@
   //
   // It is valid for an implementation to ignore |delay_ms|; that is,
   // to have PostDelayedTask behave the same as PostTask.
+  //
+  // TODO(tedv): Make PostDelayedTask use TimeDelta instead.
+  virtual bool PostDelayedTask(const tracked_objects::Location& from_here,
+                               const Closure& task,
+                               int64 delay_ms) = 0;
   virtual bool PostDelayedTask(const tracked_objects::Location& from_here,
                                const Closure& task,
                                base::TimeDelta delay) = 0;
diff --git a/base/threading/platform_thread.h b/base/threading/platform_thread.h
index fc64f78..3843ce5 100644
--- a/base/threading/platform_thread.h
+++ b/base/threading/platform_thread.h
@@ -64,6 +64,9 @@
   // Yield the current thread so another thread can be scheduled.
   static void YieldCurrentThread();
 
+  // Sleeps for the specified duration (units are milliseconds).
+  static void Sleep(int duration_ms);
+
   // Sleeps for the specified duration.
   static void Sleep(base::TimeDelta duration);
 
diff --git a/base/threading/platform_thread_posix.cc b/base/threading/platform_thread_posix.cc
index 59162b9..77039a0 100644
--- a/base/threading/platform_thread_posix.cc
+++ b/base/threading/platform_thread_posix.cc
@@ -176,6 +176,13 @@
 }
 
 // static
+void PlatformThread::Sleep(int duration_ms) {
+  // NOTE: This function will be supplanted by the other version of Sleep
+  // in the future.  See issue 108171 for more information.
+  Sleep(TimeDelta::FromMilliseconds(duration_ms));
+}
+
+// static
 void PlatformThread::Sleep(TimeDelta duration) {
   struct timespec sleep_time, remaining;
 
diff --git a/base/threading/sequenced_worker_pool.cc b/base/threading/sequenced_worker_pool.cc
index 3bc26b4..59c4187 100644
--- a/base/threading/sequenced_worker_pool.cc
+++ b/base/threading/sequenced_worker_pool.cc
@@ -62,6 +62,9 @@
   // TaskRunner implementation
   virtual bool PostDelayedTask(const tracked_objects::Location& from_here,
                                const Closure& task,
+                               int64 delay_ms) OVERRIDE;
+  virtual bool PostDelayedTask(const tracked_objects::Location& from_here,
+                               const Closure& task,
                                TimeDelta delay) OVERRIDE;
   virtual bool RunsTasksOnCurrentThread() const OVERRIDE;
 
@@ -73,6 +76,10 @@
   bool PostDelayedTaskAssertZeroDelay(
       const tracked_objects::Location& from_here,
       const Closure& task,
+      int64 delay_ms);
+  bool PostDelayedTaskAssertZeroDelay(
+      const tracked_objects::Location& from_here,
+      const Closure& task,
       TimeDelta delay);
 
   const scoped_refptr<SequencedWorkerPool> pool_;
@@ -95,6 +102,13 @@
 bool SequencedWorkerPoolTaskRunner::PostDelayedTask(
     const tracked_objects::Location& from_here,
     const Closure& task,
+    int64 delay_ms) {
+  return PostDelayedTaskAssertZeroDelay(from_here, task, delay_ms);
+}
+
+bool SequencedWorkerPoolTaskRunner::PostDelayedTask(
+    const tracked_objects::Location& from_here,
+    const Closure& task,
     TimeDelta delay) {
   return PostDelayedTaskAssertZeroDelay(from_here, task, delay);
 }
@@ -106,15 +120,24 @@
 bool SequencedWorkerPoolTaskRunner::PostDelayedTaskAssertZeroDelay(
     const tracked_objects::Location& from_here,
     const Closure& task,
-    TimeDelta delay) {
+    int64 delay_ms) {
   // TODO(francoisk777@gmail.com): Change the following two statements once
   // SequencedWorkerPool supports non-zero delays.
-  DCHECK_EQ(delay.InMillisecondsRoundedUp(), 0)
+  DCHECK_EQ(delay_ms, 0)
       << "SequencedWorkerPoolTaskRunner does not yet support non-zero delays";
   return pool_->PostWorkerTaskWithShutdownBehavior(
       from_here, task, shutdown_behavior_);
 }
 
+bool SequencedWorkerPoolTaskRunner::PostDelayedTaskAssertZeroDelay(
+    const tracked_objects::Location& from_here,
+    const Closure& task,
+    TimeDelta delay) {
+  return PostDelayedTaskAssertZeroDelay(from_here,
+                                        task,
+                                        delay.InMillisecondsRoundedUp());
+}
+
 // SequencedWorkerPoolSequencedTaskRunner ------------------------------------
 // A SequencedTaskRunner which posts tasks to a SequencedWorkerPool with a
 // fixed sequence token.
@@ -130,6 +153,9 @@
   // TaskRunner implementation
   virtual bool PostDelayedTask(const tracked_objects::Location& from_here,
                                const Closure& task,
+                               int64 delay_ms) OVERRIDE;
+  virtual bool PostDelayedTask(const tracked_objects::Location& from_here,
+                               const Closure& task,
                                TimeDelta delay) OVERRIDE;
   virtual bool RunsTasksOnCurrentThread() const OVERRIDE;
 
@@ -137,6 +163,10 @@
   virtual bool PostNonNestableDelayedTask(
       const tracked_objects::Location& from_here,
       const Closure& task,
+      int64 delay_ms) OVERRIDE;
+  virtual bool PostNonNestableDelayedTask(
+      const tracked_objects::Location& from_here,
+      const Closure& task,
       TimeDelta delay) OVERRIDE;
 
  private:
@@ -147,6 +177,10 @@
   bool PostDelayedTaskAssertZeroDelay(
       const tracked_objects::Location& from_here,
       const Closure& task,
+      int64 delay_ms);
+  bool PostDelayedTaskAssertZeroDelay(
+      const tracked_objects::Location& from_here,
+      const Closure& task,
       TimeDelta delay);
 
   const scoped_refptr<SequencedWorkerPool> pool_;
@@ -174,6 +208,13 @@
 bool SequencedWorkerPoolSequencedTaskRunner::PostDelayedTask(
     const tracked_objects::Location& from_here,
     const Closure& task,
+    int64 delay_ms) {
+  return PostDelayedTaskAssertZeroDelay(from_here, task, delay_ms);
+}
+
+bool SequencedWorkerPoolSequencedTaskRunner::PostDelayedTask(
+    const tracked_objects::Location& from_here,
+    const Closure& task,
     TimeDelta delay) {
   return PostDelayedTaskAssertZeroDelay(from_here, task, delay);
 }
@@ -185,6 +226,13 @@
 bool SequencedWorkerPoolSequencedTaskRunner::PostNonNestableDelayedTask(
     const tracked_objects::Location& from_here,
     const Closure& task,
+    int64 delay_ms) {
+  return PostDelayedTaskAssertZeroDelay(from_here, task, delay_ms);
+}
+
+bool SequencedWorkerPoolSequencedTaskRunner::PostNonNestableDelayedTask(
+    const tracked_objects::Location& from_here,
+    const Closure& task,
     TimeDelta delay) {
   return PostDelayedTaskAssertZeroDelay(from_here, task, delay);
 }
@@ -192,16 +240,25 @@
 bool SequencedWorkerPoolSequencedTaskRunner::PostDelayedTaskAssertZeroDelay(
     const tracked_objects::Location& from_here,
     const Closure& task,
-    TimeDelta delay) {
+    int64 delay_ms) {
   // TODO(francoisk777@gmail.com): Change the following two statements once
   // SequencedWorkerPool supports non-zero delays.
-  DCHECK_EQ(delay.InMillisecondsRoundedUp(), 0)
+  DCHECK_EQ(delay_ms, 0)
       << "SequencedWorkerPoolSequencedTaskRunner does not yet support non-zero"
          " delays";
   return pool_->PostSequencedWorkerTaskWithShutdownBehavior(
       token_, from_here, task, shutdown_behavior_);
 }
 
+bool SequencedWorkerPoolSequencedTaskRunner::PostDelayedTaskAssertZeroDelay(
+    const tracked_objects::Location& from_here,
+    const Closure& task,
+    TimeDelta delay) {
+  return PostDelayedTaskAssertZeroDelay(from_here,
+                                        task,
+                                        delay.InMillisecondsRoundedUp());
+}
+
 }  // namespace
 
 // Worker ---------------------------------------------------------------------
@@ -976,6 +1033,15 @@
 bool SequencedWorkerPool::PostDelayedTask(
     const tracked_objects::Location& from_here,
     const Closure& task,
+    int64 delay_ms) {
+  // TODO(akalin): Add support for non-zero delays.
+  DCHECK_EQ(delay_ms, 0);
+  return PostWorkerTask(from_here, task);
+}
+
+bool SequencedWorkerPool::PostDelayedTask(
+    const tracked_objects::Location& from_here,
+    const Closure& task,
     TimeDelta delay) {
   // TODO(akalin): Add support for non-zero delays.
   DCHECK_EQ(delay.InMillisecondsRoundedUp(), 0);
diff --git a/base/threading/sequenced_worker_pool.h b/base/threading/sequenced_worker_pool.h
index 73c670f..740c26d 100644
--- a/base/threading/sequenced_worker_pool.h
+++ b/base/threading/sequenced_worker_pool.h
@@ -231,6 +231,9 @@
   // TaskRunner implementation.  Forwards to PostWorkerTask().
   virtual bool PostDelayedTask(const tracked_objects::Location& from_here,
                                const Closure& task,
+                               int64 delay_ms) OVERRIDE;
+  virtual bool PostDelayedTask(const tracked_objects::Location& from_here,
+                               const Closure& task,
                                TimeDelta delay) OVERRIDE;
   virtual bool RunsTasksOnCurrentThread() const OVERRIDE;
 
diff --git a/base/threading/sequenced_worker_pool_task_runner.cc b/base/threading/sequenced_worker_pool_task_runner.cc
deleted file mode 100644
index b7579a7..0000000
--- a/base/threading/sequenced_worker_pool_task_runner.cc
+++ /dev/null
@@ -1,52 +0,0 @@
-// 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.
-
-#include "base/threading/sequenced_worker_pool_task_runner.h"
-
-#include "base/callback.h"
-#include "base/location.h"
-#include "base/logging.h"
-
-namespace base {
-
-SequencedWorkerPoolTaskRunner::SequencedWorkerPoolTaskRunner(
-    const scoped_refptr<SequencedWorkerPool>& pool,
-    SequencedWorkerPool::SequenceToken token)
-    : pool_(pool),
-      token_(token) {
-}
-
-SequencedWorkerPoolTaskRunner::~SequencedWorkerPoolTaskRunner() {
-}
-
-bool SequencedWorkerPoolTaskRunner::PostDelayedTask(
-    const tracked_objects::Location& from_here,
-    const Closure& task,
-    TimeDelta delay) {
-  return PostDelayedTaskAssertZeroDelay(from_here, task, delay);
-}
-
-bool SequencedWorkerPoolTaskRunner::RunsTasksOnCurrentThread() const {
-  return pool_->IsRunningSequenceOnCurrentThread(token_);
-}
-
-bool SequencedWorkerPoolTaskRunner::PostNonNestableDelayedTask(
-    const tracked_objects::Location& from_here,
-    const Closure& task,
-    TimeDelta delay) {
-  return PostDelayedTaskAssertZeroDelay(from_here, task, delay);
-}
-
-bool SequencedWorkerPoolTaskRunner::PostDelayedTaskAssertZeroDelay(
-    const tracked_objects::Location& from_here,
-    const Closure& task,
-    TimeDelta delay) {
-  // TODO(francoisk777@gmail.com): Change the following two statements once
-  // SequencedWorkerPool supports non-zero delays.
-  DCHECK_EQ(delay.InMillisecondsRoundedUp(), 0)
-      << "SequencedWorkerPoolTaskRunner does not yet support non-zero delays";
-  return pool_->PostSequencedWorkerTask(token_, from_here, task);
-}
-
-}  // namespace base
diff --git a/base/threading/sequenced_worker_pool_task_runner.h b/base/threading/sequenced_worker_pool_task_runner.h
deleted file mode 100644
index 6827663..0000000
--- a/base/threading/sequenced_worker_pool_task_runner.h
+++ /dev/null
@@ -1,63 +0,0 @@
-// 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.
-
-#ifndef BASE_THREADING_SEQUENCED_WORKER_POOL_TASK_RUNNER_H_
-#define BASE_THREADING_SEQUENCED_WORKER_POOL_TASK_RUNNER_H_
-#pragma once
-
-#include "base/basictypes.h"
-#include "base/callback_forward.h"
-#include "base/compiler_specific.h"
-#include "base/memory/ref_counted.h"
-#include "base/sequenced_task_runner.h"
-#include "base/threading/sequenced_worker_pool.h"
-#include "base/time.h"
-
-namespace tracked_objects {
-class Location;
-}  // namespace tracked_objects
-
-namespace base {
-
-// A SequencedTaskRunner which posts tasks to a SequencedWorkerPool with a
-// fixed sequence token.
-//
-// Note that this class is RefCountedThreadSafe (inherited from TaskRunner).
-class BASE_EXPORT SequencedWorkerPoolTaskRunner : public SequencedTaskRunner {
- public:
-  SequencedWorkerPoolTaskRunner(const scoped_refptr<SequencedWorkerPool>& pool,
-                                SequencedWorkerPool::SequenceToken token);
-
-  // TaskRunner implementation
-  virtual bool PostDelayedTask(const tracked_objects::Location& from_here,
-                               const Closure& task,
-                               TimeDelta delay) OVERRIDE;
-  virtual bool RunsTasksOnCurrentThread() const OVERRIDE;
-
-  // SequencedTaskRunner implementation
-  virtual bool PostNonNestableDelayedTask(
-      const tracked_objects::Location& from_here,
-      const Closure& task,
-      TimeDelta delay) OVERRIDE;
-
- private:
-  virtual ~SequencedWorkerPoolTaskRunner();
-
-  // Helper function for posting a delayed task. Asserts that the delay is
-  // zero because non-zero delays are not yet supported.
-  bool PostDelayedTaskAssertZeroDelay(
-      const tracked_objects::Location& from_here,
-      const Closure& task,
-      TimeDelta delay);
-
-  const scoped_refptr<SequencedWorkerPool> pool_;
-
-  const SequencedWorkerPool::SequenceToken token_;
-
-  DISALLOW_COPY_AND_ASSIGN(SequencedWorkerPoolTaskRunner);
-};
-
-}  // namespace base
-
-#endif  // BASE_THREADING_SEQUENCED_TASK_RUNNER_IMPL_H_
diff --git a/base/threading/worker_pool.cc b/base/threading/worker_pool.cc
index 16cc061..978584c 100644
--- a/base/threading/worker_pool.cc
+++ b/base/threading/worker_pool.cc
@@ -41,6 +41,9 @@
   // TaskRunner implementation
   virtual bool PostDelayedTask(const tracked_objects::Location& from_here,
                                const Closure& task,
+                               int64 delay_ms) OVERRIDE;
+  virtual bool PostDelayedTask(const tracked_objects::Location& from_here,
+                               const Closure& task,
                                TimeDelta delay) OVERRIDE;
   virtual bool RunsTasksOnCurrentThread() const OVERRIDE;
 
@@ -52,7 +55,7 @@
   bool PostDelayedTaskAssertZeroDelay(
       const tracked_objects::Location& from_here,
       const Closure& task,
-      base::TimeDelta delay);
+      int64 delay_ms);
 
   const bool tasks_are_slow_;
 
@@ -69,8 +72,15 @@
 bool WorkerPoolTaskRunner::PostDelayedTask(
     const tracked_objects::Location& from_here,
     const Closure& task,
+    int64 delay_ms) {
+  return PostDelayedTaskAssertZeroDelay(from_here, task, delay_ms);
+}
+
+bool WorkerPoolTaskRunner::PostDelayedTask(
+    const tracked_objects::Location& from_here,
+    const Closure& task,
     TimeDelta delay) {
-  return PostDelayedTaskAssertZeroDelay(from_here, task, delay);
+  return PostDelayedTask(from_here, task, delay.InMillisecondsRoundedUp());
 }
 
 bool WorkerPoolTaskRunner::RunsTasksOnCurrentThread() const {
@@ -80,8 +90,8 @@
 bool WorkerPoolTaskRunner::PostDelayedTaskAssertZeroDelay(
     const tracked_objects::Location& from_here,
     const Closure& task,
-    base::TimeDelta delay) {
-  DCHECK_EQ(delay.InMillisecondsRoundedUp(), 0)
+    int64 delay_ms) {
+  DCHECK_EQ(delay_ms, 0)
       << "WorkerPoolTaskRunner does not support non-zero delays";
   return WorkerPool::PostTask(from_here, task, tasks_are_slow_);
 }