diff options
author | chron@google.com <chron@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-11-25 21:39:12 +0000 |
---|---|---|
committer | chron@google.com <chron@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-11-25 21:39:12 +0000 |
commit | 8938e4e53180b3892d5e853578d5333070c40cb2 (patch) | |
tree | 4b032712ea535d7fd8a78a6fa791bfbbb3dbe617 /chrome | |
parent | e77cda08c5c8647ed457ccaebf2eaa58eab8fca2 (diff) | |
download | chromium_src-8938e4e53180b3892d5e853578d5333070c40cb2.zip chromium_src-8938e4e53180b3892d5e853578d5333070c40cb2.tar.gz chromium_src-8938e4e53180b3892d5e853578d5333070c40cb2.tar.bz2 |
Fix some minor things that were in the unique naming CL that I forgot to address.
Review URL: http://codereview.chromium.org/435026
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@33127 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
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); |