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

Unified Diff: sync/engine/apply_updates_command.cc

Issue 10832286: sync: Introduce control data types (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add ToFullModelTypeSet() function Created 8 years, 4 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: sync/engine/apply_updates_command.cc
diff --git a/sync/engine/apply_updates_command.cc b/sync/engine/apply_updates_command.cc
index da8a1cc4c2e987d464445cfbef8bd63cd0be4513..7d4e72ec9290d063692d741e6a1fd037c1e40b52 100644
--- a/sync/engine/apply_updates_command.cc
+++ b/sync/engine/apply_updates_command.cc
@@ -57,6 +57,10 @@ SyncerError ApplyUpdatesCommand::ModelChangingExecuteImpl(
}
}
+ // Don't process control type updates here. They will be handled elsewhere.
+ FullModelTypeSet control_types = ToFullModelTypeSet(ControlTypes());
+ server_type_restriction.RemoveAll(control_types);
+
std::vector<int64> handles;
dir->GetUnappliedUpdateMetaHandles(
&trans, server_type_restriction, &handles);
@@ -77,6 +81,10 @@ SyncerError ApplyUpdatesCommand::ModelChangingExecuteImpl(
if (status.ServerSaysNothingMoreToDownload()) {
for (ModelTypeSet::Iterator it =
status.updates_request_types().First(); it.Good(); it.Inc()) {
+ // Don't set the flag for control types. We didn't process them here.
+ if (IsControlType(it.Get()))
+ continue;
+
// This gets persisted to the directory's backing store.
dir->set_initial_sync_ended_for_type(it.Get(), true);
}

Powered by Google App Engine
This is Rietveld 408576698