Commit 34963da9 authored by Alexandre Frechette's avatar Alexandre Frechette Committed by Commit Bot

Added DISALLOW_COPY_AND_ASSIGN to DelayedTask, and improved documentation.

Follow-up to https://chromium-review.googlesource.com/c/chromium/src/+/1230694.

Change-Id: I5043132eb238ce968d451df28f5939d0de9129e3
Reviewed-on: https://chromium-review.googlesource.com/1240974
Commit-Queue: Alexandre Frechette <frechette@chromium.org>
Reviewed-by: default avatarGabriel Charette <gab@chromium.org>
Cr-Commit-Position: refs/heads/master@{#593680}
parent 3bfc1485
...@@ -56,10 +56,10 @@ class BASE_EXPORT DelayedTaskManager { ...@@ -56,10 +56,10 @@ class BASE_EXPORT DelayedTaskManager {
DelayedTask(DelayedTask&& other); DelayedTask(DelayedTask&& other);
~DelayedTask(); ~DelayedTask();
// Required by priority_queue::pop(). // Required by std::priority_queue::pop().
DelayedTask& operator=(DelayedTask&& other); DelayedTask& operator=(DelayedTask&& other);
// Required by priority_queue. // Required by std::priority_queue.
bool operator>(const DelayedTask& other) const; bool operator>(const DelayedTask& other) const;
Task task; Task task;
...@@ -74,12 +74,15 @@ class BASE_EXPORT DelayedTaskManager { ...@@ -74,12 +74,15 @@ class BASE_EXPORT DelayedTaskManager {
private: private:
bool scheduled_ = false; bool scheduled_ = false;
DISALLOW_COPY_AND_ASSIGN(DelayedTask);
}; };
// Pop and post all the ripe tasks in the delayed task queue. // Pop and post all the ripe tasks in the delayed task queue.
void ProcessRipeTasks(); void ProcessRipeTasks();
// Get the time at which to schedule the next |ProcessRipeTasks()| execution. // Get the time at which to schedule the next |ProcessRipeTasks()| execution,
// or TimeTicks::Max() if none needs to be scheduled (i.e. no task, or next
// task already scheduled).
TimeTicks GetTimeToScheduleProcessRipeTasksLockRequired(); TimeTicks GetTimeToScheduleProcessRipeTasksLockRequired();
// Schedule |ProcessRipeTasks()| on the service thread to be executed at the // Schedule |ProcessRipeTasks()| on the service thread to be executed at the
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment