#include "content/renderer/worker/worker_thread_registry.h"
#include <atomic>
#include <utility>
#include "base/check.h"
#include "base/containers/contains.h"
#include "base/location.h"
#include "base/memory/ptr_util.h"
#include "base/no_destructor.h"
#include "base/observer_list.h"
#include "base/task/sequenced_task_runner.h"
#include "base/task/single_thread_task_runner.h"
#include "content/public/renderer/worker_thread.h"
namespace content {
namespace {
WorkerThreadObservers;
struct WorkerThreadData { … };
ABSL_CONST_INIT thread_local WorkerThreadData* worker_data = …;
class DoNothingTaskRunner : public base::SequencedTaskRunner { … };
}
int WorkerThread::GetCurrentId() { … }
void WorkerThread::PostTask(int id, base::OnceClosure task) { … }
void WorkerThread::AddObserver(Observer* observer) { … }
void WorkerThread::RemoveObserver(Observer* observer) { … }
WorkerThreadRegistry::WorkerThreadRegistry()
: … { … }
int WorkerThreadRegistry::PostTaskToAllThreads(
const base::RepeatingClosure& closure) { … }
WorkerThreadRegistry* WorkerThreadRegistry::Instance() { … }
WorkerThreadRegistry::~WorkerThreadRegistry() = default;
void WorkerThreadRegistry::DidStartCurrentWorkerThread() { … }
void WorkerThreadRegistry::WillStopCurrentWorkerThread() { … }
base::SequencedTaskRunner* WorkerThreadRegistry::GetTaskRunnerFor(
int worker_id) { … }
bool WorkerThreadRegistry::PostTask(int id, base::OnceClosure closure) { … }
}