summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authornick@chromium.org <nick@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-02-11 23:03:37 +0000
committernick@chromium.org <nick@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-02-11 23:03:37 +0000
commit46ff913511e296f8fb674221653f95959d3074ae (patch)
tree275eed0f5347c084c6e7c7e0f83dad53c02683a0
parent2a6768655cd26d3834c79cbce5257e3aabb87eca (diff)
downloadchromium_src-46ff913511e296f8fb674221653f95959d3074ae.zip
chromium_src-46ff913511e296f8fb674221653f95959d3074ae.tar.gz
chromium_src-46ff913511e296f8fb674221653f95959d3074ae.tar.bz2
Two fixes from preference sync bringup: (a) Nudge the syncer on more
than just bookmarks, and (b) set the client_unique_tag during commits. BUG=none TEST=hack-enabled prefs, saw commit go through. Review URL: http://codereview.chromium.org/606004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@38847 0039d316-1c4b-4281-b951-d872f2087c98
-rwxr-xr-xchrome/browser/sync/engine/build_commit_command.cc5
-rwxr-xr-xchrome/browser/sync/engine/syncapi.cc15
2 files changed, 13 insertions, 7 deletions
diff --git a/chrome/browser/sync/engine/build_commit_command.cc b/chrome/browser/sync/engine/build_commit_command.cc
index 1cf0ae6..f1c3d52 100755
--- a/chrome/browser/sync/engine/build_commit_command.cc
+++ b/chrome/browser/sync/engine/build_commit_command.cc
@@ -111,6 +111,11 @@ void BuildCommitCommand::ExecuteImpl(SyncSession* session) {
// We send both because it may aid in logging.
sync_entry->set_non_unique_name(name);
+ if (!meta_entry.Get(syncable::UNIQUE_CLIENT_TAG).empty()) {
+ sync_entry->set_client_defined_unique_tag(
+ meta_entry.Get(syncable::UNIQUE_CLIENT_TAG));
+ }
+
// Deleted items with negative parent ids can be a problem so we set the
// parent to 0. (TODO(sync): Still true in protocol?).
Id new_parent_id;
diff --git a/chrome/browser/sync/engine/syncapi.cc b/chrome/browser/sync/engine/syncapi.cc
index 0fa7362..e34e9d7 100755
--- a/chrome/browser/sync/engine/syncapi.cc
+++ b/chrome/browser/sync/engine/syncapi.cc
@@ -1524,13 +1524,14 @@ void SyncManager::SyncInternal::HandleCalculateChangesChangeEventFromSyncApi(
syncable::Entry e(event.trans, syncable::GET_BY_HANDLE, id);
DCHECK(e.good());
- if (e.IsRoot()) {
- // Ignore root object, should it ever change.
- continue;
- } else if (e.GetModelType() != syncable::BOOKMARKS) {
- // Ignore non-bookmark objects.
- continue;
- } else if (e.Get(syncable::IS_UNSYNCED)) {
+ syncable::ModelType model_type = e.GetModelType();
+
+ if (e.Get(syncable::IS_UNSYNCED)) {
+ if (model_type == syncable::TOP_LEVEL_FOLDER ||
+ model_type == syncable::UNSPECIFIED) {
+ NOTREACHED() << "Permanent or underspecified item changed via syncapi.";
+ continue;
+ }
// Unsynced items will cause us to nudge the the syncer.
exists_unsynced_items = true;
}