OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #ifndef BASE_TASK_QUEUE_H_ | 5 #ifndef BASE_TASK_QUEUE_H_ |
6 #define BASE_TASK_QUEUE_H_ | 6 #define BASE_TASK_QUEUE_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <deque> | 9 #include <deque> |
10 | 10 |
(...skipping 16 matching lines...) Expand all Loading... |
27 void Push(Task* task); | 27 void Push(Task* task); |
28 | 28 |
29 // Remove all tasks from the queue. The tasks are deleted. | 29 // Remove all tasks from the queue. The tasks are deleted. |
30 void Clear(); | 30 void Clear(); |
31 | 31 |
32 // Returns true if this queue contains no tasks. | 32 // Returns true if this queue contains no tasks. |
33 bool IsEmpty() const; | 33 bool IsEmpty() const; |
34 | 34 |
35 // Run all the tasks in the queue. New tasks pushed onto the queue during | 35 // Run all the tasks in the queue. New tasks pushed onto the queue during |
36 // a run will be run next time |Run| is called. | 36 // a run will be run next time |Run| is called. |
37 virtual void Run(); | 37 virtual void Run() OVERRIDE; |
38 | 38 |
39 private: | 39 private: |
40 // The list of tasks we are waiting to run. | 40 // The list of tasks we are waiting to run. |
41 std::deque<Task*> queue_; | 41 std::deque<Task*> queue_; |
42 }; | 42 }; |
43 | 43 |
44 #endif // BASE_TASK_QUEUE_H_ | 44 #endif // BASE_TASK_QUEUE_H_ |
OLD | NEW |