#include "components/performance_manager/execution_context_priority/boosting_vote_aggregator.h"
#include <algorithm>
#include <deque>
#include <tuple>
#include <utility>
#include "base/not_fatal_until.h"
#include "components/performance_manager/public/execution_context/execution_context.h"
namespace performance_manager {
namespace execution_context_priority {
namespace {
constexpr size_t PriorityToIndex(base::TaskPriority priority) { … }
constexpr uint32_t PriorityToBit(base::TaskPriority priority) { … }
static constexpr uint32_t kFirstLayerBit = …;
static constexpr uint32_t kLastLayerBit = …;
static_assert …;
static const ExecutionContext* kMaxExecutionContext = …;
}
BoostingVote::BoostingVote(BoostingVoteAggregator* aggregator,
const ExecutionContext* input_execution_context,
const ExecutionContext* output_execution_context,
const char* reason)
: … { … }
BoostingVote::BoostingVote(BoostingVote&& rhs) { … }
BoostingVote& BoostingVote::operator=(BoostingVote&& rhs) { … }
BoostingVote::~BoostingVote() { … }
void BoostingVote::Reset() { … }
bool BoostingVoteAggregator::ActiveLayers::IsActive(uint32_t layer_bit) const { … }
void BoostingVoteAggregator::ActiveLayers::SetActive(uint32_t layer_bit) { … }
void BoostingVoteAggregator::ActiveLayers::SetInactive(uint32_t layer_bit) { … }
BoostingVoteAggregator::NodeData::NodeData() = default;
BoostingVoteAggregator::NodeData::NodeData(NodeData&& rhs) = default;
BoostingVoteAggregator::NodeData::~NodeData() = default;
base::TaskPriority BoostingVoteAggregator::NodeData::GetEffectivePriorityLevel()
const { … }
void BoostingVoteAggregator::NodeData::IncrementEdgeCount() { … }
void BoostingVoteAggregator::NodeData::DecrementEdgeCount() { … }
BoostingVoteAggregator::EdgeData::EdgeData() = default;
BoostingVoteAggregator::EdgeData::EdgeData(EdgeData&&) = default;
BoostingVoteAggregator::EdgeData& BoostingVoteAggregator::EdgeData::operator=(
EdgeData&&) = default;
BoostingVoteAggregator::EdgeData::~EdgeData() = default;
void BoostingVoteAggregator::EdgeData::AddReason(const char* reason) { … }
bool BoostingVoteAggregator::EdgeData::RemoveReason(const char* reason) { … }
const char* BoostingVoteAggregator::EdgeData::GetActiveReason() const { … }
BoostingVoteAggregator::BoostingVoteAggregator() = default;
BoostingVoteAggregator::~BoostingVoteAggregator() { … }
VotingChannel BoostingVoteAggregator::GetVotingChannel() { … }
void BoostingVoteAggregator::SetUpstreamVotingChannel(VotingChannel channel) { … }
bool BoostingVoteAggregator::IsSetup() const { … }
void BoostingVoteAggregator::SubmitBoostingVote(
const BoostingVote* boosting_vote) { … }
void BoostingVoteAggregator::CancelBoostingVote(
const BoostingVote* boosting_vote) { … }
void BoostingVoteAggregator::OnVoteSubmitted(
VoterId voter_id,
const ExecutionContext* execution_context,
const Vote& vote) { … }
void BoostingVoteAggregator::OnVoteChanged(
VoterId voter_id,
const ExecutionContext* execution_context,
const Vote& new_vote) { … }
void BoostingVoteAggregator::OnVoteInvalidated(
VoterId voter_id,
const ExecutionContext* execution_context) { … }
template <typename Function>
void BoostingVoteAggregator::ForEachIncomingEdge(const ExecutionContext* node,
Function&& function) { … }
template <typename Function>
void BoostingVoteAggregator::ForEachOutgoingEdge(const ExecutionContext* node,
Function&& function) { … }
BoostingVoteAggregator::NodeDataMap::iterator
BoostingVoteAggregator::FindOrCreateNodeData(const ExecutionContext* node) { … }
BoostingVoteAggregator::NodeDataMap::iterator
BoostingVoteAggregator::FindNodeData(const ExecutionContext* node) { … }
const char* BoostingVoteAggregator::GetVoteReason(
const NodeDataMap::value_type* node) { … }
void BoostingVoteAggregator::UpstreamVoteIfNeeded(
NodeDataMap::value_type* node) { … }
void BoostingVoteAggregator::UpstreamChanges(const NodeDataPtrSet& changes) { … }
void BoostingVoteAggregator::MaybeRemoveNode(
NodeDataMap::iterator node_data_it) { … }
void BoostingVoteAggregator::MarkSubtreeInactive(uint32_t layer_bit,
NodeDataMap::value_type* node,
NodeDataPtrSet* deactivated) { … }
BoostingVoteAggregator::ReverseEdges::iterator
BoostingVoteAggregator::GetActiveInboundEdge(
uint32_t layer_bit,
const NodeDataMap::value_type* node) { … }
BoostingVoteAggregator::NodeDataMap::value_type*
BoostingVoteAggregator::GetNearestActiveAncestor(
uint32_t layer_bit,
const NodeDataMap::value_type* deactivated_node) { … }
void BoostingVoteAggregator::GetNearestActiveAncestors(
uint32_t layer_bit,
const NodeDataPtrSet& deactivated,
NodeDataPtrSet* active_ancestors) { … }
void BoostingVoteAggregator::MarkNodesActiveFromSearchFront(
uint32_t layer_bit,
NodeDataPtrSet* active_search_front,
NodeDataPtrSet* activated) { … }
void BoostingVoteAggregator::ReprocessSubtree(uint32_t layer_bit,
NodeDataMap::value_type* node,
NodeDataPtrSet* changes) { … }
void BoostingVoteAggregator::OnVoteAdded(uint32_t layer_bit,
NodeDataMap::value_type* node,
NodeDataPtrSet* changes) { … }
void BoostingVoteAggregator::OnVoteRemoved(uint32_t layer_bit,
NodeDataMap::value_type* node,
NodeDataPtrSet* changes) { … }
}
}