| 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 PENDING_TASK_H_ | 5 #ifndef PENDING_TASK_H_ |
| 6 #define PENDING_TASK_H_ | 6 #define 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" |
| 11 #include "base/callback.h" | 11 #include "base/callback.h" |
| 12 #include "base/location.h" | 12 #include "base/location.h" |
| 13 #include "base/time.h" | 13 #include "base/time.h" |
| 14 #include "base/tracking_info.h" | 14 #include "base/tracking_info.h" |
| 15 | 15 |
| 16 namespace base { | 16 namespace base { |
| 17 | 17 |
| 18 // Contains data about a pending task. Stored in TaskQueue and DelayedTaskQueue | 18 // Contains data about a pending task. Stored in TaskQueue and DelayedTaskQueue |
| 19 // for use by classes that queue and execute tasks. | 19 // for use by classes that queue and execute tasks. |
| 20 struct BASE_EXPORT PendingTask : public TrackingInfo { | 20 struct BASE_EXPORT PendingTask : public TrackingInfo { |
| 21 #if _MSC_VER >= 1700 |
| 21 PendingTask(); | 22 PendingTask(); |
| 23 #endif |
| 22 PendingTask(const tracked_objects::Location& posted_from, | 24 PendingTask(const tracked_objects::Location& posted_from, |
| 23 const Closure& task); | 25 const Closure& task); |
| 24 PendingTask(const tracked_objects::Location& posted_from, | 26 PendingTask(const tracked_objects::Location& posted_from, |
| 25 const Closure& task, | 27 const Closure& task, |
| 26 TimeTicks delayed_run_time, | 28 TimeTicks delayed_run_time, |
| 27 bool nestable); | 29 bool nestable); |
| 28 ~PendingTask(); | 30 ~PendingTask(); |
| 29 | 31 |
| 30 // Used to support sorting. | 32 // Used to support sorting. |
| 31 bool operator<(const PendingTask& other) const; | 33 bool operator<(const PendingTask& other) const; |
| (...skipping 17 matching lines...) Expand all Loading... |
| 49 public: | 51 public: |
| 50 void Swap(TaskQueue* queue); | 52 void Swap(TaskQueue* queue); |
| 51 }; | 53 }; |
| 52 | 54 |
| 53 // PendingTasks are sorted by their |delayed_run_time| property. | 55 // PendingTasks are sorted by their |delayed_run_time| property. |
| 54 typedef std::priority_queue<base::PendingTask> DelayedTaskQueue; | 56 typedef std::priority_queue<base::PendingTask> DelayedTaskQueue; |
| 55 | 57 |
| 56 } // namespace base | 58 } // namespace base |
| 57 | 59 |
| 58 #endif // PENDING_TASK_H_ | 60 #endif // PENDING_TASK_H_ |
| OLD | NEW |