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

// Copyright 2020 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_reporter.h"

#include "base/memory/raw_ptr.h"
#include "base/values.h"
#include "content/browser/renderer_host/frame_tree.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 "content/public/browser/storage_partition.h"
#include "net/base/network_anonymization_key.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 {

// Report attribute names (camelCase):
constexpr char kColumnNumber[] =;
constexpr char kDisposition[] =;
constexpr char kEffectivePolicy[] =;
constexpr char kInitialPopupURL[] =;
constexpr char kLineNumber[] =;
constexpr char kNextURL[] =;
constexpr char kOpeneeURL[] =;
constexpr char kOpenerURL[] =;
constexpr char kOtherDocumentURL[] =;
constexpr char kPreviousURL[] =;
constexpr char kProperty[] =;
constexpr char kReferrer[] =;
constexpr char kSourceFile[] =;
constexpr char kType[] =;

// Report attribute values:
constexpr char kDispositionEnforce[] =;
constexpr char kDispositionReporting[] =;
constexpr char kTypeFromResponse[] =;
constexpr char kTypeToResponse[] =;

std::string ToString(network::mojom::CrossOriginOpenerPolicyValue coop_value) {}

FrameTreeNode* TopLevelOpener(FrameTreeNode* frame) {}

// Remove sensitive data from URL used in reports.
std::string SanitizedURL(const GURL& url) {}

class Receiver final : public network::mojom::CrossOriginOpenerPolicyReporter {};

}  // namespace

CrossOriginOpenerPolicyReporter::CrossOriginOpenerPolicyReporter(
    StoragePartition* storage_partition,
    const GURL& context_url,
    const GURL& context_referrer_url,
    const network::CrossOriginOpenerPolicy& coop,
    const base::UnguessableToken& reporting_source,
    const net::NetworkAnonymizationKey& network_anonymization_key)
    :{}

CrossOriginOpenerPolicyReporter::~CrossOriginOpenerPolicyReporter() = default;

network::mojom::CrossOriginOpenerPolicyReporterParamsPtr
CrossOriginOpenerPolicyReporter::CreateReporterParams(
    bool access_from_coop_page,
    FrameTreeNode* accessing_node,
    FrameTreeNode* accessed_node) {}

void CrossOriginOpenerPolicyReporter::QueueNavigationToCOOPReport(
    const GURL& previous_url,
    bool same_origin_with_previous,
    bool is_report_only) {}

void CrossOriginOpenerPolicyReporter::QueueNavigationAwayFromCOOPReport(
    const GURL& next_url,
    bool is_current_source,
    bool same_origin_with_next,
    bool is_report_only) {}

void CrossOriginOpenerPolicyReporter::QueueAccessReport(
    network::mojom::CoopAccessReportType report_type,
    const std::string& property,
    network::mojom::SourceLocationPtr source_location,
    const std::string& reported_window_url,
    const std::string& initial_popup_url) const {}

void CrossOriginOpenerPolicyReporter::QueueNavigationReport(
    base::Value::Dict body,
    const std::string& endpoint,
    bool is_report_only) {}

}  // namespace content