summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xchrome/browser/sync/engine/process_commit_response_command.cc2
-rwxr-xr-xchrome/browser/sync/engine/process_updates_command.cc6
-rwxr-xr-xchrome/browser/sync/engine/syncer_proto_util.cc4
-rwxr-xr-xchrome/browser/sync/engine/syncer_proto_util.h4
-rwxr-xr-xchrome/browser/sync/engine/syncer_unittest.cc3
5 files changed, 11 insertions, 8 deletions
diff --git a/chrome/browser/sync/engine/process_commit_response_command.cc b/chrome/browser/sync/engine/process_commit_response_command.cc
index 46fc136..ac05cfa 100755
--- a/chrome/browser/sync/engine/process_commit_response_command.cc
+++ b/chrome/browser/sync/engine/process_commit_response_command.cc
@@ -127,7 +127,7 @@ void ProcessCommitResponseCommand::ProcessCommitResponse(
break;
case CommitResponse::CONFLICT:
++conflicting_commits;
- // This is important to activate conflict resolution.
+ // Only server CONFLICT responses will activate conflict resolution.
conflict_progress->AddConflictingItemById(commit_ids[i]);
break;
case CommitResponse::SUCCESS:
diff --git a/chrome/browser/sync/engine/process_updates_command.cc b/chrome/browser/sync/engine/process_updates_command.cc
index cb98368..0f89442 100755
--- a/chrome/browser/sync/engine/process_updates_command.cc
+++ b/chrome/browser/sync/engine/process_updates_command.cc
@@ -160,8 +160,10 @@ ServerUpdateProcessingResult ProcessUpdatesCommand::ProcessUpdate(
if (update_entry.Get(SERVER_VERSION) == update_entry.Get(BASE_VERSION) &&
!update_entry.Get(IS_UNSYNCED)) {
- // Previously this was a big issue but at this point we don't really care
- // that much if things don't match up exactly.
+ // It's largely OK if data doesn't match exactly since a future update
+ // will just clobber the data. Conflict resolution will overwrite and
+ // take one side as the winner and does not try to merge, so strict
+ // equality isn't necessary.
LOG_IF(ERROR, !SyncerUtil::ServerAndLocalEntriesMatch(&update_entry))
<< update_entry;
}
diff --git a/chrome/browser/sync/engine/syncer_proto_util.cc b/chrome/browser/sync/engine/syncer_proto_util.cc
index 89d3908..41678bf 100755
--- a/chrome/browser/sync/engine/syncer_proto_util.cc
+++ b/chrome/browser/sync/engine/syncer_proto_util.cc
@@ -238,7 +238,7 @@ void SyncerProtoUtil::CopyBlobIntoProtoBytes(const syncable::Blob& blob,
}
// static
-std::string SyncerProtoUtil::NameFromSyncEntity(
+const std::string& SyncerProtoUtil::NameFromSyncEntity(
const SyncEntity& entry) {
if (entry.has_non_unique_name()) {
@@ -249,7 +249,7 @@ std::string SyncerProtoUtil::NameFromSyncEntity(
}
// static
-std::string SyncerProtoUtil::NameFromCommitEntryResponse(
+const std::string& SyncerProtoUtil::NameFromCommitEntryResponse(
const CommitResponse_EntryResponse& entry) {
if (entry.has_non_unique_name()) {
diff --git a/chrome/browser/sync/engine/syncer_proto_util.h b/chrome/browser/sync/engine/syncer_proto_util.h
index fe20fef..4dbf0cf 100755
--- a/chrome/browser/sync/engine/syncer_proto_util.h
+++ b/chrome/browser/sync/engine/syncer_proto_util.h
@@ -60,11 +60,11 @@ class SyncerProtoUtil {
std::string* proto_bytes);
// Extract the name field from a sync entity.
- static std::string NameFromSyncEntity(const SyncEntity& entry);
+ static const std::string& NameFromSyncEntity(const SyncEntity& entry);
// Extract the name field from a commit entry response.
- static std::string NameFromCommitEntryResponse(
+ static const std::string& NameFromCommitEntryResponse(
const CommitResponse_EntryResponse& entry);
private:
diff --git a/chrome/browser/sync/engine/syncer_unittest.cc b/chrome/browser/sync/engine/syncer_unittest.cc
index 838172c..f22b92a 100755
--- a/chrome/browser/sync/engine/syncer_unittest.cc
+++ b/chrome/browser/sync/engine/syncer_unittest.cc
@@ -817,7 +817,8 @@ TEST_F(SyncerTest, TestCommitListOrderingAndNewParent) {
{
WriteTransaction wtrans(dir, UNITTEST, __FILE__, __LINE__);
- MutableEntry parent(&wtrans, syncable::CREATE, wtrans.root_id(), parent1_name);
+ MutableEntry parent(&wtrans, syncable::CREATE, wtrans.root_id(),
+ parent1_name);
ASSERT_TRUE(parent.good());
parent.Put(syncable::IS_UNSYNCED, true);
parent.Put(syncable::IS_DIR, true);