#include "services/device/compute_pressure/virtual_cpu_probe_manager.h"
#include <optional>
#include "base/functional/callback.h"
#include "base/location.h"
#include "base/memory/ptr_util.h"
#include "base/memory/weak_ptr.h"
#include "base/sequence_checker.h"
#include "base/task/sequenced_task_runner.h"
#include "components/system_cpu/cpu_probe.h"
#include "components/system_cpu/cpu_sample.h"
namespace device {
namespace {
class VirtualCpuProbe final : public system_cpu::CpuProbe { … };
VirtualCpuProbe::VirtualCpuProbe() = default;
VirtualCpuProbe::~VirtualCpuProbe() { … }
void VirtualCpuProbe::Update(SampleCallback callback) { … }
base::WeakPtr<system_cpu::CpuProbe> VirtualCpuProbe::GetWeakPtr() { … }
void VirtualCpuProbe::SetSample(system_cpu::CpuSample sample) { … }
}
std::unique_ptr<VirtualCpuProbeManager> VirtualCpuProbeManager::Create(
base::TimeDelta sampling_interval,
base::RepeatingCallback<void(mojom::PressureState)> sampling_callback) { … }
VirtualCpuProbeManager::VirtualCpuProbeManager(
base::TimeDelta sampling_interval,
base::RepeatingCallback<void(mojom::PressureState)> sampling_callback)
: … { … }
VirtualCpuProbeManager::~VirtualCpuProbeManager() = default;
void VirtualCpuProbeManager::SetPressureState(
mojom::PressureState desired_state) { … }
}