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

Side by Side Diff: base/task_queue.cc

Issue 6410105: run iwyu on base! Base URL: svn://svn.chromium.org/chrome/trunk/src/base
Patch Set: Created 9 years, 10 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
« no previous file with comments | « base/sys_info_posix.cc ('k') | base/third_party/dmg_fp/dtoa_wrapper.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 <stdbool.h>
6 #include <deque>
6 7
7 #include "base/logging.h" 8 #include "base/logging.h"
8 #include "base/stl_util-inl.h" 9 #include "base/stl_util-inl.h"
10 #include "base/task.h"
11 #include "base/task_queue.h"
9 12
10 TaskQueue::TaskQueue() { 13 TaskQueue::TaskQueue() {
11 } 14 }
12 15
13 TaskQueue::~TaskQueue() { 16 TaskQueue::~TaskQueue() {
14 // We own all the pointes in |queue_|. It is our job to delete them. 17 // We own all the pointes in |queue_|. It is our job to delete them.
15 STLDeleteElements(&queue_); 18 STLDeleteElements(&queue_);
16 } 19 }
17 20
18 void TaskQueue::Push(Task* task) { 21 void TaskQueue::Push(Task* task) {
(...skipping 21 matching lines...) Expand all
40 queue_.swap(ready); 43 queue_.swap(ready);
41 44
42 // Run the tasks that are ready. 45 // Run the tasks that are ready.
43 std::deque<Task*>::const_iterator task; 46 std::deque<Task*>::const_iterator task;
44 for (task = ready.begin(); task != ready.end(); ++task) { 47 for (task = ready.begin(); task != ready.end(); ++task) {
45 // Run the task and then delete it. 48 // Run the task and then delete it.
46 (*task)->Run(); 49 (*task)->Run();
47 delete (*task); 50 delete (*task);
48 } 51 }
49 } 52 }
OLDNEW
« no previous file with comments | « base/sys_info_posix.cc ('k') | base/third_party/dmg_fp/dtoa_wrapper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698