chromium/base/task/thread_pool/job_task_source.cc

// Copyright 2019 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "base/task/thread_pool/job_task_source.h"

#include <bit>
#include <type_traits>
#include <utility>

#include "base/check_op.h"
#include "base/functional/bind.h"
#include "base/functional/callback_helpers.h"
#include "base/memory/ptr_util.h"
#include "base/notreached.h"
#include "base/task/common/checked_lock.h"
#include "base/task/task_features.h"
#include "base/task/thread_pool/pooled_task_runner_delegate.h"
#include "base/threading/thread_restrictions.h"
#include "base/time/time.h"
#include "base/time/time_override.h"
#include "base/trace_event/base_tracing.h"

namespace base {
namespace internal {

namespace {

// Capped to allow assigning task_ids from a bitfield.
constexpr size_t kMaxWorkersPerJob =;
static_assert;

}  // namespace

JobTaskSource::State::State() = default;
JobTaskSource::State::~State() = default;

JobTaskSource::State::Value JobTaskSource::State::Cancel() {}

JobTaskSource::State::Value JobTaskSource::State::DecrementWorkerCount() {}

JobTaskSource::State::Value JobTaskSource::State::IncrementWorkerCount() {}

JobTaskSource::State::Value JobTaskSource::State::Load() const {}

JobTaskSource::JoinFlag::JoinFlag() = default;
JobTaskSource::JoinFlag::~JoinFlag() = default;

void JobTaskSource::JoinFlag::Reset() {}

void JobTaskSource::JoinFlag::SetWaiting() {}

bool JobTaskSource::JoinFlag::ShouldWorkerYield() {}

bool JobTaskSource::JoinFlag::ShouldWorkerSignal() {}

JobTaskSource::JobTaskSource(const Location& from_here,
                             const TaskTraits& traits,
                             RepeatingCallback<void(JobDelegate*)> worker_task,
                             MaxConcurrencyCallback max_concurrency_callback,
                             PooledTaskRunnerDelegate* delegate)
    :{}

JobTaskSource::~JobTaskSource() {}

ExecutionEnvironment JobTaskSource::GetExecutionEnvironment() {}

void JobTaskSource::WillEnqueue(int sequence_num, TaskAnnotator& annotator) {}

bool JobTaskSource::WillJoin() {}

bool JobTaskSource::RunJoinTask() {}

void JobTaskSource::Cancel(TaskSource::Transaction* transaction) {}

// EXCLUSIVE_LOCK_REQUIRED(worker_lock_)
bool JobTaskSource::WaitForParticipationOpportunity() {}

TaskSource::RunStatus JobTaskSource::WillRunTask() {}

size_t JobTaskSource::GetRemainingConcurrency() const {}

bool JobTaskSource::IsActive() const {}

size_t JobTaskSource::GetWorkerCount() const {}

void JobTaskSource::NotifyConcurrencyIncrease() {}

size_t JobTaskSource::GetMaxConcurrency() const {}

size_t JobTaskSource::GetMaxConcurrency(size_t worker_count) const {}

uint8_t JobTaskSource::AcquireTaskId() {}

void JobTaskSource::ReleaseTaskId(uint8_t task_id) {}

bool JobTaskSource::ShouldYield() {}

Task JobTaskSource::TakeTask(TaskSource::Transaction* transaction) {}

bool JobTaskSource::DidProcessTask(TaskSource::Transaction* /*transaction*/) {}

// This is a no-op and should always return true.
bool JobTaskSource::WillReEnqueue(TimeTicks now,
                                  TaskSource::Transaction* /*transaction*/) {}

// This is a no-op.
bool JobTaskSource::OnBecomeReady() {}

TaskSourceSortKey JobTaskSource::GetSortKey() const {}

// This function isn't expected to be called since a job is never delayed.
// However, the class still needs to provide an override.
TimeTicks JobTaskSource::GetDelayedSortKey() const {}

// This function isn't expected to be called since a job is never delayed.
// However, the class still needs to provide an override.
bool JobTaskSource::HasReadyTasks(TimeTicks now) const {}

std::optional<Task> JobTaskSource::Clear(TaskSource::Transaction* transaction) {}

}  // namespace internal
}  // namespace base