chromium/content/browser/preloading/preloading_attempt_impl.cc

// Copyright 2022 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/preloading/preloading_attempt_impl.h"

#include "base/containers/span.h"
#include "base/metrics/crc32.h"
#include "base/metrics/histogram_functions.h"
#include "base/state_transitions.h"
#include "base/strings/strcat.h"
#include "content/browser/preloading/preloading.h"
#include "content/browser/preloading/preloading_config.h"
#include "content/public/browser/preloading.h"
#include "services/metrics/public/cpp/metrics_utils.h"
#include "services/metrics/public/cpp/ukm_builders.h"
#include "services/metrics/public/cpp/ukm_recorder.h"
#include "services/metrics/public/cpp/ukm_source_id.h"
#include "third_party/blink/public/common/features.h"

namespace content {

namespace {

void DCHECKTriggeringOutcomeTransitions(PreloadingTriggeringOutcome old_state,
                                        PreloadingTriggeringOutcome new_state) {}

// Preorder of PreloadingType, generated by `kPrefetch < kPrerender`.
bool IsPreloadingTypeUpgradableTo(PreloadingType lhs, PreloadingType rhs) {}

}  // namespace

void PreloadingAttemptImpl::SetEligibility(PreloadingEligibility eligibility) {}

// TODO(crbug.com/40275772): most call sites of this should be removed, as
// PreloadingConfig should subsume most feature-specific holdbacks that exist
// today. Some cases can remain as specific overrides of the PreloadingConfig
// logic, e.g. if DevTools is open, or for features that are still launching and
// thus have their own separate holdback feature while they ramp up.
void PreloadingAttemptImpl::SetHoldbackStatus(
    PreloadingHoldbackStatus holdback_status) {}

bool PreloadingAttemptImpl::ShouldHoldback() {}

void PreloadingAttemptImpl::SetTriggeringOutcome(
    PreloadingTriggeringOutcome triggering_outcome) {}

void PreloadingAttemptImpl::SetFailureReason(PreloadingFailureReason reason) {}

base::WeakPtr<PreloadingAttempt> PreloadingAttemptImpl::GetWeakPtr() {}

PreloadingAttemptImpl::PreloadingAttemptImpl(
    const PreloadingPredictor& creating_predictor,
    const PreloadingPredictor& enacting_predictor,
    PreloadingType preloading_type,
    ukm::SourceId triggered_primary_page_source_id,
    PreloadingURLMatchCallback url_match_predicate,
    std::optional<PreloadingType> planned_max_preloading_type,
    uint32_t sampling_seed)
    :{}

PreloadingAttemptImpl::~PreloadingAttemptImpl() = default;

std::vector<PreloadingPredictor> PreloadingAttemptImpl::GetPredictors() const {}

void PreloadingAttemptImpl::RecordPreloadingAttemptMetrics(
    ukm::SourceId navigated_page_source_id) {}

void PreloadingAttemptImpl::RecordPreloadingAttemptUMA() {}

void PreloadingAttemptImpl::SetNoVarySearchMatchPredicate(
    PreloadingURLMatchCallback no_vary_search_match_predicate) {}

void PreloadingAttemptImpl::SetIsAccurateTriggering(const GURL& navigated_url) {}

void PreloadingAttemptImpl::SetSpeculationEagerness(
    blink::mojom::SpeculationEagerness eagerness) {}

void PreloadingAttemptImpl::SetServiceWorkerRegisteredCheck(
    ServiceWorkerRegisteredCheck check) {}

void PreloadingAttemptImpl::SetServiceWorkerRegisteredCheckDuration(
    base::TimeDelta duration) {}

// Used for StateTransitions matching.
std::ostream& operator<<(std::ostream& os,
                         const PreloadingTriggeringOutcome& outcome) {}

}  // namespace content