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

Unified Diff: trunk/src/sync/engine/syncer_util.cc

Issue 270543005: Revert 270308 "sync: Improve handling of bad UniquePositions" (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 6 years, 7 months 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
« no previous file with comments | « trunk/src/sync/engine/syncer_util.h ('k') | trunk/src/sync/engine/syncer_util_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: trunk/src/sync/engine/syncer_util.cc
===================================================================
--- trunk/src/sync/engine/syncer_util.cc (revision 270321)
+++ trunk/src/sync/engine/syncer_util.cc (working copy)
@@ -12,7 +12,6 @@
#include "base/base64.h"
#include "base/location.h"
#include "base/metrics/histogram.h"
-#include "base/rand_util.h"
#include "base/strings/string_number_conversions.h"
#include "sync/engine/conflict_resolver.h"
#include "sync/engine/syncer_proto_util.h"
@@ -279,9 +278,7 @@
std::string GetUniqueBookmarkTagFromUpdate(const sync_pb::SyncEntity& update) {
if (!update.has_originator_cache_guid() ||
!update.has_originator_client_item_id()) {
- LOG(ERROR) << "Update is missing requirements for bookmark position."
- << " This is a server bug.";
- return UniquePosition::RandomSuffix();
+ return std::string();
}
return syncable::GenerateSyncableBookmarkHash(
@@ -298,8 +295,7 @@
} else if (update.has_position_in_parent()) {
return UniquePosition::FromInt64(update.position_in_parent(), suffix);
} else {
- LOG(ERROR) << "No position information in update. This is a server bug.";
- return UniquePosition::FromInt64(0, suffix);
+ return UniquePosition::CreateInvalid();
}
}
@@ -345,6 +341,10 @@
GetUpdatePosition(update, local_entry->GetUniqueBookmarkTag());
if (update_pos.IsValid()) {
local_entry->PutServerUniquePosition(update_pos);
+ } else {
+ // TODO(sync): This and other cases of unexpected input should be handled
+ // better.
+ NOTREACHED();
}
}
« no previous file with comments | « trunk/src/sync/engine/syncer_util.h ('k') | trunk/src/sync/engine/syncer_util_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698