chromium/third_party/blink/renderer/core/inspector/inspector_preload_agent.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 "third_party/blink/renderer/core/inspector/inspector_preload_agent.h"

#include "third_party/blink/public/common/features.h"
#include "third_party/blink/renderer/core/dom/dom_node_ids.h"
#include "third_party/blink/renderer/core/frame/local_dom_window.h"
#include "third_party/blink/renderer/core/html/html_anchor_element.h"
#include "third_party/blink/renderer/core/inspector/identifiers_factory.h"
#include "third_party/blink/renderer/core/inspector/inspected_frames.h"
#include "third_party/blink/renderer/core/inspector/inspector_base_agent.h"
#include "third_party/blink/renderer/core/inspector/protocol/preload.h"
#include "third_party/blink/renderer/core/speculation_rules/document_speculation_rules.h"
#include "third_party/blink/renderer/core/speculation_rules/speculation_candidate.h"
#include "third_party/blink/renderer/core/speculation_rules/speculation_rule_set.h"

namespace blink {

namespace {

std::optional<protocol::Preload::RuleSetErrorType> GetProtocolRuleSetErrorType(
    SpeculationRuleSetErrorType error_type) {}

String GetProtocolRuleSetErrorMessage(const SpeculationRuleSet& rule_set) {}

// Struct to represent a unique preloading attempt (corresponds to
// protocol::Preload::PreloadingAttemptKey). Multiple SpeculationCandidates
// could correspond to a single PreloadingAttemptKey.
struct PreloadingAttemptKey {};

bool operator==(const PreloadingAttemptKey& a, const PreloadingAttemptKey& b) {}

struct PreloadingAttemptKeyHashTraits
    : WTF::GenericHashTraits<PreloadingAttemptKey> {};

protocol::Preload::SpeculationAction GetProtocolSpeculationAction(
    mojom::blink::SpeculationAction action) {}

std::optional<protocol::Preload::SpeculationTargetHint>
GetProtocolSpeculationTargetHint(
    mojom::blink::SpeculationTargetHint target_hint) {}

std::unique_ptr<protocol::Preload::PreloadingAttemptKey>
BuildProtocolPreloadingAttemptKey(const PreloadingAttemptKey& key,
                                  const Document& document) {}

std::unique_ptr<protocol::Preload::PreloadingAttemptSource>
BuildProtocolPreloadingAttemptSource(
    const PreloadingAttemptKey& key,
    const HeapVector<Member<SpeculationCandidate>>& candidates,
    Document& document) {}

}  // namespace

namespace internal {

std::unique_ptr<protocol::Preload::RuleSet> BuildProtocolRuleSet(
    const SpeculationRuleSet& rule_set,
    const String& loader_id) {}

}  // namespace internal

InspectorPreloadAgent::InspectorPreloadAgent(InspectedFrames* inspected_frames)
    :{}

InspectorPreloadAgent::~InspectorPreloadAgent() = default;

void InspectorPreloadAgent::Restore() {}

void InspectorPreloadAgent::DidAddSpeculationRuleSet(
    Document& document,
    const SpeculationRuleSet& rule_set) {}

void InspectorPreloadAgent::DidRemoveSpeculationRuleSet(
    const SpeculationRuleSet& rule_set) {}

void InspectorPreloadAgent::SpeculationCandidatesUpdated(
    Document& document,
    const HeapVector<Member<SpeculationCandidate>>& candidates) {}

void InspectorPreloadAgent::Trace(Visitor* visitor) const {}

protocol::Response InspectorPreloadAgent::enable() {}

protocol::Response InspectorPreloadAgent::disable() {}

void InspectorPreloadAgent::EnableInternal() {}

void InspectorPreloadAgent::ReportRuleSetsAndSources() {}

}  // namespace blink