#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 {
constexpr float kSampleWeightFactor = …;
base::TimeDelta GetTickDeltaSinceEpoch() { … }
std::vector<SiteDataFeatureProto*> GetAllFeaturesFromProto(
SiteDataProto* proto) { … }
static constexpr base::TimeDelta kObservationWindowLength = …;
}
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() { … }
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 { … }
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() { … }
}
}