#include "components/performance_manager/public/resource_attribution/frame_context.h"
#include <optional>
#include <sstream>
#include <utility>
#include "base/check.h"
#include "base/memory/weak_ptr.h"
#include "components/performance_manager/graph/frame_node_impl.h"
#include "components/performance_manager/graph/process_node_impl.h"
#include "components/performance_manager/public/graph/frame_node.h"
#include "components/performance_manager/public/graph/graph.h"
#include "components/performance_manager/public/performance_manager.h"
#include "components/performance_manager/public/render_process_host_id.h"
#include "components/performance_manager/resource_attribution/performance_manager_aliases.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/global_routing_id.h"
#include "content/public/browser/render_frame_host.h"
namespace resource_attribution {
namespace {
bool IsValidId(content::GlobalRenderFrameHostId id) { … }
}
FrameContext::FrameContext(content::GlobalRenderFrameHostId id,
base::WeakPtr<FrameNode> weak_node)
: … { … }
FrameContext::~FrameContext() = default;
FrameContext::FrameContext(const FrameContext& other) = default;
FrameContext& FrameContext::operator=(const FrameContext& other) = default;
FrameContext::FrameContext(FrameContext&& other) = default;
FrameContext& FrameContext::operator=(FrameContext&& other) = default;
std::optional<FrameContext> FrameContext::FromRenderFrameHost(
content::RenderFrameHost* host) { … }
content::RenderFrameHost* FrameContext::GetRenderFrameHost() const { … }
content::GlobalRenderFrameHostId FrameContext::GetRenderFrameHostId() const { … }
base::WeakPtr<FrameNode> FrameContext::GetWeakFrameNode() const { … }
FrameContext FrameContext::FromFrameNode(const FrameNode* node) { … }
std::optional<FrameContext> FrameContext::FromWeakFrameNode(
base::WeakPtr<FrameNode> node) { … }
FrameNode* FrameContext::GetFrameNode() const { … }
std::string FrameContext::ToString() const { … }
}