RemoteToLocalSyncer::RemoteToLocalSyncer(SyncEngineContext* sync_context)
: sync_context_(sync_context),
+ file_type_(SYNC_FILE_TYPE_UNKNOWN),
sync_action_(SYNC_ACTION_NONE),
prepared_(false),
sync_root_deletion_(false),
// Check if the local file exists.
if (local_metadata_->file_type == SYNC_FILE_TYPE_UNKNOWN ||
(!local_changes_->empty() && local_changes_->back().IsDelete())) {
+ file_type_ = SYNC_FILE_TYPE_FILE;
sync_action_ = SYNC_ACTION_ADDED;
// Missing local file case.
// Download the file and add it to local as a new file.
DCHECK(local_changes_->empty() || local_changes_->back().IsAddOrUpdate());
if (local_changes_->empty()) {
if (local_metadata_->file_type == SYNC_FILE_TYPE_FILE) {
+ file_type_ = SYNC_FILE_TYPE_FILE;
sync_action_ = SYNC_ACTION_UPDATED;
// Download the file and overwrite the existing local file.
DownloadFile(token.Pass());
// Check if the local file exists.
if (local_metadata_->file_type == SYNC_FILE_TYPE_UNKNOWN ||
(!local_changes_->empty() && local_changes_->back().IsDelete())) {
+ file_type_ = SYNC_FILE_TYPE_DIRECTORY;
sync_action_ = SYNC_ACTION_ADDED;
// No local file exists at the path.
CreateFolder(token.Pass());
}
DCHECK_EQ(SYNC_FILE_TYPE_FILE, local_metadata_->file_type);
+ file_type_ = SYNC_FILE_TYPE_DIRECTORY;
sync_action_ = SYNC_ACTION_ADDED;
// Got a remote folder for existing local file.
// Our policy prioritize folders in this case.
DCHECK(local_changes_->empty() || local_changes_->back().IsAddOrUpdate());
if (local_changes_->empty()) {
+ file_type_ = local_metadata_->file_type;
sync_action_ = SYNC_ACTION_DELETED;
DeleteLocalFile(token.Pass());
return;