| Index: base/task_scheduler/utils.h
|
| diff --git a/base/task_scheduler/utils.h b/base/task_scheduler/utils.h
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..053ad7c258700683b4bf860c2a9191aae0bb1fff
|
| --- /dev/null
|
| +++ b/base/task_scheduler/utils.h
|
| @@ -0,0 +1,45 @@
|
| +// Copyright 2016 The Chromium Authors. All rights reserved.
|
| +// Use of this source code is governed by a BSD-style license that can be
|
| +// found in the LICENSE file.
|
| +
|
| +#ifndef BASE_TASK_SCHEDULER_UTILS_H_
|
| +#define BASE_TASK_SCHEDULER_UTILS_H_
|
| +
|
| +#include "base/base_export.h"
|
| +#include "base/memory/ref_counted.h"
|
| +#include "base/memory/scoped_ptr.h"
|
| +#include "base/task_scheduler/sequence.h"
|
| +#include "base/task_scheduler/task.h"
|
| +
|
| +namespace base {
|
| +namespace internal {
|
| +
|
| +class DelayedTaskManager;
|
| +class PriorityQueue;
|
| +class ShutdownManager;
|
| +
|
| +// Name used to annotate tasks posted to the task scheduler.
|
| +// See task_annotator.h for more details.
|
| +extern const char kQueueFunctionName[];
|
| +
|
| +// Adds |task| to |delayed_task_manager| if it has a delayed run time.
|
| +// Otherwise, calls PostTaskNowHelper().
|
| +void BASE_EXPORT PostTaskHelper(const Task& task,
|
| + scoped_refptr<Sequence> sequence,
|
| + PriorityQueue* priority_queue,
|
| + ShutdownManager* shutdown_manager,
|
| + DelayedTaskManager* delayed_task_manager);
|
| +
|
| +// Inserts |task| into |sequence|. Then, inserts |sequence| into
|
| +// |priority_queue| if it was empty before |task| was inserted into it.
|
| +// |shutdown_manager| is consulted to determine whether it is too late to post
|
| +// the task.
|
| +void BASE_EXPORT PostTaskNowHelper(const Task& task,
|
| + scoped_refptr<Sequence> sequence,
|
| + PriorityQueue* priority_queue,
|
| + ShutdownManager* shutdown_manager);
|
| +
|
| +} // namespace internal
|
| +} // namespace base
|
| +
|
| +#endif // BASE_TASK_SCHEDULER_UTILS_H_
|
|
|