chromium/components/history/core/browser/sync/delete_directive_handler.cc

// Copyright 2013 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/sync/delete_directive_handler.h"

#include <stddef.h>

#include <map>
#include <string>
#include <utility>
#include <vector>

#include "base/json/json_writer.h"
#include "base/logging.h"
#include "base/rand_util.h"
#include "base/ranges/algorithm.h"
#include "base/time/time.h"
#include "base/values.h"
#include "components/history/core/browser/history_backend.h"
#include "components/history/core/browser/history_db_task.h"
#include "components/sync/model/sync_change.h"
#include "components/sync/protocol/entity_specifics.pb.h"
#include "components/sync/protocol/history_delete_directive_specifics.pb.h"
#include "components/sync/protocol/proto_value_conversions.h"

namespace {

std::string RandASCIIString(size_t length) {}

std::string DeleteDirectiveToString(
    const sync_pb::HistoryDeleteDirectiveSpecifics& delete_directive) {}

// Compare time range directives first by start time, then by end time.
bool TimeRangeLessThan(const syncer::SyncData& data1,
                       const syncer::SyncData& data2) {}

// Converts a Unix timestamp in microseconds to a base::Time value.
base::Time UnixUsecToTime(int64_t usec) {}

// Converts a base::Time value to a Unix timestamp in microseconds.
int64_t TimeToUnixUsec(base::Time time) {}

// Converts global IDs in `global_id_directive` to times.
void GetTimesFromGlobalIds(
    const sync_pb::GlobalIdDirective& global_id_directive,
    std::set<base::Time>* times) {}

#if !defined(NDEBUG)
// Checks that the given delete directive is properly formed.
void CheckDeleteDirectiveValid(
    const sync_pb::HistoryDeleteDirectiveSpecifics& delete_directive) {}
#endif  // !defined(NDEBUG)

}  // anonymous namespace

namespace history {

class DeleteDirectiveHandler::DeleteDirectiveTask : public HistoryDBTask {};

bool DeleteDirectiveHandler::DeleteDirectiveTask::RunOnDBThread(
    HistoryBackend* backend,
    HistoryDatabase* db) {}

void DeleteDirectiveHandler::DeleteDirectiveTask::DoneRunOnMainThread() {}

void DeleteDirectiveHandler::DeleteDirectiveTask::
    ProcessGlobalIdDeleteDirectives(
        HistoryBackend* history_backend,
        const syncer::SyncDataList& global_id_directives) {}

void DeleteDirectiveHandler::DeleteDirectiveTask::
    ProcessTimeRangeDeleteDirectives(
        HistoryBackend* history_backend,
        const syncer::SyncDataList& time_range_directives) {}

void DeleteDirectiveHandler::DeleteDirectiveTask::
    ProcessTimeRangeDeleteDirectivesByApp(
        HistoryBackend* history_backend,
        std::optional<std::string> restrict_app_id,
        const syncer::SyncDataList& time_range_directives) {}

void DeleteDirectiveHandler::DeleteDirectiveTask::ProcessUrlDeleteDirectives(
    HistoryBackend* history_backend,
    const syncer::SyncDataList& url_directives) {}

DeleteDirectiveHandler::DeleteDirectiveHandler(
    BackendTaskScheduler backend_task_scheduler)
    :{}

DeleteDirectiveHandler::~DeleteDirectiveHandler() = default;

void DeleteDirectiveHandler::OnBackendLoaded() {}

bool DeleteDirectiveHandler::CreateTimeRangeDeleteDirective(
    base::Time begin_time,
    base::Time end_time) {}

bool DeleteDirectiveHandler::CreateUrlDeleteDirective(const GURL& url) {}

std::optional<syncer::ModelError>
DeleteDirectiveHandler::ProcessLocalDeleteDirective(
    const sync_pb::HistoryDeleteDirectiveSpecifics& delete_directive) {}

void DeleteDirectiveHandler::WaitUntilReadyToSync(base::OnceClosure done) {}

std::optional<syncer::ModelError>
DeleteDirectiveHandler::MergeDataAndStartSyncing(
    syncer::DataType type,
    const syncer::SyncDataList& initial_sync_data,
    std::unique_ptr<syncer::SyncChangeProcessor> sync_processor) {}

void DeleteDirectiveHandler::StopSyncing(syncer::DataType type) {}

std::optional<syncer::ModelError> DeleteDirectiveHandler::ProcessSyncChanges(
    const base::Location& from_here,
    const syncer::SyncChangeList& change_list) {}

base::WeakPtr<syncer::SyncableService> DeleteDirectiveHandler::AsWeakPtr() {}

void DeleteDirectiveHandler::FinishProcessing(
    PostProcessingAction post_processing_action,
    const syncer::SyncDataList& delete_directives) {}

}  // namespace history