#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;
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) { … }
class MemoryMeasurementDelegateFactoryImpl final
: public MemoryMeasurementDelegate::Factory { … };
}
void MemoryMeasurementDelegate::SetDelegateFactoryForTesting(Graph* graph,
Factory* factory) { … }
MemoryMeasurementDelegate::Factory*
MemoryMeasurementDelegate::GetDefaultFactory() { … }
}