#include "components/performance_manager/execution_context/execution_context_registry_impl.h"
#include "base/check.h"
#include "base/memory/raw_ref.h"
#include "base/notreached.h"
#include "base/observer_list.h"
#include "components/performance_manager/execution_context/execution_context_impl.h"
#include "components/performance_manager/graph/frame_node_impl.h"
#include "components/performance_manager/graph/worker_node_impl.h"
#include "components/performance_manager/public/execution_context/execution_context.h"
#include "url/gurl.h"
namespace performance_manager {
namespace execution_context {
namespace {
class DummyExecutionContextForLookup : public ExecutionContext { … };
}
ExecutionContextRegistry::ExecutionContextRegistry() = default;
ExecutionContextRegistry::~ExecutionContextRegistry() = default;
ExecutionContextRegistry* ExecutionContextRegistry::GetFromGraph(Graph* graph) { … }
const ExecutionContext*
ExecutionContextRegistry::GetExecutionContextForFrameNode(
const FrameNode* frame_node) { … }
const ExecutionContext*
ExecutionContextRegistry::GetExecutionContextForWorkerNode(
const WorkerNode* worker_node) { … }
ExecutionContextRegistryImpl::ExecutionContextRegistryImpl() { … }
ExecutionContextRegistryImpl::~ExecutionContextRegistryImpl() = default;
void ExecutionContextRegistryImpl::AddObserver(
ExecutionContextObserver* observer) { … }
bool ExecutionContextRegistryImpl::HasObserver(
ExecutionContextObserver* observer) const { … }
void ExecutionContextRegistryImpl::RemoveObserver(
ExecutionContextObserver* observer) { … }
const ExecutionContext*
ExecutionContextRegistryImpl::GetExecutionContextByToken(
const blink::ExecutionContextToken& token) { … }
const FrameNode* ExecutionContextRegistryImpl::GetFrameNodeByFrameToken(
const blink::LocalFrameToken& token) { … }
const WorkerNode* ExecutionContextRegistryImpl::GetWorkerNodeByWorkerToken(
const blink::WorkerToken& token) { … }
const ExecutionContext*
ExecutionContextRegistryImpl::GetExecutionContextForFrameNodeImpl(
const FrameNode* frame_node) { … }
const ExecutionContext*
ExecutionContextRegistryImpl::GetExecutionContextForWorkerNodeImpl(
const WorkerNode* worker_node) { … }
void ExecutionContextRegistryImpl::SetUp(Graph* graph) { … }
void ExecutionContextRegistryImpl::TearDown(Graph* graph) { … }
void ExecutionContextRegistryImpl::OnFrameNodeAdded(
const FrameNode* frame_node) { … }
void ExecutionContextRegistryImpl::OnBeforeFrameNodeRemoved(
const FrameNode* frame_node) { … }
void ExecutionContextRegistryImpl::OnPriorityAndReasonChanged(
const FrameNode* frame_node,
const PriorityAndReason& previous_value) { … }
void ExecutionContextRegistryImpl::OnWorkerNodeAdded(
const WorkerNode* worker_node) { … }
void ExecutionContextRegistryImpl::OnBeforeWorkerNodeRemoved(
const WorkerNode* worker_node) { … }
void ExecutionContextRegistryImpl::OnPriorityAndReasonChanged(
const WorkerNode* worker_node,
const PriorityAndReason& previous_value) { … }
size_t ExecutionContextRegistryImpl::ExecutionContextHash::operator()(
const ExecutionContext* ec) const { … }
bool ExecutionContextRegistryImpl::ExecutionContextKeyEqual::operator()(
const ExecutionContext* ec1,
const ExecutionContext* ec2) const { … }
}
}