#include "components/unexportable_keys/background_long_task_scheduler.h"
#include <string_view>
#include "base/check_op.h"
#include "base/containers/circular_deque.h"
#include "base/memory/scoped_refptr.h"
#include "base/memory/weak_ptr.h"
#include "base/metrics/histogram_functions.h"
#include "base/no_destructor.h"
#include "base/notreached.h"
#include "base/strings/strcat.h"
#include "base/task/sequenced_task_runner.h"
#include "base/time/time.h"
#include "base/trace_event/typed_macros.h"
#include "components/unexportable_keys/background_task.h"
#include "components/unexportable_keys/background_task_priority.h"
#include "components/unexportable_keys/background_task_type.h"
namespace unexportable_keys {
namespace {
void RecordDurationHistogramWithAndWithoutSuffix(
const char* base_histogram_name,
std::string_view suffix,
base::TimeDelta duration) { … }
}
BackgroundLongTaskScheduler::BackgroundLongTaskScheduler(
scoped_refptr<base::SequencedTaskRunner> background_task_runner)
: … { … }
BackgroundLongTaskScheduler::~BackgroundLongTaskScheduler() = default;
void BackgroundLongTaskScheduler::PostTask(
std::unique_ptr<BackgroundTask> task) { … }
void BackgroundLongTaskScheduler::OnTaskCompleted(BackgroundTask* task) { … }
void BackgroundLongTaskScheduler::MaybeRunNextPendingTask() { … }
BackgroundLongTaskScheduler::TaskQueue&
BackgroundLongTaskScheduler::GetTaskQueueForPriority(
BackgroundTaskPriority priority) { … }
BackgroundLongTaskScheduler::TaskQueue*
BackgroundLongTaskScheduler::GetHighestPriorityNonEmptyTaskQueue() { … }
std::unique_ptr<BackgroundTask>
BackgroundLongTaskScheduler::TakeNextPendingTask() { … }
}