chromium/components/performance_manager/resource_attribution/graph_change.h

// 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.

#ifndef COMPONENTS_PERFORMANCE_MANAGER_RESOURCE_ATTRIBUTION_GRAPH_CHANGE_H_
#define COMPONENTS_PERFORMANCE_MANAGER_RESOURCE_ATTRIBUTION_GRAPH_CHANGE_H_

#include <optional>

#include "base/memory/raw_ptr.h"
#include "base/task/task_traits.h"
#include "components/performance_manager/public/graph/process_node.h"
#include "components/performance_manager/resource_attribution/performance_manager_aliases.h"
#include "third_party/abseil-cpp/absl/types/variant.h"
#include "url/origin.h"

namespace performance_manager {
class Node;
}

namespace resource_attribution {

// Graph changes that can affect resource measurement distribution.
// These are all passed on the stack so don't need to use raw_ptr.
struct NoGraphChange {};

struct GraphChangeAddFrame {};

struct GraphChangeRemoveFrame {};

struct GraphChangeAddWorker {};

struct GraphChangeRemoveWorker {};

// Not technically a graph change, but modifies the distribution of FrameNode
// and WorkerNode measurements to OriginInBrowsingInstanceContexts the same way
// graph changes modify the distribution of measurements to PageContexts.
struct GraphChangeUpdateOrigin {};

struct GraphChangeUpdateProcessPriority {};

GraphChange;

}  // namespace resource_attribution

#endif  // COMPONENTS_PERFORMANCE_MANAGER_RESOURCE_ATTRIBUTION_GRAPH_CHANGE_H_