#include "components/performance_manager/resource_attribution/memory_measurement_provider.h"
#include <utility>
#include "base/check.h"
#include "base/containers/contains.h"
#include "base/functional/bind.h"
#include "base/functional/callback.h"
#include "base/strings/string_number_conversions.h"
#include "base/time/time.h"
#include "components/performance_manager/public/features.h"
#include "components/performance_manager/public/graph/frame_node.h"
#include "components/performance_manager/public/graph/graph.h"
#include "components/performance_manager/public/graph/page_node.h"
#include "components/performance_manager/public/graph/process_node.h"
#include "components/performance_manager/public/graph/worker_node.h"
#include "components/performance_manager/public/resource_attribution/attribution_helpers.h"
#include "components/performance_manager/resource_attribution/node_data_describers.h"
#include "components/performance_manager/resource_attribution/performance_manager_aliases.h"
#include "components/performance_manager/resource_attribution/worker_client_pages.h"
#include "content/public/browser/browsing_instance_id.h"
#include "url/gurl.h"
#include "url/origin.h"
namespace resource_attribution {
namespace {
kResourceAttributionIncludeOrigins;
template <typename FrameOrWorkerNode>
std::optional<OriginInBrowsingInstanceContext>
OriginInBrowsingInstanceContextForNode(
const FrameOrWorkerNode* node,
content::BrowsingInstanceId browsing_instance) { … }
}
MemoryMeasurementProvider::MemoryMeasurementProvider(Graph* graph)
: … { … }
MemoryMeasurementProvider::~MemoryMeasurementProvider() = default;
void MemoryMeasurementProvider::SetDelegateFactoryForTesting(
MemoryMeasurementDelegate::Factory* factory) { … }
void MemoryMeasurementProvider::RequestMemorySummary(ResultCallback callback) { … }
base::Value::Dict MemoryMeasurementProvider::DescribeFrameNodeData(
const FrameNode* node) const { … }
base::Value::Dict MemoryMeasurementProvider::DescribePageNodeData(
const PageNode* node) const { … }
base::Value::Dict MemoryMeasurementProvider::DescribeProcessNodeData(
const ProcessNode* node) const { … }
base::Value::Dict MemoryMeasurementProvider::DescribeWorkerNodeData(
const WorkerNode* node) const { … }
void MemoryMeasurementProvider::OnMemorySummary(
ResultCallback callback,
MemoryMeasurementDelegate::MemorySummaryMap process_summaries) { … }
base::Value::Dict MemoryMeasurementProvider::DescribeContextData(
const ResourceContext& context) const { … }
}