chromium/components/history/core/browser/visited_link_database.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 COMPONENTS_HISTORY_CORE_BROWSER_VISITED_LINK_DATABASE_H_
#define COMPONENTS_HISTORY_CORE_BROWSER_VISITED_LINK_DATABASE_H_

#include "components/history/core/browser/history_types.h"
#include "components/history/core/browser/url_row.h"
#include "sql/statement.h"

class GURL;

namespace sql {
class Database;
}

namespace history {

// A SQLite database that holds triple-key partitioned :visited links
// history info. It is independent from the currently unpartitioned
// VisitedLinks hash table. VisitedLinksWriter should NEVER alter this database.
// In the future, it will provide the necessary state to rebuild the partitioned
// VisitedLinks hash table in the event of corruption and to delete specific
// partition keys from the hash table.
//
// This is a subset of the full history data. It has a one to many relationship
// with the VisitDatabase, i.e. the VisitedLinkDatabase will only
// contain one row for N visits to the url, top-level url, and frame url
// found in the partition key. It has a many to one relationship with the
// URLDatabase, i.e. the VisitedLinkDatabase may contain N rows
// for each URL, as a URL can be visited from many different top-level urls or
// frame urls. Only link urls which can be attributed to a top-level url and
// frame url will be stored as entries in this database (i.e. link clicks
// and scripted navigations).
class VisitedLinkDatabase {};

}  // namespace history

#endif  // COMPONENTS_HISTORY_CORE_BROWSER_VISITED_LINK_DATABASE_H_