chromium/components/performance_manager/persistence/site_data/site_data_impl.cc

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

#include "components/performance_manager/persistence/site_data/site_data_impl.h"

#include <algorithm>

#include "base/functional/bind.h"
#include "base/functional/callback.h"
#include "base/metrics/histogram_functions.h"
#include "base/strings/strcat.h"

namespace performance_manager {
namespace internal {

namespace {

// The sample weighing factor for the exponential moving averages for
// performance measurements. A factor of 1/2 gives each sample an equal weight
// to the entire previous history. As we don't know much noise there is to the
// measurement, this is essentially a shot in the dark.
// TODO(siggi): Consider adding UMA metrics to capture e.g. the fractional delta
//      from the current average, or some such.
constexpr float kSampleWeightFactor =;

base::TimeDelta GetTickDeltaSinceEpoch() {}

// Returns all the SiteDataFeatureProto elements contained in a
// SiteDataProto protobuf object.
std::vector<SiteDataFeatureProto*> GetAllFeaturesFromProto(
    SiteDataProto* proto) {}

// Observations windows have a default value of 2 hours, 95% of backgrounded
// tabs don't use any of these features in this time window.
static constexpr base::TimeDelta kObservationWindowLength =;

}  // namespace

void SiteDataImpl::NotifySiteLoaded() {}

void SiteDataImpl::NotifySiteUnloaded(TabVisibility tab_visibility) {}

void SiteDataImpl::NotifyLoadedSiteBackgrounded() {}

void SiteDataImpl::NotifyLoadedSiteForegrounded() {}

SiteFeatureUsage SiteDataImpl::UpdatesFaviconInBackground() const {}

SiteFeatureUsage SiteDataImpl::UpdatesTitleInBackground() const {}

SiteFeatureUsage SiteDataImpl::UsesAudioInBackground() const {}

bool SiteDataImpl::DataLoaded() const {}

void SiteDataImpl::RegisterDataLoadedCallback(base::OnceClosure&& callback) {}

void SiteDataImpl::NotifyUpdatesFaviconInBackground() {}

void SiteDataImpl::NotifyUpdatesTitleInBackground() {}

void SiteDataImpl::NotifyUsesAudioInBackground() {}

void SiteDataImpl::NotifyLoadTimePerformanceMeasurement(
    base::TimeDelta load_duration,
    base::TimeDelta cpu_usage_estimate,
    uint64_t private_footprint_kb_estimate) {}

void SiteDataImpl::ExpireAllObservationWindowsForTesting() {}

// static
const base::TimeDelta
SiteDataImpl::GetFeatureObservationWindowLengthForTesting() {}

SiteDataImpl::SiteDataImpl(const url::Origin& origin,
                           base::WeakPtr<OnDestroyDelegate> delegate,
                           SiteDataStore* data_store)
    :{}

SiteDataImpl::~SiteDataImpl() {}

base::TimeDelta SiteDataImpl::FeatureObservationDuration(
    const SiteDataFeatureProto& feature_proto) const {}

// static:
void SiteDataImpl::IncrementFeatureObservationDuration(
    SiteDataFeatureProto* feature_proto,
    base::TimeDelta extra_observation_duration) {}

void SiteDataImpl::ClearObservationsAndInvalidateReadOperation() {}

SiteFeatureUsage SiteDataImpl::GetFeatureUsage(
    const SiteDataFeatureProto& feature_proto) const {}

void SiteDataImpl::NotifyFeatureUsage(SiteDataFeatureProto* feature_proto,
                                      const char* feature_name) {}

void SiteDataImpl::OnInitCallback(
    std::optional<SiteDataProto> db_site_characteristics) {}

void SiteDataImpl::DecrementNumLoadedBackgroundTabs() {}

const SiteDataProto& SiteDataImpl::FlushStateToProto() {}

void SiteDataImpl::FlushFeaturesObservationDurationToProto() {}

void SiteDataImpl::TransitionToFullyInitialized() {}

}  // namespace internal
}  // namespace performance_manager