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

// Copyright 2016 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/browsing_history_service.h"

#include <stddef.h>

#include <algorithm>
#include <map>
#include <string>
#include <utility>

#include "base/check.h"
#include "base/functional/bind.h"
#include "base/functional/callback_helpers.h"
#include "base/metrics/histogram_macros.h"
#include "base/notreached.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/utf_string_conversions.h"
#include "base/time/default_clock.h"
#include "base/time/time.h"
#include "base/types/optional_ref.h"
#include "base/values.h"
#include "components/history/core/browser/browsing_history_driver.h"
#include "components/history/core/browser/history_types.h"
#include "components/keyed_service/core/service_access_type.h"
#include "components/sync/protocol/history_delete_directive_specifics.pb.h"

namespace history {

namespace {

// The amount of time to wait for a response from the WebHistoryService.
constexpr int kWebHistoryTimeoutSeconds =;

// Buckets for UMA histograms.
enum WebHistoryQueryBuckets {};

QueryOptions OptionsWithEndTime(QueryOptions original_options,
                                base::Time end_time) {}

// The status of the result from a particular history source.
enum QuerySourceStatus {};

bool CanRetry(QuerySourceStatus status) {}

base::Time OldestTime(
    const std::vector<BrowsingHistoryService::HistoryEntry>& entries) {}

}  // namespace

struct BrowsingHistoryService::QueryHistoryState
    : public base::RefCounted<BrowsingHistoryService::QueryHistoryState> {};

BrowsingHistoryService::HistoryEntry::HistoryEntry(
    BrowsingHistoryService::HistoryEntry::EntryType entry_type,
    const GURL& url,
    const std::u16string& title,
    base::Time time,
    const std::string& client_id,
    bool is_search_result,
    const std::u16string& snippet,
    bool blocked_visit,
    const GURL& remote_icon_url_for_uma,
    int visit_count,
    int typed_count,
    std::optional<std::string> app_id)
    :{}

BrowsingHistoryService::HistoryEntry::HistoryEntry()
    :{}

BrowsingHistoryService::HistoryEntry::HistoryEntry(const HistoryEntry& other) =
    default;

BrowsingHistoryService::HistoryEntry::~HistoryEntry() {}

bool BrowsingHistoryService::HistoryEntry::SortByTimeDescending(
    const BrowsingHistoryService::HistoryEntry& entry1,
    const BrowsingHistoryService::HistoryEntry& entry2) {}

BrowsingHistoryService::QueryResultsInfo::~QueryResultsInfo() = default;

BrowsingHistoryService::BrowsingHistoryService(
    BrowsingHistoryDriver* driver,
    HistoryService* local_history,
    syncer::SyncService* sync_service)
    :{}

BrowsingHistoryService::BrowsingHistoryService(
    BrowsingHistoryDriver* driver,
    HistoryService* local_history,
    syncer::SyncService* sync_service,
    std::unique_ptr<base::OneShotTimer> web_history_timer)
    :{}

BrowsingHistoryService::BrowsingHistoryService() = default;

BrowsingHistoryService::~BrowsingHistoryService() {}

void BrowsingHistoryService::OnStateChanged(syncer::SyncService* sync) {}

void BrowsingHistoryService::OnSyncShutdown(syncer::SyncService* sync) {}

void BrowsingHistoryService::WebHistoryTimeout(
    scoped_refptr<QueryHistoryState> state) {}

void BrowsingHistoryService::QueryHistory(const std::u16string& search_text,
                                          const QueryOptions& options) {}

void BrowsingHistoryService::QueryHistoryInternal(
    scoped_refptr<QueryHistoryState> state) {}

void BrowsingHistoryService::GetAllAppIds() {}

void BrowsingHistoryService::GetLastVisitToHostBeforeRecentNavigations(
    const std::string& host_name,
    base::OnceCallback<void(base::Time)> callback) {}

void BrowsingHistoryService::OnLastVisitBeforeRecentNavigationsComplete(
    const std::string& host_name,
    base::Time query_start_time,
    base::OnceCallback<void(base::Time)> callback,
    HistoryLastVisitResult result) {}

void BrowsingHistoryService::OnLastVisitBeforeRecentNavigationsComplete2(
    base::OnceCallback<void(base::Time)> callback,
    HistoryLastVisitResult result) {}

void BrowsingHistoryService::RemoveVisits(
    const std::vector<BrowsingHistoryService::HistoryEntry>& items) {}

// static
void BrowsingHistoryService::MergeDuplicateResults(
    QueryHistoryState* state,
    std::vector<HistoryEntry>* results) {}

void BrowsingHistoryService::QueryComplete(
    scoped_refptr<QueryHistoryState> state,
    QueryResults results) {}

void BrowsingHistoryService::OnGetAllAppIds(GetAllAppIdsResult result) {}

void BrowsingHistoryService::ReturnResultsToDriver(
    scoped_refptr<QueryHistoryState> state) {}

void BrowsingHistoryService::WebHistoryQueryComplete(
    scoped_refptr<QueryHistoryState> state,
    base::Time start_time,
    WebHistoryService::Request* request,
    base::optional_ref<const base::Value::Dict> results_dict) {}

void BrowsingHistoryService::OtherFormsOfBrowsingHistoryQueryComplete(
    bool found_other_forms_of_browsing_history) {}

void BrowsingHistoryService::RemoveComplete() {}

void BrowsingHistoryService::RemoveWebHistoryComplete(bool success) {}

// Helper function for Observe that determines if there are any differences
// between the URLs noticed for deletion and the ones we are expecting.
static bool DeletionsDiffer(const URLRows& deleted_rows,
                            const std::set<GURL>& urls_to_be_deleted) {}

void BrowsingHistoryService::OnHistoryDeletions(
    HistoryService* history_service,
    const DeletionInfo& deletion_info) {}

void BrowsingHistoryService::OnWebHistoryDeleted() {}

}  // namespace history