123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990 |
- #ifndef BASE_PENDING_TASK_H_
- #define BASE_PENDING_TASK_H_
- #include <array>
- #include "base/base_export.h"
- #include "base/callback.h"
- #include "base/containers/queue.h"
- #include "base/location.h"
- #include "base/optional.h"
- #include "base/time/time.h"
- namespace base {
- enum class Nestable : uint8_t {
- kNonNestable,
- kNestable,
- };
- struct BASE_EXPORT PendingTask {
- PendingTask();
- PendingTask(const Location& posted_from,
- OnceClosure task,
- TimeTicks delayed_run_time = TimeTicks(),
- Nestable nestable = Nestable::kNestable);
- PendingTask(PendingTask&& other);
- ~PendingTask();
- PendingTask& operator=(PendingTask&& other);
-
- bool operator<(const PendingTask& other) const;
-
- OnceClosure task;
-
- Location posted_from;
-
- base::TimeTicks delayed_run_time;
-
-
-
-
-
-
- TimeTicks queue_time;
-
- static constexpr size_t kTaskBacktraceLength = 4;
- std::array<const void*, kTaskBacktraceLength> task_backtrace = {};
-
-
-
-
-
-
-
- uint32_t ipc_hash = 0;
- const char* ipc_interface_name = nullptr;
-
- int sequence_num = 0;
- bool task_backtrace_overflow = false;
-
- Nestable nestable;
-
- bool is_high_res = false;
- };
- using TaskQueue = base::queue<PendingTask>;
- using DelayedTaskQueue = std::priority_queue<base::PendingTask>;
- }
- #endif
|