#include "components/history/content/browser/content_visit_delegate.h"
#include <utility>
#include "base/check.h"
#include "base/memory/ref_counted.h"
#include "components/history/core/browser/history_backend.h"
#include "components/history/core/browser/history_database.h"
#include "components/history/core/browser/history_db_task.h"
#include "components/history/core/browser/history_service.h"
#include "components/visitedlink/browser/partitioned_visitedlink_writer.h"
#include "components/visitedlink/browser/visitedlink_writer.h"
#include "components/visitedlink/core/visited_link.h"
#include "net/base/schemeful_site.h"
#include "third_party/blink/public/common/features.h"
#include "url/gurl.h"
namespace history {
namespace {
class URLIteratorFromURLs : public visitedlink::VisitedLinkWriter::URLIterator { … };
class VisitedLinkIteratorFromLinks
: public visitedlink::PartitionedVisitedLinkWriter::VisitedLinkIterator { … };
class IterateUrlsDBTask : public HistoryDBTask { … };
IterateUrlsDBTask::IterateUrlsDBTask(const scoped_refptr<
visitedlink::VisitedLinkDelegate::URLEnumerator>& enumerator)
: … { … }
IterateUrlsDBTask::~IterateUrlsDBTask() { … }
bool IterateUrlsDBTask::RunOnDBThread(HistoryBackend* backend,
HistoryDatabase* db) { … }
void IterateUrlsDBTask::DoneRunOnMainThread() { … }
class IterateVisitedLinkDBTask : public HistoryDBTask { … };
IterateVisitedLinkDBTask::IterateVisitedLinkDBTask(
const scoped_refptr<
visitedlink::VisitedLinkDelegate::VisitedLinkEnumerator>& enumerator)
: … { … }
IterateVisitedLinkDBTask::~IterateVisitedLinkDBTask() = default;
bool IterateVisitedLinkDBTask::RunOnDBThread(HistoryBackend* backend,
HistoryDatabase* db) { … }
void IterateVisitedLinkDBTask::DoneRunOnMainThread() { … }
}
ContentVisitDelegate::ContentVisitDelegate(
content::BrowserContext* browser_context)
: … { … }
ContentVisitDelegate::~ContentVisitDelegate() { … }
bool ContentVisitDelegate::Init(HistoryService* history_service) { … }
void ContentVisitDelegate::AddURL(const GURL& url) { … }
void ContentVisitDelegate::AddURLs(const std::vector<GURL>& urls) { … }
void ContentVisitDelegate::DeleteURLs(const std::vector<GURL>& urls) { … }
void ContentVisitDelegate::DeleteAllURLs() { … }
void ContentVisitDelegate::AddVisitedLink(const VisitedLink& link) { … }
void ContentVisitDelegate::DeleteVisitedLinks(
const std::vector<VisitedLink>& links) { … }
void ContentVisitDelegate::DeleteAllVisitedLinks() { … }
std::optional<uint64_t> ContentVisitDelegate::GetOrAddOriginSalt(
const url::Origin& origin) { … }
void ContentVisitDelegate::RebuildTable(
const scoped_refptr<URLEnumerator>& enumerator) { … }
void ContentVisitDelegate::BuildVisitedLinkTable(
const scoped_refptr<VisitedLinkEnumerator>& enumerator) { … }
}