diff options
Diffstat (limited to 'base/task_queue.cc')
-rw-r--r-- | base/task_queue.cc | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/base/task_queue.cc b/base/task_queue.cc index e3c196b..fdff8ac 100644 --- a/base/task_queue.cc +++ b/base/task_queue.cc @@ -15,6 +15,22 @@ TaskQueue::~TaskQueue() { STLDeleteElements(&queue_); } +void TaskQueue::Push(Task* task) { + DCHECK(task); + + // Add the task to the back of the queue. + queue_.push_back(task); +} + +void TaskQueue::Clear() { + // Delete all the elements in the queue and clear the dead pointers. + STLDeleteElements(&queue_); +} + +bool TaskQueue::IsEmpty() const { + return queue_.empty(); +} + void TaskQueue::Run() { // Nothing to run if our queue is empty. if (queue_.empty()) @@ -31,19 +47,3 @@ void TaskQueue::Run() { delete (*task); } } - -void TaskQueue::Push(Task* task) { - DCHECK(task); - - // Add the task to the back of the queue. - queue_.push_back(task); -} - -void TaskQueue::Clear() { - // Delete all the elements in the queue and clear the dead pointers. - STLDeleteElements(&queue_); -} - -bool TaskQueue::IsEmpty() const { - return queue_.empty(); -} |