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

Unified Diff: base/task_queue.cc

Issue 8570022: base::Bind() conversion for chrome/browser/search_engines (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 9 years, 1 month 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
« no previous file with comments | « base/task_queue.h ('k') | base/task_queue_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/task_queue.cc
diff --git a/base/task_queue.cc b/base/task_queue.cc
deleted file mode 100644
index 78ab159a4a7269b491b033a30dfecb76a97927fc..0000000000000000000000000000000000000000
--- a/base/task_queue.cc
+++ /dev/null
@@ -1,49 +0,0 @@
-// Copyright (c) 2010 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/task_queue.h"
-
-#include "base/logging.h"
-#include "base/stl_util.h"
-
-TaskQueue::TaskQueue() {
-}
-
-TaskQueue::~TaskQueue() {
- // We own all the pointes in |queue_|. It is our job to delete them.
- 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())
- return;
-
- std::deque<Task*> ready;
- queue_.swap(ready);
-
- // Run the tasks that are ready.
- std::deque<Task*>::const_iterator task;
- for (task = ready.begin(); task != ready.end(); ++task) {
- // Run the task and then delete it.
- (*task)->Run();
- delete (*task);
- }
-}
« no previous file with comments | « base/task_queue.h ('k') | base/task_queue_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698