chromium/components/history/core/browser/history_backend.cc

// Copyright 2012 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/history/core/browser/history_backend.h"

#include <algorithm>
#include <functional>
#include <iterator>
#include <limits>
#include <map>
#include <memory>
#include <set>
#include <utility>
#include <vector>

#include "base/compiler_specific.h"
#include "base/containers/flat_set.h"
#include "base/feature_list.h"
#include "base/files/file_enumerator.h"
#include "base/files/file_path.h"
#include "base/files/file_util.h"
#include "base/functional/bind.h"
#include "base/functional/callback_helpers.h"
#include "base/logging.h"
#include "base/memory/memory_pressure_listener.h"
#include "base/metrics/histogram_functions.h"
#include "base/metrics/histogram_macros.h"
#include "base/no_destructor.h"
#include "base/notreached.h"
#include "base/observer_list.h"
#include "base/rand_util.h"
#include "base/strings/escape.h"
#include "base/strings/utf_string_conversions.h"
#include "base/task/sequenced_task_runner.h"
#include "base/task/single_thread_task_runner.h"
#include "base/time/time.h"
#include "base/timer/elapsed_timer.h"
#include "base/trace_event/trace_event.h"
#include "base/trace_event/typed_macros.h"
#include "base/tracing/protos/chrome_track_event.pbzero.h"
#include "build/build_config.h"
#include "build/ios_buildflags.h"
#include "components/favicon/core/favicon_backend.h"
#include "components/history/core/browser/download_constants.h"
#include "components/history/core/browser/download_row.h"
#include "components/history/core/browser/features.h"
#include "components/history/core/browser/history_backend_client.h"
#include "components/history/core/browser/history_backend_observer.h"
#include "components/history/core/browser/history_constants.h"
#include "components/history/core/browser/history_database.h"
#include "components/history/core/browser/history_database_params.h"
#include "components/history/core/browser/history_db_task.h"
#include "components/history/core/browser/history_types.h"
#include "components/history/core/browser/in_memory_history_backend.h"
#include "components/history/core/browser/keyword_search_term.h"
#include "components/history/core/browser/keyword_search_term_util.h"
#include "components/history/core/browser/page_usage_data.h"
#include "components/history/core/browser/sync/history_sync_bridge.h"
#include "components/history/core/browser/url_row.h"
#include "components/history/core/browser/url_utils.h"
#include "components/sync/base/features.h"
#include "components/sync/base/report_unrecoverable_error.h"
#include "components/sync/model/client_tag_based_data_type_processor.h"
#include "components/url_formatter/url_formatter.h"
#include "net/base/registry_controlled_domains/registry_controlled_domain.h"
#include "sql/error_delegate_util.h"
#include "sql/sqlite_result_code.h"
#include "sql/sqlite_result_code_values.h"
#include "sql/transaction.h"
#include "third_party/skia/include/core/SkBitmap.h"
#include "ui/base/page_transition_types.h"
#include "url/gurl.h"
#include "url/url_constants.h"

#if BUILDFLAG(IS_IOS) && !BUILDFLAG(IS_IOS_APP_EXTENSION)
#include "base/ios/scoped_critical_action.h"
#endif

Time;
TimeTicks;
FaviconBitmap;
FaviconBitmapID;
FaviconBitmapIDSize;
FaviconBitmapType;
IconMapping;
ClientTagBasedDataTypeProcessor;

/* The HistoryBackend consists of two components:

    HistoryDatabase (stores past 3 months of history)
      URLDatabase (stores a list of URLs)
      DownloadDatabase (stores a list of downloads)
      VisitDatabase (stores a list of visits for the URLs)
      VisitedLinkDatabase (stores a list of triple-key partitioned URLs)
      VisitSegmentDatabase (stores groups of URLs for the most visited view).

    ExpireHistoryBackend (manages deleting things older than 3 months)
*/

namespace history {

namespace {

OsType;
FormFactor;

#if DCHECK_IS_ON()
// Use to keep track of paths used to host HistoryBackends. This class
// is thread-safe. No two backends should ever run at the same time using the
// same directory since they will contend on the files created there.
class HistoryPathsTracker {};
#endif

void RunUnlessCanceled(
    base::OnceClosure closure,
    const base::CancelableTaskTracker::IsCanceledCallback& is_canceled) {}

// How long we'll wait to do a commit, so that things are batched together.
const int kCommitIntervalSeconds =;

// The maximum number of items we'll allow in the redirect list before
// deleting some.
const int kMaxRedirectCount =;

// The number of days old a history entry can be before it is considered "old"
// and is deleted.
constexpr int kExpireDaysThreshold =;

// The maximum number of days for which domain visit metrics are computed
// each time HistoryBackend::GetDomainDiversity() is called.
constexpr int kDomainDiversityMaxBacktrackedDays =;

// An offset that corrects possible error in date/time arithmetic caused by
// fluctuation of day length due to Daylight Saving Time (DST). For example,
// given midnight M, its next midnight can be computed as (M + 24 hour
// + offset).LocalMidnight(). In most modern DST systems, the DST shift is
// typically 1 hour. However, a larger value of 4 is chosen here to
// accommodate larger DST shifts that have been used historically and to
// avoid other potential issues.
constexpr int kDSTRoundingOffsetHours =;

// When batch-deleting foreign visits (i.e. visits coming from other devices),
// this specifies how many visits to delete in a single HistoryDBTask. This
// usually happens when history sync was turned off.
constexpr int kSyncHistoryForeignVisitsToDeletePerBatch =;

// Merges `update` into `existing` by overwriting fields in `existing` that are
// not the default value in `update`.
void MergeUpdateIntoExistingModelAnnotations(
    const VisitContentModelAnnotations& update,
    VisitContentModelAnnotations& existing) {}

class DeleteForeignVisitsDBTask : public HistoryDBTask {};

// On iOS devices, Returns true if the device that created the foreign visit is
// an Android or iOS device, and has a mobile form factor.
//
// On non-iOS devices, returns false.
bool CanAddForeignVisitToSegments(
    const VisitRow& foreign_visit,
    const std::string& local_device_originator_cache_guid,
    const SyncDeviceInfoMap& sync_device_info) {}

// Returns whether a page visit has a ui::PageTransition type that allows us
// to construct a triple partition key for the VisitedLinkDatabase.
bool IsVisitedLinkTransition(ui::PageTransition transition) {}

}  // namespace

std::u16string FormatUrlForRedirectComparison(const GURL& url) {}

base::Time MidnightNDaysLater(base::Time time, int days) {}

QueuedHistoryDBTask::QueuedHistoryDBTask(
    std::unique_ptr<HistoryDBTask> task,
    scoped_refptr<base::SequencedTaskRunner> origin_loop,
    const base::CancelableTaskTracker::IsCanceledCallback& is_canceled)
    :{}

QueuedHistoryDBTask::~QueuedHistoryDBTask() {}

bool QueuedHistoryDBTask::is_canceled() {}

bool QueuedHistoryDBTask::Run(HistoryBackend* backend, HistoryDatabase* db) {}

void QueuedHistoryDBTask::DoneRun() {}

// HistoryBackend --------------------------------------------------------------

// static
bool HistoryBackend::IsTypedIncrement(ui::PageTransition transition) {}

HistoryBackend::HistoryBackend(
    std::unique_ptr<Delegate> delegate,
    std::unique_ptr<HistoryBackendClient> backend_client,
    scoped_refptr<base::SequencedTaskRunner> task_runner)
    :{}

HistoryBackend::~HistoryBackend() {}

void HistoryBackend::Init(
    bool force_fail,
    const HistoryDatabaseParams& history_database_params) {}

void HistoryBackend::SetOnBackendDestroyTask(
    scoped_refptr<base::SingleThreadTaskRunner> task_runner,
    base::OnceClosure task) {}

void HistoryBackend::Closing() {}

#if BUILDFLAG(IS_IOS)
void HistoryBackend::PersistState() {
  TRACE_EVENT0("browser", "HistoryBackend::PersistState");
  Commit();
}
#endif

void HistoryBackend::ClearCachedDataForContextID(ContextID context_id) {}

base::FilePath HistoryBackend::GetFaviconsFileName() const {}

SegmentID HistoryBackend::GetLastSegmentID(VisitID from_visit) {}

SegmentID HistoryBackend::AssignSegmentForNewVisit(
    const GURL& url,
    VisitID from_visit,
    VisitID visit_id,
    ui::PageTransition transition_type,
    const Time ts) {}

SegmentID HistoryBackend::CalculateSegmentID(
    const GURL& url,
    VisitID from_visit,
    ui::PageTransition transition_type) {}

void HistoryBackend::UpdateSegmentForExistingForeignVisit(VisitRow& visit_row) {}

void HistoryBackend::UpdateWithPageEndTime(ContextID context_id,
                                           int nav_entry_id,
                                           const GURL& url,
                                           Time end_ts) {}

void HistoryBackend::SetBrowsingTopicsAllowed(ContextID context_id,
                                              int nav_entry_id,
                                              const GURL& url) {}

void HistoryBackend::SetPageLanguageForVisit(ContextID context_id,
                                             int nav_entry_id,
                                             const GURL& url,
                                             const std::string& page_language) {}

void HistoryBackend::SetPageLanguageForVisitByVisitID(
    VisitID visit_id,
    const std::string& page_language) {}

void HistoryBackend::SetPasswordStateForVisit(
    ContextID context_id,
    int nav_entry_id,
    const GURL& url,
    VisitContentAnnotations::PasswordState password_state) {}

void HistoryBackend::SetPasswordStateForVisitByVisitID(
    VisitID visit_id,
    VisitContentAnnotations::PasswordState password_state) {}

void HistoryBackend::AddContentModelAnnotationsForVisit(
    VisitID visit_id,
    const VisitContentModelAnnotations& model_annotations) {}

void HistoryBackend::AddRelatedSearchesForVisit(
    VisitID visit_id,
    const std::vector<std::string>& related_searches) {}

void HistoryBackend::AddSearchMetadataForVisit(
    VisitID visit_id,
    const GURL& search_normalized_url,
    const std::u16string& search_terms) {}

void HistoryBackend::AddPageMetadataForVisit(
    VisitID visit_id,
    const std::string& alternative_title) {}

void HistoryBackend::SetHasUrlKeyedImageForVisit(VisitID visit_id,
                                                 bool has_url_keyed_image) {}

void HistoryBackend::UpdateVisitDuration(VisitID visit_id, const Time end_ts) {}

void HistoryBackend::MarkVisitAsKnownToSync(VisitID visit_id) {}

bool HistoryBackend::IsUntypedIntranetHost(const GURL& url) {}

OriginCountAndLastVisitMap HistoryBackend::GetCountsAndLastVisitForOrigins(
    const std::set<GURL>& origins) const {}

void HistoryBackend::AddPage(const HistoryAddPageArgs& request) {}

void HistoryBackend::InitImpl(
    const HistoryDatabaseParams& history_database_params) {}

void HistoryBackend::OnMemoryPressure(
    base::MemoryPressureListener::MemoryPressureLevel memory_pressure_level) {}

void HistoryBackend::CloseAllDatabases() {}

std::pair<URLID, VisitID> HistoryBackend::AddPageVisit(
    const GURL& url,
    Time time,
    VisitID referring_visit,
    const GURL& external_referrer_url,
    ui::PageTransition transition,
    bool hidden,
    VisitSource visit_source,
    bool should_increment_typed_count,
    VisitID opener_visit,
    bool consider_for_ntp_most_visited,
    std::optional<int64_t> local_navigation_id,
    std::optional<std::u16string> title,
    std::optional<GURL> top_level_url,
    std::optional<GURL> frame_url,
    std::optional<std::string> app_id,
    std::optional<base::TimeDelta> visit_duration,
    std::optional<std::string> originator_cache_guid,
    std::optional<VisitID> originator_visit_id,
    std::optional<VisitID> originator_referring_visit,
    std::optional<VisitID> originator_opener_visit,
    bool is_known_to_sync) {}

// TODO(crbug.com/40279741): Determine if we want to record these URLs in the
// VisitedLinkDatabase, and if so, plumb the correct value for top_level_site.
void HistoryBackend::AddPagesWithDetails(const URLRows& urls,
                                         VisitSource visit_source) {}

bool HistoryBackend::IsExpiredVisitTime(const base::Time& time) const {}

// static
int HistoryBackend::GetForeignVisitsToDeletePerBatchForTest() {}

sql::Database& HistoryBackend::GetDBForTesting() {}

void HistoryBackend::SetPageTitle(const GURL& url,
                                  const std::u16string& title) {}

void HistoryBackend::AddPageNoVisitForBookmark(const GURL& url,
                                               const std::u16string& title) {}

bool HistoryBackend::CanAddURL(const GURL& url) const {}

bool HistoryBackend::GetAllTypedURLs(URLRows* urls) {}

bool HistoryBackend::GetVisitsForURL(URLID id, VisitVector* visits) {}

std::map<GURL, VisitRow> HistoryBackend::GetMostRecentVisitForEachURL(
    const std::vector<GURL>& urls) {}

bool HistoryBackend::GetMostRecentVisitForURL(URLID id, VisitRow* visit_row) {}

bool HistoryBackend::GetMostRecentVisitsForURL(URLID id,
                                               int max_visits,
                                               VisitVector* visits) {}

QueryURLResult HistoryBackend::GetMostRecentVisitsForGurl(GURL url,
                                                          int max_visits) {}

bool HistoryBackend::GetForeignVisit(const std::string& originator_cache_guid,
                                     VisitID originator_visit_id,
                                     VisitRow* visit_row) {}

VisitID HistoryBackend::AddSyncedVisit(
    const GURL& url,
    const std::u16string& title,
    bool hidden,
    const VisitRow& visit,
    const std::optional<VisitContextAnnotations>& context_annotations,
    const std::optional<VisitContentAnnotations>& content_annotations) {}

VisitID HistoryBackend::UpdateSyncedVisit(
    const GURL& url,
    const std::u16string& title,
    bool hidden,
    const VisitRow& visit,
    const std::optional<VisitContextAnnotations>& context_annotations,
    const std::optional<VisitContentAnnotations>& content_annotations) {}

bool HistoryBackend::UpdateVisitReferrerOpenerIDs(VisitID visit_id,
                                                  VisitID referrer_id,
                                                  VisitID opener_id) {}

void HistoryBackend::DeleteAllForeignVisitsAndResetIsKnownToSync() {}

bool HistoryBackend::RemoveVisits(const VisitVector& visits,
                                  DeletionInfo::Reason deletion_reason) {}

bool HistoryBackend::GetVisitsSource(const VisitVector& visits,
                                     VisitSourceMap* sources) {}

bool HistoryBackend::GetVisitSource(const VisitID visit_id,
                                    VisitSource* source) {}

bool HistoryBackend::GetURL(const GURL& url, URLRow* url_row) {}

bool HistoryBackend::GetURLByID(URLID url_id, URLRow* url_row) {}

bool HistoryBackend::GetVisitByID(VisitID visit_id, VisitRow* visit_row) {}

bool HistoryBackend::GetLastVisitByTime(base::Time visit_time,
                                        VisitRow* visit_row) {}

QueryURLResult HistoryBackend::QueryURL(const GURL& url, bool want_visits) {}

std::vector<QueryURLResult> HistoryBackend::QueryURLs(
    const std::vector<GURL>& urls,
    bool want_visits) {}

base::WeakPtr<syncer::DataTypeControllerDelegate>
HistoryBackend::GetHistorySyncControllerDelegate() {}

void HistoryBackend::SetSyncTransportState(
    syncer::SyncService::TransportState state) {}

// Statistics ------------------------------------------------------------------

HistoryCountResult HistoryBackend::GetHistoryCount(const Time& begin_time,
                                                   const Time& end_time) {}

HistoryCountResult HistoryBackend::CountUniqueHostsVisitedLastMonth() {}

std::pair<DomainDiversityResults, DomainDiversityResults>
HistoryBackend::GetDomainDiversity(
    base::Time report_time,
    int number_of_days_to_report,
    DomainMetricBitmaskType metric_type_bitmask) {}

DomainsVisitedResult HistoryBackend::GetUniqueDomainsVisited(
    base::Time begin_time,
    base::Time end_time) {}

GetAllAppIdsResult HistoryBackend::GetAllAppIds() {}

HistoryLastVisitResult HistoryBackend::GetLastVisitToHost(
    const std::string& host,
    base::Time begin_time,
    base::Time end_time) {}

HistoryLastVisitResult HistoryBackend::GetLastVisitToOrigin(
    const url::Origin& origin,
    base::Time begin_time,
    base::Time end_time) {}

HistoryLastVisitResult HistoryBackend::GetLastVisitToURL(const GURL& url,
                                                         base::Time end_time) {}

DailyVisitsResult HistoryBackend::GetDailyVisitsToHost(const GURL& host,
                                                       base::Time begin_time,
                                                       base::Time end_time) {}

// Keyword visits --------------------------------------------------------------

void HistoryBackend::SetKeywordSearchTermsForURL(const GURL& url,
                                                 KeywordID keyword_id,
                                                 const std::u16string& term) {}

void HistoryBackend::DeleteAllSearchTermsForKeyword(KeywordID keyword_id) {}

void HistoryBackend::DeleteKeywordSearchTermForURL(const GURL& url) {}

void HistoryBackend::DeleteMatchingURLsForKeyword(KeywordID keyword_id,
                                                  const std::u16string& term) {}

// Clusters --------------------------------------------------------------------

void HistoryBackend::AddContextAnnotationsForVisit(
    VisitID visit_id,
    const VisitContextAnnotations& visit_context_annotations) {}

void HistoryBackend::SetOnCloseContextAnnotationsForVisit(
    VisitID visit_id,
    const VisitContextAnnotations& visit_context_annotations) {}

std::vector<AnnotatedVisit> HistoryBackend::GetAnnotatedVisits(
    const QueryOptions& options,
    bool compute_redirect_chain_start_properties,
    bool get_unclustered_visits_only,
    bool* limited_by_max_count) {}

std::vector<AnnotatedVisit> HistoryBackend::ToAnnotatedVisitsFromRows(
    const VisitVector& visit_rows,
    bool compute_redirect_chain_start_properties) {}

std::vector<AnnotatedVisit> HistoryBackend::ToAnnotatedVisitsFromIds(
    const std::vector<VisitID>& visit_ids,
    bool compute_redirect_chain_start_properties) {}

std::vector<ClusterVisit> HistoryBackend::ToClusterVisits(
    const std::vector<VisitID>& visit_ids,
    bool include_duplicates) {}

std::vector<DuplicateClusterVisit> HistoryBackend::ToDuplicateClusterVisits(
    const std::vector<VisitID>& visit_ids) {}

base::Time HistoryBackend::FindMostRecentClusteredTime() {}

void HistoryBackend::ReplaceClusters(
    const std::vector<int64_t>& ids_to_delete,
    const std::vector<Cluster>& clusters_to_add) {}

int64_t HistoryBackend::ReserveNextClusterIdWithVisit(
    const ClusterVisit& cluster_visit) {}

void HistoryBackend::AddVisitsToCluster(
    int64_t cluster_id,
    const std::vector<ClusterVisit>& visits) {}

void HistoryBackend::AddVisitToSyncedCluster(
    const history::ClusterVisit& cluster_visit,
    const std::string& originator_cache_guid,
    int64_t originator_cluster_id) {}

void HistoryBackend::UpdateClusterTriggerability(
    const std::vector<Cluster>& clusters) {}

void HistoryBackend::HideVisits(const std::vector<VisitID>& visit_ids) {}

void HistoryBackend::UpdateClusterVisit(
    const history::ClusterVisit& cluster_visit) {}

void HistoryBackend::UpdateVisitsInteractionState(
    const std::vector<VisitID>& visit_ids,
    const ClusterVisit::InteractionState interaction_state) {}

std::vector<Cluster> HistoryBackend::GetMostRecentClusters(
    base::Time inclusive_min_time,
    base::Time exclusive_max_time,
    size_t max_clusters,
    size_t max_visits_soft_cap,
    bool include_keywords_and_duplicates) {}

Cluster HistoryBackend::GetCluster(int64_t cluster_id,
                                   bool include_keywords_and_duplicates) {}

int64_t HistoryBackend::GetClusterIdContainingVisit(VisitID visit_id) {}

VisitRow HistoryBackend::GetRedirectChainStart(VisitRow visit) {}

VisitVector HistoryBackend::GetRedirectChain(VisitRow visit) {}

// Observers -------------------------------------------------------------------

void HistoryBackend::AddObserver(HistoryBackendObserver* observer) {}

void HistoryBackend::RemoveObserver(HistoryBackendObserver* observer) {}

// Downloads -------------------------------------------------------------------

uint32_t HistoryBackend::GetNextDownloadId() {}

// Get all the download entries from the database.
std::vector<DownloadRow> HistoryBackend::QueryDownloads() {}

// Update a particular download entry.
void HistoryBackend::UpdateDownload(const DownloadRow& data,
                                    bool should_commit_immediately) {}

bool HistoryBackend::CreateDownload(const DownloadRow& history_info) {}

void HistoryBackend::RemoveDownloads(const std::set<uint32_t>& ids) {}

QueryResults HistoryBackend::QueryHistory(const std::u16string& text_query,
                                          const QueryOptions& options) {}

// Basic time-based querying of history.
void HistoryBackend::QueryHistoryBasic(const QueryOptions& options,
                                       QueryResults* result) {}

// Text-based querying of history.
void HistoryBackend::QueryHistoryText(const std::u16string& text_query,
                                      const QueryOptions& options,
                                      QueryResults* result) {}

URLRows HistoryBackend::GetMatchesForHost(const std::u16string& host_name) {}

RedirectList HistoryBackend::QueryRedirectsFrom(const GURL& from_url) {}

RedirectList HistoryBackend::QueryRedirectsTo(const GURL& to_url) {}

VisibleVisitCountToHostResult HistoryBackend::GetVisibleVisitCountToHost(
    const GURL& url) {}

MostVisitedURLList HistoryBackend::QueryMostVisitedURLs(int result_count) {}

KeywordSearchTermVisitList HistoryBackend::QueryMostRepeatedQueriesForKeyword(
    KeywordID keyword_id,
    size_t result_count) {}

void HistoryBackend::GetRedirectsFromSpecificVisit(VisitID cur_visit,
                                                   RedirectList* redirects) {}

void HistoryBackend::GetRedirectsToSpecificVisit(VisitID cur_visit,
                                                 RedirectList* redirects) {}

void HistoryBackend::DeleteFTSIndexDatabases() {}

std::vector<favicon_base::FaviconRawBitmapResult> HistoryBackend::GetFavicon(
    const GURL& icon_url,
    favicon_base::IconType icon_type,
    const std::vector<int>& desired_sizes) {}

favicon_base::FaviconRawBitmapResult HistoryBackend::GetLargestFaviconForURL(
    const GURL& page_url,
    const std::vector<favicon_base::IconTypeSet>& icon_types_list,
    int minimum_size_in_pixels) {}

std::vector<favicon_base::FaviconRawBitmapResult>
HistoryBackend::GetFaviconsForURL(const GURL& page_url,
                                  const favicon_base::IconTypeSet& icon_types,
                                  const std::vector<int>& desired_sizes,
                                  bool fallback_to_host) {}

std::vector<favicon_base::FaviconRawBitmapResult>
HistoryBackend::GetFaviconForID(favicon_base::FaviconID favicon_id,
                                int desired_size) {}

std::vector<GURL> HistoryBackend::GetFaviconURLsForURL(const GURL& page_url) {}

std::vector<favicon_base::FaviconRawBitmapResult>
HistoryBackend::UpdateFaviconMappingsAndFetch(
    const base::flat_set<GURL>& page_urls,
    const GURL& icon_url,
    favicon_base::IconType icon_type,
    const std::vector<int>& desired_sizes) {}

void HistoryBackend::DeleteFaviconMappings(
    const base::flat_set<GURL>& page_urls,
    favicon_base::IconType icon_type) {}

void HistoryBackend::MergeFavicon(
    const GURL& page_url,
    const GURL& icon_url,
    favicon_base::IconType icon_type,
    scoped_refptr<base::RefCountedMemory> bitmap_data,
    const gfx::Size& pixel_size) {}

void HistoryBackend::SetFavicons(const base::flat_set<GURL>& page_urls,
                                 favicon_base::IconType icon_type,
                                 const GURL& icon_url,
                                 const std::vector<SkBitmap>& bitmaps) {}

void HistoryBackend::CloneFaviconMappingsForPages(
    const GURL& page_url_to_read,
    const favicon_base::IconTypeSet& icon_types,
    const base::flat_set<GURL>& page_urls_to_write) {}

bool HistoryBackend::CanSetOnDemandFavicons(const GURL& page_url,
                                            favicon_base::IconType icon_type) {}

bool HistoryBackend::SetOnDemandFavicons(const GURL& page_url,
                                         favicon_base::IconType icon_type,
                                         const GURL& icon_url,
                                         const std::vector<SkBitmap>& bitmaps) {}

void HistoryBackend::SetFaviconsOutOfDateForPage(const GURL& page_url) {}

void HistoryBackend::SetFaviconsOutOfDateBetween(base::Time begin,
                                                 base::Time end) {}

void HistoryBackend::TouchOnDemandFavicon(const GURL& icon_url) {}

void HistoryBackend::SetImportedFavicons(
    const favicon_base::FaviconUsageDataList& favicon_usage) {}

RedirectList HistoryBackend::GetCachedRecentRedirects(const GURL& page_url) {}

void HistoryBackend::SendFaviconChangedNotificationForPageAndRedirects(
    const GURL& page_url) {}

void HistoryBackend::SendFaviconChangedNotificationForIconURL(
    const GURL& icon_url) {}

void HistoryBackend::Commit() {}

void HistoryBackend::ScheduleCommit() {}

void HistoryBackend::CancelScheduledCommit() {}

void HistoryBackend::ProcessDBTaskImpl() {}

void HistoryBackend::BeginSingletonTransaction() {}

void HistoryBackend::CommitSingletonTransactionIfItExists() {}

////////////////////////////////////////////////////////////////////////////////
//
// Generic operations
//
////////////////////////////////////////////////////////////////////////////////

void HistoryBackend::DeleteURLs(const std::vector<GURL>& urls) {}

void HistoryBackend::DeleteURL(const GURL& url) {}

void HistoryBackend::DeleteURLsUntil(
    const std::vector<std::pair<GURL, base::Time>>& urls_and_timestamps) {}

void HistoryBackend::ExpireHistoryBetween(
    const std::set<GURL>& restrict_urls,
    std::optional<std::string> restrict_app_id,
    Time begin_time,
    Time end_time,
    bool user_initiated) {}

void HistoryBackend::ExpireHistoryForTimes(const std::set<base::Time>& times,
                                           base::Time begin_time,
                                           base::Time end_time) {}

void HistoryBackend::ExpireHistory(
    const std::vector<ExpireHistoryArgs>& expire_list) {}

void HistoryBackend::ExpireHistoryBeforeForTesting(base::Time end_time) {}

void HistoryBackend::URLsNoLongerBookmarked(const std::set<GURL>& urls) {}

void HistoryBackend::DatabaseErrorCallback(int error, sql::Statement* stmt) {}

void HistoryBackend::KillHistoryDatabase() {}

void HistoryBackend::SetSyncDeviceInfo(SyncDeviceInfoMap sync_device_info) {}

void HistoryBackend::SetLocalDeviceOriginatorCacheGuid(
    std::string local_device_originator_cache_guid) {}

void HistoryBackend::SetCanAddForeignVisitsToSegments(bool add_foreign_visits) {}

void HistoryBackend::ProcessDBTask(
    std::unique_ptr<HistoryDBTask> task,
    scoped_refptr<base::SequencedTaskRunner> origin_loop,
    const base::CancelableTaskTracker::IsCanceledCallback& is_canceled) {}

void HistoryBackend::RunDBTask(
    base::OnceCallback<void(HistoryBackend*, URLDatabase*)> callback) {}

void HistoryBackend::NotifyFaviconsChanged(const std::set<GURL>& page_urls,
                                           const GURL& icon_url) {}

void HistoryBackend::NotifyURLVisited(
    const URLRow& url_row,
    const VisitRow& visit_row,
    std::optional<int64_t> local_navigation_id) {}

void HistoryBackend::NotifyURLsModified(const URLRows& changed_urls,
                                        bool is_from_expiration) {}

void HistoryBackend::NotifyDeletions(DeletionInfo deletion_info) {}

void HistoryBackend::NotifyVisitUpdated(const VisitRow& visit,
                                        VisitUpdateReason reason) {}

void HistoryBackend::NotifyVisitsDeleted(
    const std::vector<DeletedVisit>& visits) {}

// Deleting --------------------------------------------------------------------

void HistoryBackend::DeleteAllHistory() {}

bool HistoryBackend::ClearAllFaviconHistory(
    const std::vector<GURL>& kept_urls) {}

void HistoryBackend::ClearAllOnDemandFavicons() {}

bool HistoryBackend::ClearAllMainHistory(const URLRows& kept_urls) {}

std::vector<GURL> HistoryBackend::GetCachedRecentRedirectsForPage(
    const GURL& page_url) {}

bool HistoryBackend::ProcessSetFaviconsResult(
    const favicon::SetFaviconsResult& result,
    const GURL& icon_url) {}

void HistoryBackend::StartDeletingForeignVisits() {}

}  // namespace history