| Index: third_party/WebKit/Source/platform/scheduler/base/task_queue_manager.h
|
| diff --git a/third_party/WebKit/Source/platform/scheduler/base/task_queue_manager.h b/third_party/WebKit/Source/platform/scheduler/base/task_queue_manager.h
|
| index eebf5f097dacba2b6c3c458e759869dda2e49c02..21c4aedc800ec0af9b8e848cf3d56a5873467575 100644
|
| --- a/third_party/WebKit/Source/platform/scheduler/base/task_queue_manager.h
|
| +++ b/third_party/WebKit/Source/platform/scheduler/base/task_queue_manager.h
|
| @@ -74,14 +74,8 @@
|
| // runner. These delayed tasks are de-duplicated. Must be called on the thread
|
| // this class was created on.
|
| void MaybeScheduleDelayedWork(const tracked_objects::Location& from_here,
|
| - TimeDomain* requesting_time_domain,
|
| - LazyNow* lazy_now,
|
| - base::TimeTicks run_time);
|
| -
|
| - // Cancels a delayed task to process work at |run_time|, previously requested
|
| - // with MaybeScheduleDelayedWork.
|
| - void CancelDelayedWork(TimeDomain* requesting_time_domain,
|
| - base::TimeTicks run_time);
|
| + base::TimeTicks now,
|
| + base::TimeDelta delay);
|
|
|
| // Set the number of tasks executed in a single invocation of the task queue
|
| // manager. Increasing the batch size can reduce the overhead of yielding
|
| @@ -155,59 +149,10 @@
|
| // need them, you can turn them off.
|
| void SetRecordTaskDelayHistograms(bool record_task_delay_histograms);
|
|
|
| - protected:
|
| + private:
|
| friend class LazyNow;
|
| friend class internal::TaskQueueImpl;
|
| friend class TaskQueueManagerTest;
|
| -
|
| - // Intermediate data structure, used to compute NextDelayedDoWork.
|
| - class NextTaskDelay {
|
| - public:
|
| - NextTaskDelay() : time_domain_(nullptr) {}
|
| -
|
| - NextTaskDelay(base::TimeDelta delay, TimeDomain* time_domain)
|
| - : delay_(delay), time_domain_(time_domain) {
|
| - DCHECK_GT(delay, base::TimeDelta());
|
| - DCHECK(time_domain);
|
| - }
|
| -
|
| - base::TimeDelta delay() const { return delay_; }
|
| - TimeDomain* time_domain() const { return time_domain_; }
|
| -
|
| - bool operator<(const NextTaskDelay& other) const {
|
| - return delay_ < other.delay_;
|
| - }
|
| -
|
| - private:
|
| - base::TimeDelta delay_;
|
| - TimeDomain* time_domain_;
|
| - };
|
| -
|
| - private:
|
| - // Represents a scheduled delayed DoWork (if any). Only public for testing.
|
| - class NextDelayedDoWork {
|
| - public:
|
| - NextDelayedDoWork() : time_domain_(nullptr) {}
|
| - NextDelayedDoWork(base::TimeTicks run_time, TimeDomain* time_domain)
|
| - : run_time_(run_time), time_domain_(time_domain) {
|
| - DCHECK_NE(run_time, base::TimeTicks());
|
| - DCHECK(time_domain);
|
| - }
|
| -
|
| - base::TimeTicks run_time() const { return run_time_; }
|
| - TimeDomain* time_domain() const { return time_domain_; }
|
| -
|
| - void Clear() {
|
| - run_time_ = base::TimeTicks();
|
| - time_domain_ = nullptr;
|
| - }
|
| -
|
| - explicit operator bool() const { return !run_time_.is_null(); }
|
| -
|
| - private:
|
| - base::TimeTicks run_time_;
|
| - TimeDomain* time_domain_;
|
| - };
|
|
|
| class DeletionSentinel : public base::RefCounted<DeletionSentinel> {
|
| private:
|
| @@ -233,7 +178,7 @@
|
| void DoWork(bool delayed);
|
|
|
| // Post a DoWork continuation if |next_delay| is not empty.
|
| - void PostDoWorkContinuationLocked(base::Optional<NextTaskDelay> next_delay,
|
| + void PostDoWorkContinuationLocked(base::Optional<base::TimeDelta> next_delay,
|
| LazyNow* lazy_now,
|
| MoveableAutoLock&& lock);
|
|
|
| @@ -271,7 +216,7 @@
|
|
|
| // Calls DelayTillNextTask on all time domains and returns the smallest delay
|
| // requested if any.
|
| - base::Optional<NextTaskDelay> ComputeDelayTillNextTaskLocked(
|
| + base::Optional<base::TimeDelta> ComputeDelayTillNextTaskLocked(
|
| LazyNow* lazy_now);
|
|
|
| void MaybeRecordTaskDelayHistograms(
|
| @@ -348,7 +293,7 @@
|
| return any_thread_;
|
| }
|
|
|
| - NextDelayedDoWork next_delayed_do_work_;
|
| + base::TimeTicks next_scheduled_delayed_do_work_time_;
|
|
|
| bool record_task_delay_histograms_;
|
|
|
|
|