Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(137)

Unified Diff: chrome/browser/sync/engine/syncer_proto_util.cc

Issue 371029: Remove unique naming. (Closed)
Patch Set: Ready and about to go in! Created 11 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/sync/engine/syncer_proto_util.cc
diff --git a/chrome/browser/sync/engine/syncer_proto_util.cc b/chrome/browser/sync/engine/syncer_proto_util.cc
old mode 100644
new mode 100755
index 5767d20c0e5ffa214a54757ee67425eb26b6a957..75b668931e7143d3e887ef7b7c00a00f706a4694
--- a/chrome/browser/sync/engine/syncer_proto_util.cc
+++ b/chrome/browser/sync/engine/syncer_proto_util.cc
@@ -167,7 +167,7 @@ bool SyncerProtoUtil::PostClientToServerMessage(ClientToServerMessage* msg,
// static
bool SyncerProtoUtil::Compare(const syncable::Entry& local_entry,
const SyncEntity& server_entry) {
- SyncName name = NameFromSyncEntity(server_entry);
+ const std::string name = NameFromSyncEntity(server_entry);
CHECK(local_entry.Get(ID) == server_entry.id()) <<
" SyncerProtoUtil::Compare precondition not met.";
@@ -185,7 +185,7 @@ bool SyncerProtoUtil::Compare(const syncable::Entry& local_entry,
// These checks are somewhat prolix, but they're easier to debug than a big
// boolean statement.
- SyncName client_name = local_entry.GetName();
+ PathString client_name = local_entry.Get(syncable::NON_UNIQUE_NAME);
if (client_name != name) {
LOG(WARNING) << "Client name mismatch";
return false;
@@ -235,23 +235,25 @@ void SyncerProtoUtil::CopyBlobIntoProtoBytes(const syncable::Blob& blob,
}
// static
-syncable::SyncName SyncerProtoUtil::NameFromSyncEntity(
+std::string SyncerProtoUtil::NameFromSyncEntity(
const SyncEntity& entry) {
- SyncName result(entry.name());
+
if (entry.has_non_unique_name()) {
- result.set_non_unique_value(entry.non_unique_name());
+ return entry.non_unique_name();
}
- return result;
+
+ return entry.name();
}
// static
-syncable::SyncName SyncerProtoUtil::NameFromCommitEntryResponse(
+std::string SyncerProtoUtil::NameFromCommitEntryResponse(
const CommitResponse_EntryResponse& entry) {
- SyncName result(entry.name());
+
if (entry.has_non_unique_name()) {
- result.set_non_unique_value(entry.non_unique_name());
+ return entry.non_unique_name();
}
- return result;
+
+ return entry.name();
}
} // namespace browser_sync
« no previous file with comments | « chrome/browser/sync/engine/syncer_proto_util.h ('k') | chrome/browser/sync/engine/syncer_proto_util_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698