#ifndef COMPONENTS_PERFORMANCE_MANAGER_PUBLIC_RESOURCE_ATTRIBUTION_ATTRIBUTION_HELPERS_H_
#define COMPONENTS_PERFORMANCE_MANAGER_PUBLIC_RESOURCE_ATTRIBUTION_ATTRIBUTION_HELPERS_H_
#include <set>
#include "base/check.h"
#include "base/containers/contains.h"
#include "base/functional/function_ref.h"
#include "base/functional/overloaded.h"
#include "components/performance_manager/public/graph/process_node.h"
#include "content/public/common/process_type.h"
#include "third_party/abseil-cpp/absl/types/variant.h"
namespace performance_manager {
class FrameNode;
class WorkerNode;
}
namespace resource_attribution {
NodeSplitSet;
template <typename T,
typename FrameNode = performance_manager::FrameNode,
typename WorkerNode = performance_manager::WorkerNode,
typename FrameSetter = base::FunctionRef<void(const FrameNode*, T)>,
typename WorkerSetter = base::FunctionRef<void(const WorkerNode*, T)>>
void SplitResourceAmongFramesAndWorkers(
T resource_value,
const performance_manager::ProcessNode* process_node,
const NodeSplitSet& extra_nodes,
const NodeSplitSet& nodes_to_skip,
FrameSetter frame_setter,
WorkerSetter worker_setter);
template <typename T,
typename FrameNode = performance_manager::FrameNode,
typename WorkerNode = performance_manager::WorkerNode,
typename FrameSetter = base::FunctionRef<void(const FrameNode*, T)>,
typename WorkerSetter = base::FunctionRef<void(const WorkerNode*, T)>>
void SplitResourceAmongFramesAndWorkers(
T resource_value,
const performance_manager::ProcessNode* process_node,
FrameSetter frame_setter,
WorkerSetter worker_setter) { … }
template <typename T,
typename FrameNode,
typename WorkerNode,
typename FrameSetter,
typename WorkerSetter>
void SplitResourceAmongFramesAndWorkers(
T resource_value,
const performance_manager::ProcessNode* process_node,
const NodeSplitSet& extra_nodes,
const NodeSplitSet& nodes_to_skip,
FrameSetter frame_setter,
WorkerSetter worker_setter) { … }
}
#endif