This source file includes following definitions.
- IgnoreLocalChanges
- OverwriteServerChanges
- IgnoreConflict
#include "sync/engine/conflict_util.h"
#include "sync/syncable/mutable_entry.h"
namespace syncer {
using syncable::BASE_VERSION;
using syncable::IS_UNAPPLIED_UPDATE;
using syncable::IS_UNSYNCED;
using syncable::SERVER_VERSION;
using syncable::MutableEntry;
namespace conflict_util {
void IgnoreLocalChanges(MutableEntry* entry) {
DCHECK(entry->GetIsUnsynced());
DCHECK(entry->GetIsUnappliedUpdate());
entry->PutIsUnsynced(false);
}
void OverwriteServerChanges(MutableEntry* entry) {
DCHECK(entry->GetIsUnsynced());
DCHECK(entry->GetIsUnappliedUpdate());
entry->PutBaseVersion(entry->GetServerVersion());
entry->PutIsUnappliedUpdate(false);
}
void IgnoreConflict(MutableEntry* entry) {
DCHECK(entry->GetIsUnsynced());
DCHECK(entry->GetIsUnappliedUpdate());
entry->PutBaseVersion(entry->GetServerVersion());
entry->PutIsUnappliedUpdate(false);
entry->PutIsUnsynced(false);
}
}
}