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

Unified Diff: chrome/browser/sync/glue/bookmark_model_associator.cc

Issue 18132003: [Sync] Trigger unapply + getupdates for persistence errors (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix formatting Created 7 years, 6 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
Index: chrome/browser/sync/glue/bookmark_model_associator.cc
diff --git a/chrome/browser/sync/glue/bookmark_model_associator.cc b/chrome/browser/sync/glue/bookmark_model_associator.cc
index 2782ec22efe671c04c7f527c74d10e1970024d19..c5b5434be6b9dc03c11ad54d5851f03e1ef66bc8 100644
--- a/chrome/browser/sync/glue/bookmark_model_associator.cc
+++ b/chrome/browser/sync/glue/bookmark_model_associator.cc
@@ -9,9 +9,11 @@
#include "base/bind.h"
#include "base/command_line.h"
#include "base/containers/hash_tables.h"
+#include "base/format_macros.h"
#include "base/location.h"
#include "base/message_loop.h"
#include "base/strings/string_number_conversions.h"
+#include "base/strings/stringprintf.h"
#include "base/strings/utf_string_conversions.h"
#include "chrome/browser/bookmarks/bookmark_model.h"
#include "chrome/browser/profiles/profile.h"
@@ -732,9 +734,15 @@ syncer::SyncError BookmarkModelAssociator::CheckModelSyncState(
// If the native version is higher, there was a sync persistence failure,
// and we need to delay association until after a GetUpdates.
if (sync_version < native_version) {
- DVLOG(1) << "Native version (" << native_version << ") does not match "
- << "sync version (" << sync_version << ").";
- // TODO(zea): return a persistence error here.
+ std::string message = base::StringPrintf(
+ "Native version (%" PRId64 ") does not match sync version (%"
+ PRId64 ")",
+ native_version,
+ sync_version);
+ return syncer::SyncError(FROM_HERE,
+ syncer::SyncError::PERSISTENCE_ERROR,
+ message,
+ syncer::BOOKMARKS);
}
}
}
« no previous file with comments | « chrome/browser/sync/glue/backend_data_type_configurer.h ('k') | chrome/browser/sync/glue/data_type_manager_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698