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

Unified Diff: components/sync/engine_impl/model_type_worker.cc

Issue 2328393002: [Sync] Add a sanity integration test for USS. (Closed)
Patch Set: Rebase. Created 4 years, 3 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: components/sync/engine_impl/model_type_worker.cc
diff --git a/components/sync/engine_impl/model_type_worker.cc b/components/sync/engine_impl/model_type_worker.cc
index d428cfbffd064989405bed581c140dfe04f4fba7..5f010373970fffe5a97859d99ffdfd11e737808e 100644
--- a/components/sync/engine_impl/model_type_worker.cc
+++ b/components/sync/engine_impl/model_type_worker.cc
@@ -139,8 +139,13 @@ SyncerError ModelTypeWorker::ProcessGetUpdatesResponse(
WorkerEntityTracker* entity = GetOrCreateEntityTracker(data);
+ // Deleted entities must use the default instance of EntitySpecifics in
+ // order for EntityData to correctly reflect that they are deleted.
+ const sync_pb::EntitySpecifics& specifics =
+ update_entity->deleted() ? sync_pb::EntitySpecifics::default_instance()
+ : update_entity->specifics();
+
// Check if specifics are encrypted and try to decrypt if so.
- const sync_pb::EntitySpecifics& specifics = update_entity->specifics();
if (!specifics.has_encrypted()) {
// No encryption.
entity->ReceiveUpdate(update_entity->version());

Powered by Google App Engine
This is Rietveld 408576698