chromium/components/safe_browsing/core/browser/safe_browsing_metrics_collector.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 "components/safe_browsing/core/browser/safe_browsing_metrics_collector.h"

#include "base/json/values_util.h"
#include "base/logging.h"
#include "base/metrics/histogram_functions.h"
#include "base/ranges/algorithm.h"
#include "base/strings/string_number_conversions.h"
#include "base/time/time.h"
#include "components/password_manager/core/common/password_manager_pref_names.h"
#include "components/prefs/pref_service.h"
#include "components/prefs/scoped_user_pref_update.h"
#include "components/safe_browsing/core/browser/db/hit_report.h"
#include "components/safe_browsing/core/common/safe_browsing_prefs.h"

namespace {

EventType;
UserState;
SafeBrowsingState;

const int kMetricsLoggingIntervalDay =;

// The max length of event timestamps stored in pref.
const int kTimestampsMaxLength =;
// The quota for ESB disabled metrics. ESB disabled metrics should not be logged
// more than the quota in a week.
const int kEsbDisabledMetricsQuota =;
// Events that are older than 30 days are removed from pref.
const int kEventMaxDurationDay =;
// The ESB enabled duration is considered short if it's under 1 hour, long if
// it's at least 24 hours, and medium if it's in between.
const int kEsbShortEnabledUpperBoundHours =;
const int kEsbLongEnabledLowerBoundHours =;

std::string EventTypeToPrefKey(const EventType& type) {}

std::string UserStateToPrefKey(const UserState& user_state) {}

base::Value TimeToPrefValue(const base::Time& time) {}

base::Time PrefValueToTime(const base::Value& value) {}

}  // namespace

namespace safe_browsing {

SafeBrowsingMetricsCollector::SafeBrowsingMetricsCollector(
    PrefService* pref_service)
    :{}

void SafeBrowsingMetricsCollector::Shutdown() {}

void SafeBrowsingMetricsCollector::StartLogging() {}

void SafeBrowsingMetricsCollector::LogMetricsAndScheduleNextLogging() {}

void SafeBrowsingMetricsCollector::MaybeLogDailyEsbProtegoPingSent() {}

void SafeBrowsingMetricsCollector::ScheduleNextLoggingAfterInterval(
    base::TimeDelta interval) {}

void SafeBrowsingMetricsCollector::LogDailyOptInMetrics() {}

void SafeBrowsingMetricsCollector::LogDailyEventMetrics() {}

void SafeBrowsingMetricsCollector::RemoveOldEventsFromPref() {}

void SafeBrowsingMetricsCollector::AddSafeBrowsingEventToPref(
    EventType event_type) {}

void SafeBrowsingMetricsCollector::AddBypassEventToPref(
    ThreatSource threat_source) {}

std::optional<base::Time> SafeBrowsingMetricsCollector::GetLatestEventTimestamp(
    EventType event_type) {}

std::optional<base::Time> SafeBrowsingMetricsCollector::GetLatestEventTimestamp(
    EventTypeFilter event_type_filter) {}

std::optional<base::Time>
SafeBrowsingMetricsCollector::GetLatestSecuritySensitiveEventTimestamp() {}

void SafeBrowsingMetricsCollector::AddSafeBrowsingEventAndUserStateToPref(
    UserState user_state,
    EventType event_type) {}

void SafeBrowsingMetricsCollector::OnEnhancedProtectionPrefChanged() {}

const base::Value::Dict*
SafeBrowsingMetricsCollector::GetSafeBrowsingEventDictionary(
    UserState user_state) {}

std::optional<SafeBrowsingMetricsCollector::Event>
SafeBrowsingMetricsCollector::GetLatestEventFromEventType(
    UserState user_state,
    EventType event_type) {}

std::optional<SafeBrowsingMetricsCollector::Event>
SafeBrowsingMetricsCollector::GetLatestEventFromEventTypeFilter(
    UserState user_state,
    EventTypeFilter event_type_filter) {}

void SafeBrowsingMetricsCollector::LogEnhancedProtectionDisabledMetrics() {}

void SafeBrowsingMetricsCollector::
    LogThrottledEnhancedProtectionDisabledMetrics() {}

int SafeBrowsingMetricsCollector::GetEventCountSince(UserState user_state,
                                                     EventType event_type,
                                                     base::Time since_time) {}

UserState SafeBrowsingMetricsCollector::GetUserState() {}

bool SafeBrowsingMetricsCollector::IsBypassEventType(const EventType& type) {}

bool SafeBrowsingMetricsCollector::IsSecuritySensitiveEventType(
    const EventType& type) {}

std::string SafeBrowsingMetricsCollector::GetUserStateMetricSuffix(
    const UserState& user_state) {}

std::string SafeBrowsingMetricsCollector::GetTimesDisabledSuffix() {}

SafeBrowsingMetricsCollector::Event::Event(EventType type, base::Time timestamp)
    :{}

}  // namespace safe_browsing