#include "components/sync/engine/syncer.h"
#include <memory>
#include <string>
#include "base/auto_reset.h"
#include "base/logging.h"
#include "base/metrics/histogram_functions.h"
#include "base/notreached.h"
#include "base/trace_event/trace_event.h"
#include "components/sync/base/data_type.h"
#include "components/sync/base/features.h"
#include "components/sync/engine/active_devices_invalidation_info.h"
#include "components/sync/engine/cancelation_signal.h"
#include "components/sync/engine/commit.h"
#include "components/sync/engine/commit_processor.h"
#include "components/sync/engine/cycle/nudge_tracker.h"
#include "components/sync/engine/cycle/sync_cycle.h"
#include "components/sync/engine/get_updates_delegate.h"
#include "components/sync/engine/get_updates_processor.h"
#include "components/sync/engine/sync_protocol_error.h"
#include "components/sync/engine/syncer_error.h"
#include "components/sync/protocol/sync_enums.pb.h"
#include "net/http/http_status_code.h"
namespace syncer {
namespace {
SyncerErrorValueForUma GetSyncerErrorValueForUma(
SyncProtocolErrorType protocol_error) { … }
SyncerErrorValueForUma GetSyncerErrorValueForUma(const SyncerError& error) { … }
ActiveDevicesInvalidationInfo GetInvalidationInfo(const SyncCycle* cycle) { … }
void HandleCycleBegin(SyncCycle* cycle) { … }
}
Syncer::Syncer(CancelationSignal* cancelation_signal)
: … { … }
Syncer::~Syncer() = default;
bool Syncer::IsSyncing() const { … }
bool Syncer::NormalSyncShare(DataTypeSet request_types,
NudgeTracker* nudge_tracker,
SyncCycle* cycle) { … }
bool Syncer::ConfigureSyncShare(const DataTypeSet& request_types,
sync_pb::SyncEnums::GetUpdatesOrigin origin,
SyncCycle* cycle) { … }
bool Syncer::PollSyncShare(DataTypeSet request_types, SyncCycle* cycle) { … }
bool Syncer::DownloadAndApplyUpdates(DataTypeSet* request_types,
SyncCycle* cycle,
const GetUpdatesDelegate& delegate) { … }
SyncerError Syncer::BuildAndPostCommits(const DataTypeSet& request_types,
NudgeTracker* nudge_tracker,
SyncCycle* cycle) { … }
bool Syncer::ExitRequested() { … }
bool Syncer::HandleCycleEnd(SyncCycle* cycle,
sync_pb::SyncEnums::GetUpdatesOrigin origin) { … }
}