chromium/content/browser/security/coop/cross_origin_opener_policy_access_report_manager.cc

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

#include "content/browser/security/coop/cross_origin_opener_policy_access_report_manager.h"

#include <utility>

#include "base/values.h"
#include "content/browser/renderer_host/frame_tree_node.h"
#include "content/browser/renderer_host/render_frame_host_delegate.h"
#include "content/browser/renderer_host/render_frame_host_impl.h"
#include "content/browser/renderer_host/render_frame_proxy_host.h"
#include "content/public/browser/site_instance.h"
#include "services/network/public/cpp/features.h"
#include "services/network/public/mojom/network_context.mojom.h"
#include "services/network/public/mojom/source_location.mojom.h"
#include "url/origin.h"

namespace content {

namespace {

// A map of virtual browsing context groups to the coop related groups they
// belong to. This mimics the real behavior of BrowsingInstance and
// CoopRelatedGroup. It is useful to restrict access in a more granular manner
// and to account for browsing context group reuse.
std::map<int, int>& GetVirtualBrowsingContextGroupToCoopRelatedGroupMap() {}

std::optional<blink::FrameToken> GetFrameToken(
    FrameTreeNode* frame,
    SiteInstanceGroup* site_instance_group) {}

// Find all the related windows that might try to access the new document in
// `frame`, but are in a different virtual browsing context group. The
// associated boolean indicates whether they are in the same virtual
// CoopRelatedGroup.
std::vector<std::pair<FrameTreeNode*, bool>> CollectOtherWindowForCoopAccess(
    FrameTreeNode* frame) {}

}  // namespace

CrossOriginOpenerPolicyAccessReportManager::
    CrossOriginOpenerPolicyAccessReportManager() = default;

CrossOriginOpenerPolicyAccessReportManager::
    ~CrossOriginOpenerPolicyAccessReportManager() = default;

// static
void CrossOriginOpenerPolicyAccessReportManager::InstallAccessMonitorsIfNeeded(
    FrameTreeNode* frame) {}

void CrossOriginOpenerPolicyAccessReportManager::MonitorAccesses(
    FrameTreeNode* accessing_node,
    FrameTreeNode* accessed_node,
    bool is_in_same_virtual_coop_related_group) {}

// static
int CrossOriginOpenerPolicyAccessReportManager::
    GetNewVirtualBrowsingContextGroup() {}

// static
int CrossOriginOpenerPolicyAccessReportManager::GetVirtualBrowsingContextGroup(
    CoopSwapResult enforce_result,
    CoopSwapResult report_only_result,
    int current_virtual_browsing_context_group) {}

// static
int CrossOriginOpenerPolicyAccessReportManager::
    NextVirtualBrowsingContextGroup() {}

// static
int CrossOriginOpenerPolicyAccessReportManager::NextVirtualCoopRelatedGroup() {}

}  // namespace content