chromium/content/browser/scheduler/browser_task_queues.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 "content/browser/scheduler/browser_task_queues.h"

#include <array>
#include <cstdint>
#include <iterator>

#include "base/check.h"
#include "base/feature_list.h"
#include "base/functional/bind.h"
#include "base/functional/callback_helpers.h"
#include "base/memory/scoped_refptr.h"
#include "base/task/sequence_manager/sequence_manager.h"
#include "base/task/sequenced_task_runner.h"
#include "base/task/single_thread_task_runner.h"
#include "content/browser/scheduler/browser_task_priority.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/common/content_features.h"

namespace content {
namespace {

// (crbug/1375174): Make kServiceWorkerStorageControlResponse queue use high
// priority.
BASE_FEATURE();

BrowserTaskPriority;
QueueName;
InsertFencePosition;
QueueEnabledVoter;

QueueName GetControlTaskQueueName(BrowserThread::ID thread_id) {}

QueueName GetRunAllPendingTaskQueueName(BrowserThread::ID thread_id) {}

QueueName GetUITaskQueueName(BrowserTaskQueues::QueueType queue_type) {}

QueueName GetIOTaskQueueName(BrowserTaskQueues::QueueType queue_type) {}

QueueName GetTaskQueueName(BrowserThread::ID thread_id,
                           BrowserTaskQueues::QueueType queue_type) {}

}  // namespace

BrowserTaskQueues::QueueData::QueueData() = default;
BrowserTaskQueues::QueueData::~QueueData() = default;
BrowserTaskQueues::QueueData::QueueData(BrowserTaskQueues::QueueData&& other) =
    default;

BrowserTaskQueues::Handle::~Handle() = default;

BrowserTaskQueues::Handle::Handle(BrowserTaskQueues* outer)
    :{}

void BrowserTaskQueues::Handle::OnStartupComplete() {}

void BrowserTaskQueues::Handle::EnableAllExceptBestEffortQueues() {}

void BrowserTaskQueues::Handle::ScheduleRunAllPendingTasksForTesting(
    base::OnceClosure on_pending_task_ran) {}

BrowserTaskQueues::BrowserTaskQueues(
    BrowserThread::ID thread_id,
    base::sequence_manager::SequenceManager* sequence_manager) {}

BrowserTaskQueues::~BrowserTaskQueues() {}

std::array<scoped_refptr<base::SingleThreadTaskRunner>,
           BrowserTaskQueues::kNumQueueTypes>
BrowserTaskQueues::CreateBrowserTaskRunners() const {}

std::array<std::unique_ptr<QueueEnabledVoter>,
           BrowserTaskQueues::kNumQueueTypes>
BrowserTaskQueues::CreateQueueEnabledVoters() const {}

void BrowserTaskQueues::OnStartupComplete() {}

void BrowserTaskQueues::EnableAllExceptBestEffortQueues() {}

// To run all pending tasks we do the following. We insert a fence in all queues
// and post a task to the |run_all_pending_queue_| which has the lowest priority
// possible. That makes sure that all tasks up to the fences will have run
// before this posted task runs. Note that among tasks with the same priority
// ties are broken by using the enqueue order, so all prior best effort tasks
// will have run before this one does. This task will then remove all the fences
// and call the user provided callback to signal that all pending tasks have
// run. This method is "reentrant" as in we can call it multiple times as the
// fences will just be moved back, but we need to make sure that only the last
// call removes the fences, for that we keep track of "nesting" with
// |run_all_pending_nesting_level_|
void BrowserTaskQueues::StartRunAllPendingTasksForTesting(
    base::ScopedClosureRunner on_pending_task_ran) {}

void BrowserTaskQueues::EndRunAllPendingTasksForTesting(
    base::ScopedClosureRunner on_pending_task_ran) {}

}  // namespace content