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

Side by Side Diff: base/task_queue.cc

Issue 7342047: Cleanup base/stl_util (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: removed unneeded include + rebase Created 9 years, 5 months 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "base/task_queue.h" 5 #include "base/task_queue.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/stl_util-inl.h" 8 #include "base/stl_util.h"
9 9
10 TaskQueue::TaskQueue() { 10 TaskQueue::TaskQueue() {
11 } 11 }
12 12
13 TaskQueue::~TaskQueue() { 13 TaskQueue::~TaskQueue() {
14 // We own all the pointes in |queue_|. It is our job to delete them. 14 // We own all the pointes in |queue_|. It is our job to delete them.
15 STLDeleteElements(&queue_); 15 STLDeleteElements(&queue_);
16 } 16 }
17 17
18 void TaskQueue::Push(Task* task) { 18 void TaskQueue::Push(Task* task) {
(...skipping 21 matching lines...) Expand all
40 queue_.swap(ready); 40 queue_.swap(ready);
41 41
42 // Run the tasks that are ready. 42 // Run the tasks that are ready.
43 std::deque<Task*>::const_iterator task; 43 std::deque<Task*>::const_iterator task;
44 for (task = ready.begin(); task != ready.end(); ++task) { 44 for (task = ready.begin(); task != ready.end(); ++task) {
45 // Run the task and then delete it. 45 // Run the task and then delete it.
46 (*task)->Run(); 46 (*task)->Run();
47 delete (*task); 47 delete (*task);
48 } 48 }
49 } 49 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698