chromium/components/performance_manager/resource_attribution/process_context.cc

// Copyright 2023 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "components/performance_manager/public/resource_attribution/process_context.h"

#include <optional>
#include <utility>

#include "base/check.h"
#include "base/functional/overloaded.h"
#include "base/memory/weak_ptr.h"
#include "base/strings/strcat.h"
#include "base/strings/string_number_conversions.h"
#include "components/performance_manager/graph/process_node_impl.h"
#include "components/performance_manager/public/browser_child_process_host_id.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_child_process_host.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/child_process_data.h"
#include "content/public/browser/render_process_host.h"
#include "third_party/abseil-cpp/absl/types/variant.h"

namespace resource_attribution {

ProcessContext::ProcessContext(AnyProcessHostId id,
                               base::WeakPtr<ProcessNode> weak_node)
    :{}

ProcessContext::~ProcessContext() = default;

ProcessContext::ProcessContext(const ProcessContext& other) = default;

ProcessContext& ProcessContext::operator=(const ProcessContext& other) =
    default;

ProcessContext::ProcessContext(ProcessContext&& other) = default;

ProcessContext& ProcessContext::operator=(ProcessContext&& other) = default;

// static
std::optional<ProcessContext> ProcessContext::FromBrowserProcess() {}

// static
std::optional<ProcessContext> ProcessContext::FromRenderProcessHost(
    content::RenderProcessHost* host) {}

// static
std::optional<ProcessContext> ProcessContext::FromBrowserChildProcessHost(
    content::BrowserChildProcessHost* host) {}

bool ProcessContext::IsBrowserProcessContext() const {}

bool ProcessContext::IsRenderProcessContext() const {}

bool ProcessContext::IsBrowserChildProcessContext() const {}

content::RenderProcessHost* ProcessContext::GetRenderProcessHost() const {}

RenderProcessHostId ProcessContext::GetRenderProcessHostId() const {}

content::BrowserChildProcessHost* ProcessContext::GetBrowserChildProcessHost()
    const {}

BrowserChildProcessHostId ProcessContext::GetBrowserChildProcessHostId() const {}

base::WeakPtr<ProcessNode> ProcessContext::GetWeakProcessNode() const {}

// static
ProcessContext ProcessContext::FromProcessNode(const ProcessNode* node) {}

// static
std::optional<ProcessContext> ProcessContext::FromWeakProcessNode(
    base::WeakPtr<ProcessNode> node) {}

ProcessNode* ProcessContext::GetProcessNode() const {}

std::string ProcessContext::ToString() const {}

}  // namespace resource_attribution