#include "components/sync/engine/get_updates_processor.h"
#include <stddef.h>
#include <map>
#include <string>
#include <utility>
#include <vector>
#include "base/logging.h"
#include "base/not_fatal_until.h"
#include "base/trace_event/trace_event.h"
#include "components/sync/engine/cycle/status_controller.h"
#include "components/sync/engine/cycle/sync_cycle.h"
#include "components/sync/engine/events/get_updates_response_event.h"
#include "components/sync/engine/get_updates_delegate.h"
#include "components/sync/engine/nigori/keystore_keys_handler.h"
#include "components/sync/engine/syncer_proto_util.h"
#include "components/sync/engine/update_handler.h"
#include "components/sync/protocol/data_type_progress_marker.pb.h"
#include "components/sync/protocol/sync.pb.h"
#include "components/sync/protocol/sync_entity.pb.h"
#include "net/http/http_status_code.h"
#include "third_party/protobuf/src/google/protobuf/repeated_field.h"
namespace syncer {
namespace {
SyncEntityList;
TypeSyncEntityMap;
TypeToIndexMap;
bool ShouldRequestEncryptionKey(SyncCycleContext* context) { … }
std::vector<std::vector<uint8_t>> ExtractKeystoreKeys(
const sync_pb::ClientToServerResponse& update_response) { … }
bool HandleGetEncryptionKeyResponse(
const sync_pb::ClientToServerResponse& update_response,
SyncCycleContext* context) { … }
void PartitionUpdatesByType(const sync_pb::GetUpdatesResponse& gu_response,
DataTypeSet requested_types,
TypeSyncEntityMap* updates_by_type) { … }
void PartitionProgressMarkersByType(
const sync_pb::GetUpdatesResponse& gu_response,
const DataTypeSet& request_types,
TypeToIndexMap* index_map) { … }
void PartitionContextMutationsByType(
const sync_pb::GetUpdatesResponse& gu_response,
const DataTypeSet& request_types,
TypeToIndexMap* index_map) { … }
void InitDownloadUpdatesContext(SyncCycle* cycle,
sync_pb::ClientToServerMessage* message) { … }
}
GetUpdatesProcessor::GetUpdatesProcessor(UpdateHandlerMap* update_handler_map,
const GetUpdatesDelegate& delegate)
: … { … }
GetUpdatesProcessor::~GetUpdatesProcessor() = default;
SyncerError GetUpdatesProcessor::DownloadUpdates(DataTypeSet* request_types,
SyncCycle* cycle) { … }
void GetUpdatesProcessor::PrepareGetUpdates(
const DataTypeSet& gu_types,
sync_pb::ClientToServerMessage* message) { … }
SyncerError GetUpdatesProcessor::ExecuteDownloadUpdates(
DataTypeSet* request_types,
SyncCycle* cycle,
sync_pb::ClientToServerMessage* msg) { … }
SyncerError GetUpdatesProcessor::ProcessResponse(
const sync_pb::GetUpdatesResponse& gu_response,
const DataTypeSet& gu_types,
StatusController* status_controller) { … }
void GetUpdatesProcessor::ApplyUpdates(const DataTypeSet& gu_types,
StatusController* status_controller) { … }
bool GetUpdatesProcessor::HasMoreUpdatesToDownload() const { … }
}