#include "components/omnibox/browser/in_memory_url_index.h"
#include <cinttypes>
#include <memory>
#include "base/feature_list.h"
#include "base/files/file_util.h"
#include "base/functional/bind.h"
#include "base/metrics/histogram_macros.h"
#include "base/no_destructor.h"
#include "base/strings/stringprintf.h"
#include "base/task/single_thread_task_runner.h"
#include "base/task/thread_pool.h"
#include "base/trace_event/memory_dump_manager.h"
#include "base/trace_event/memory_usage_estimator.h"
#include "base/trace_event/trace_event.h"
#include "build/build_config.h"
#include "components/history/core/browser/history_service.h"
#include "components/history/core/browser/url_database.h"
#include "components/keep_alive_registry/keep_alive_registry.h"
#include "components/omnibox/browser/omnibox_triggered_feature_service.h"
#include "components/omnibox/browser/url_index_private_data.h"
#include "components/omnibox/common/omnibox_features.h"
void InitializeSchemeAllowlist(SchemeSet* allowlist,
const SchemeSet& client_schemes_to_allowlist) { … }
InMemoryURLIndex::RebuildPrivateDataFromHistoryDBTask::
RebuildPrivateDataFromHistoryDBTask(InMemoryURLIndex* index,
const SchemeSet& scheme_allowlist)
: … { … }
bool InMemoryURLIndex::RebuildPrivateDataFromHistoryDBTask::RunOnDBThread(
history::HistoryBackend* backend,
history::HistoryDatabase* db) { … }
void InMemoryURLIndex::RebuildPrivateDataFromHistoryDBTask::
DoneRunOnMainThread() { … }
InMemoryURLIndex::RebuildPrivateDataFromHistoryDBTask::
~RebuildPrivateDataFromHistoryDBTask() = default;
InMemoryURLIndex::InMemoryURLIndex(bookmarks::BookmarkModel* bookmark_model,
history::HistoryService* history_service,
TemplateURLService* template_url_service,
const base::FilePath& history_dir,
const SchemeSet& client_schemes_to_allowlist)
: … { … }
InMemoryURLIndex::~InMemoryURLIndex() { … }
void InMemoryURLIndex::Init() { … }
void InMemoryURLIndex::ClearPrivateData() { … }
ScoredHistoryMatches InMemoryURLIndex::HistoryItemsForTerms(
const std::u16string& term_string,
size_t cursor_position,
const std::string& host_filter,
size_t max_matches,
OmniboxTriggeredFeatureService* triggered_feature_service) { … }
const std::vector<std::string>& InMemoryURLIndex::HighlyVisitedHosts() const { … }
void InMemoryURLIndex::DeleteURL(const GURL& url) { … }
void InMemoryURLIndex::OnURLVisited(history::HistoryService* history_service,
const history::URLRow& url_row,
const history::VisitRow& new_visit) { … }
void InMemoryURLIndex::OnURLsModified(history::HistoryService* history_service,
const history::URLRows& changed_urls) { … }
void InMemoryURLIndex::OnHistoryDeletions(
history::HistoryService* history_service,
const history::DeletionInfo& deletion_info) { … }
bool InMemoryURLIndex::OnMemoryDump(
const base::trace_event::MemoryDumpArgs& args,
base::trace_event::ProcessMemoryDump* process_memory_dump) { … }
void InMemoryURLIndex::Shutdown() { … }
void InMemoryURLIndex::DoneRebuildingPrivateDataFromHistoryDB(
bool succeeded,
scoped_refptr<URLIndexPrivateData> private_data) { … }