| 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_PENDING_TASK_H_ | 5 #ifndef BASE_PENDING_TASK_H_ |
| 6 #define BASE_PENDING_TASK_H_ | 6 #define BASE_PENDING_TASK_H_ |
| 7 | 7 |
| 8 #include <queue> | 8 #include <queue> |
| 9 | 9 |
| 10 #include "base/base_export.h" | 10 #include "base/base_export.h" |
| (...skipping 19 matching lines...) Expand all Loading... |
| 30 | 30 |
| 31 // Used to support sorting. | 31 // Used to support sorting. |
| 32 bool operator<(const PendingTask& other) const; | 32 bool operator<(const PendingTask& other) const; |
| 33 | 33 |
| 34 // The task to run. | 34 // The task to run. |
| 35 OnceClosure task; | 35 OnceClosure task; |
| 36 | 36 |
| 37 // The site this PendingTask was posted from. | 37 // The site this PendingTask was posted from. |
| 38 tracked_objects::Location posted_from; | 38 tracked_objects::Location posted_from; |
| 39 | 39 |
| 40 // Task backtrace. |
| 41 const void* task_backtrace[4]; |
| 42 |
| 40 // Secondary sort key for run time. | 43 // Secondary sort key for run time. |
| 41 int sequence_num; | 44 int sequence_num; |
| 42 | 45 |
| 43 // OK to dispatch from a nested loop. | 46 // OK to dispatch from a nested loop. |
| 44 bool nestable; | 47 bool nestable; |
| 45 | 48 |
| 46 // Needs high resolution timers. | 49 // Needs high resolution timers. |
| 47 bool is_high_res; | 50 bool is_high_res; |
| 48 }; | 51 }; |
| 49 | 52 |
| 50 using TaskQueue = std::queue<PendingTask>; | 53 using TaskQueue = std::queue<PendingTask>; |
| 51 | 54 |
| 52 // PendingTasks are sorted by their |delayed_run_time| property. | 55 // PendingTasks are sorted by their |delayed_run_time| property. |
| 53 using DelayedTaskQueue = std::priority_queue<base::PendingTask>; | 56 using DelayedTaskQueue = std::priority_queue<base::PendingTask>; |
| 54 | 57 |
| 55 } // namespace base | 58 } // namespace base |
| 56 | 59 |
| 57 #endif // BASE_PENDING_TASK_H_ | 60 #endif // BASE_PENDING_TASK_H_ |
| OLD | NEW |