chromium/chrome/browser/ssl/daily_navigation_counter.h

// 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.

#ifndef CHROME_BROWSER_SSL_DAILY_NAVIGATION_COUNTER_H_
#define CHROME_BROWSER_SSL_DAILY_NAVIGATION_COUNTER_H_

#include "base/containers/flat_map.h"
#include "base/memory/raw_ptr.h"
#include "base/time/time.h"
#include "base/values.h"

namespace base {
class Clock;
}

// This class records the number of navigations inside a rolling window. Each
// navigation is counted in its day's bucket. Counts are regularly saved to
// a dictionary which can be backed by a pref, so that the counts are persisted.
// Counts belonging to the days outside the rolling window are discarded.
// This class is only intended to count an approximate the number of
// navigations for HTTPS-First Mode related heuristics. Browser restarts or
// crashes may lose some counts which shouldn't affect the heuristics
// significantly.
class DailyNavigationCounter {};

#endif  // CHROME_BROWSER_SSL_DAILY_NAVIGATION_COUNTER_H_