| Index: chrome/browser/policy/logging_work_scheduler.cc
|
| diff --git a/chrome/browser/policy/logging_work_scheduler.cc b/chrome/browser/policy/logging_work_scheduler.cc
|
| index a5181bb7da52ed60be14942ce920cf84c8305a0b..f83c4c94f70d5d0b6c492119c7dac446bbc4dfa8 100644
|
| --- a/chrome/browser/policy/logging_work_scheduler.cc
|
| +++ b/chrome/browser/policy/logging_work_scheduler.cc
|
| @@ -11,6 +11,39 @@
|
|
|
| namespace policy {
|
|
|
| +// Objects of this class are used in the priority-queue of future tasks
|
| +// in EventLogger.
|
| +class EventLogger::Task {
|
| + public:
|
| + Task();
|
| + Task(int64 trigger_time,
|
| + int64 secondary_key,
|
| + linked_ptr<base::Closure> callback);
|
| + ~Task();
|
| +
|
| + // Returns true if |this| should be executed before |rhs|.
|
| + // Used for sorting by the priority queue.
|
| + bool operator< (const Task& rhs) const;
|
| +
|
| + int64 trigger_time() const;
|
| +
|
| + // Returns a copy of the callback object of this task, and resets the
|
| + // original callback object. (LoggingTaskScheduler owns a linked_ptr to
|
| + // its task's callback objects and it only allows firing new tasks if the
|
| + // previous task's callback object has been reset.)
|
| + base::Closure GetAndResetCallback();
|
| +
|
| + private:
|
| + // The virtual time when this task will trigger.
|
| + // Smaller times win.
|
| + int64 trigger_time_;
|
| + // Used for sorting tasks that have the same trigger_time.
|
| + // Bigger keys win.
|
| + int64 secondary_key_;
|
| +
|
| + linked_ptr<base::Closure> callback_;
|
| +};
|
| +
|
| EventLogger::Task::Task() {
|
| }
|
|
|
|
|