chromium/components/performance_manager/resource_attribution/memory_measurement_delegate.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/public/resource_attribution/memory_measurement_delegate.h"

#include <utility>

#include "base/check.h"
#include "base/functional/bind.h"
#include "base/functional/callback.h"
#include "base/memory/raw_ptr.h"
#include "base/memory/weak_ptr.h"
#include "base/no_destructor.h"
#include "base/notreached.h"
#include "base/process/process_handle.h"
#include "components/performance_manager/graph/graph_impl.h"
#include "components/performance_manager/graph/process_node_impl.h"
#include "components/performance_manager/public/resource_attribution/process_context.h"
#include "components/performance_manager/resource_attribution/performance_manager_aliases.h"
#include "components/performance_manager/resource_attribution/query_scheduler.h"
#include "services/resource_coordinator/public/cpp/memory_instrumentation/global_memory_dump.h"
#include "services/resource_coordinator/public/cpp/memory_instrumentation/memory_instrumentation.h"

namespace resource_attribution {

namespace {

GlobalMemoryDump;

// A production MemoryMeasurementDelegate that measures processes with
// memory_instrumentation::MemoryInstrumentation.
class MemoryMeasurementDelegateImpl final : public MemoryMeasurementDelegate {};

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

void MemoryMeasurementDelegateImpl::OnMemorySummary(
    base::OnceCallback<void(MemorySummaryMap)> callback,
    bool success,
    std::unique_ptr<GlobalMemoryDump> memory_dump) {}

// The default production factory for MemoryMeasurementDelegateImpl objects.
class MemoryMeasurementDelegateFactoryImpl final
    : public MemoryMeasurementDelegate::Factory {};

}  // namespace

// static
void MemoryMeasurementDelegate::SetDelegateFactoryForTesting(Graph* graph,
                                                             Factory* factory) {}

// static
MemoryMeasurementDelegate::Factory*
MemoryMeasurementDelegate::GetDefaultFactory() {}

}  // namespace resource_attribution