chromium/components/performance_manager/test_support/resource_attribution/measurement_delegates.cc

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

#include "components/performance_manager/test_support/resource_attribution/measurement_delegates.h"

#include <map>
#include <utility>

#include "base/check_op.h"
#include "base/functional/bind.h"
#include "base/functional/callback.h"
#include "components/performance_manager/public/graph/process_node.h"
#include "content/public/common/process_type.h"

namespace resource_attribution {

Graph;
ProcessNode;

SimulatedCPUMeasurementDelegateFactory::
    SimulatedCPUMeasurementDelegateFactory() = default;

SimulatedCPUMeasurementDelegateFactory::
    ~SimulatedCPUMeasurementDelegateFactory() {}

void SimulatedCPUMeasurementDelegateFactory::SetDefaultCPUUsage(
    SimulatedCPUUsage default_cpu_usage) {}

void SimulatedCPUMeasurementDelegateFactory::SetRequireValidProcesses(
    bool require_valid) {}

SimulatedCPUMeasurementDelegate&
SimulatedCPUMeasurementDelegateFactory::GetDelegate(
    const ProcessNode* process_node) {}

bool SimulatedCPUMeasurementDelegateFactory::ShouldMeasureProcess(
    const ProcessNode* process_node) {}

std::unique_ptr<CPUMeasurementDelegate>
SimulatedCPUMeasurementDelegateFactory::CreateDelegateForProcess(
    const ProcessNode* process_node) {}

void SimulatedCPUMeasurementDelegateFactory::OnDelegateDeleted(
    base::PassKey<SimulatedCPUMeasurementDelegate>,
    SimulatedCPUMeasurementDelegate* delegate) {}

SimulatedCPUMeasurementDelegate::SimulatedCPUMeasurementDelegate(
    base::PassKey<SimulatedCPUMeasurementDelegateFactory>,
    base::SafeRef<SimulatedCPUMeasurementDelegateFactory> factory,
    SimulatedCPUUsage initial_usage)
    :{}

SimulatedCPUMeasurementDelegate::~SimulatedCPUMeasurementDelegate() {}

void SimulatedCPUMeasurementDelegate::SetCPUUsage(SimulatedCPUUsage usage,
                                                  base::TimeTicks start_time) {}

base::expected<base::TimeDelta, CPUMeasurementDelegate::ProcessCPUUsageError>
SimulatedCPUMeasurementDelegate::GetCumulativeCPUUsage() {}

FakeMemoryMeasurementDelegateFactory::FakeMemoryMeasurementDelegateFactory() =
    default;

FakeMemoryMeasurementDelegateFactory::~FakeMemoryMeasurementDelegateFactory() =
    default;

std::unique_ptr<MemoryMeasurementDelegate>
FakeMemoryMeasurementDelegateFactory::CreateDelegate(Graph*) {}

FakeMemoryMeasurementDelegate::FakeMemoryMeasurementDelegate(
    base::PassKey<FakeMemoryMeasurementDelegateFactory>,
    base::SafeRef<FakeMemoryMeasurementDelegateFactory> factory)
    :{}

FakeMemoryMeasurementDelegate::~FakeMemoryMeasurementDelegate() = default;

void FakeMemoryMeasurementDelegate::RequestMemorySummary(
    base::OnceCallback<void(MemorySummaryMap)> callback) {}

}  // namespace resource_attribution