chromium/base/message_loop/message_pump_epoll.cc

// Copyright 2022 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/message_loop/message_pump_epoll.h"

#include <sys/eventfd.h>

#include <cstddef>
#include <cstdint>
#include <optional>
#include <utility>

#include "base/auto_reset.h"
#include "base/check_op.h"
#include "base/feature_list.h"
#include "base/memory/raw_ptr.h"
#include "base/memory/ref_counted.h"
#include "base/metrics/histogram_macros.h"
#include "base/numerics/safe_conversions.h"
#include "base/posix/eintr_wrapper.h"
#include "base/ranges/algorithm.h"
#include "base/threading/thread_checker.h"
#include "base/time/time.h"
#include "base/trace_event/base_tracing.h"

namespace base {

namespace {

// Under this feature native work is batched.
BASE_FEATURE();

// Caches the state of the "BatchNativeEventsInMessagePumpEpoll".
std::atomic_bool g_use_batched_version =;
std::atomic_bool g_use_poll =;

constexpr std::pair<uint32_t, short int> kEpollToPollEvents[] =;

void SetEventsForPoll(const uint32_t epoll_events, struct pollfd* poll_entry) {}
}  // namespace

// Parameters used to construct and describe an interest.
struct MessagePumpEpoll::InterestParams {};

// Represents a single controller's interest in a file descriptor via epoll,
// and tracks whether that interest is currently active. Though an interest
// persists as long as its controller is alive and hasn't changed interests,
// it only participates in epoll waits while active.
class MessagePumpEpoll::Interest : public RefCounted<Interest> {};

MessagePumpEpoll::MessagePumpEpoll() {}

MessagePumpEpoll::~MessagePumpEpoll() = default;

void MessagePumpEpoll::InitializeFeatures() {}

bool MessagePumpEpoll::WatchFileDescriptor(int fd,
                                           bool persistent,
                                           int mode,
                                           FdWatchController* controller,
                                           FdWatcher* watcher) {}

void MessagePumpEpoll::Run(Delegate* delegate) {}

void MessagePumpEpoll::RecordPeriodicMetrics() {}

void MessagePumpEpoll::Quit() {}

void MessagePumpEpoll::ScheduleWork() {}

void MessagePumpEpoll::ScheduleDelayedWork(
    const Delegate::NextWorkInfo& next_work_info) {}

void MessagePumpEpoll::AddEpollEvent(EpollEventEntry& entry) {}

void MessagePumpEpoll::UpdateEpollEvent(EpollEventEntry& entry) {}

void MessagePumpEpoll::StopEpollEvent(EpollEventEntry& entry) {}

void MessagePumpEpoll::UnregisterInterest(
    const scoped_refptr<Interest>& interest) {}

bool MessagePumpEpoll::WaitForEpollEvents(TimeDelta timeout) {}

std::vector<struct pollfd>::iterator MessagePumpEpoll::FindPollEntry(int fd) {}

void MessagePumpEpoll::RemovePollEntry(int fd) {}

bool MessagePumpEpoll::GetEventsPoll(int epoll_timeout,
                                     std::vector<epoll_event>* epoll_events) {}

void MessagePumpEpoll::OnEpollEvent(EpollEventEntry& entry, uint32_t events) {}

void MessagePumpEpoll::HandleEvent(int fd,
                                   bool can_read,
                                   bool can_write,
                                   FdWatchController* controller) {}

void MessagePumpEpoll::HandleWakeUp() {}

void MessagePumpEpoll::BeginNativeWorkBatch() {}

MessagePumpEpoll::EpollEventEntry::EpollEventEntry(int fd) :{}

MessagePumpEpoll::EpollEventEntry::~EpollEventEntry() {}

uint32_t MessagePumpEpoll::EpollEventEntry::ComputeActiveEvents() const {}

MessagePumpEpoll::FdWatchController::FdWatchController(
    const Location& from_here)
    :{}

MessagePumpEpoll::FdWatchController::~FdWatchController() {}

bool MessagePumpEpoll::FdWatchController::StopWatchingFileDescriptor() {}

const scoped_refptr<MessagePumpEpoll::Interest>&
MessagePumpEpoll::FdWatchController::AssignInterest(
    const InterestParams& params) {}

void MessagePumpEpoll::FdWatchController::ClearInterest() {}

void MessagePumpEpoll::FdWatchController::OnFdReadable() {}

void MessagePumpEpoll::FdWatchController::OnFdWritable() {}

}  // namespace base