#include "base/task/cancelable_task_tracker.h"
#include <stddef.h>
#include <utility>
#include "base/functional/bind.h"
#include "base/functional/callback_helpers.h"
#include "base/location.h"
#include "base/memory/ref_counted.h"
#include "base/metrics/histogram_macros.h"
#include "base/task/sequenced_task_runner.h"
#include "base/task/task_runner.h"
namespace base {
namespace {
void RunOrPostToTaskRunner(scoped_refptr<SequencedTaskRunner> task_runner,
OnceClosure closure) { … }
}
const CancelableTaskTracker::TaskId CancelableTaskTracker::kBadTaskId = …;
CancelableTaskTracker::CancelableTaskTracker() { … }
CancelableTaskTracker::~CancelableTaskTracker() { … }
CancelableTaskTracker::TaskId CancelableTaskTracker::PostTask(
TaskRunner* task_runner,
const Location& from_here,
OnceClosure task) { … }
CancelableTaskTracker::TaskId CancelableTaskTracker::PostTaskAndReply(
TaskRunner* task_runner,
const Location& from_here,
OnceClosure task,
OnceClosure reply) { … }
CancelableTaskTracker::TaskId CancelableTaskTracker::NewTrackedTaskId(
IsCanceledCallback* is_canceled_cb) { … }
void CancelableTaskTracker::TryCancel(TaskId id) { … }
void CancelableTaskTracker::TryCancelAll() { … }
bool CancelableTaskTracker::HasTrackedTasks() const { … }
void CancelableTaskTracker::RunIfNotCanceled(
const scoped_refptr<TaskCancellationFlag>& flag,
OnceClosure task) { … }
void CancelableTaskTracker::RunThenUntrackIfNotCanceled(
const scoped_refptr<TaskCancellationFlag>& flag,
OnceClosure task,
OnceClosure untrack) { … }
bool CancelableTaskTracker::IsCanceled(
const scoped_refptr<TaskCancellationFlag>& flag,
const ScopedClosureRunner& cleanup_runner) { … }
void CancelableTaskTracker::Track(TaskId id,
scoped_refptr<TaskCancellationFlag> flag) { … }
void CancelableTaskTracker::Untrack(TaskId id) { … }
}