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

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

Issue 2611123005: [Sync] ModelTypeWorker should delete tracker for entity deleted on the server (Closed)
Patch Set: Rebase Created 3 years, 11 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 de5b19d8e4bcc4e4b7ee2549dd92684c7bd21b98..32282a9cbd0557b3360152c32cf3a74dad677377 100644
--- a/components/sync/engine_impl/model_type_worker.cc
+++ b/components/sync/engine_impl/model_type_worker.cc
@@ -304,7 +304,15 @@ void ModelTypeWorker::OnCommitResponse(CommitResponseDataList* response_list) {
continue;
}
+ // Remember if entity was deleted. After ReceiveCommitResponse this flag
+ // will not be available.
+ bool is_tombstone = entity->IsTombstone();
+
entity->ReceiveCommitResponse(&response);
+
+ if (is_tombstone) {
+ entities_.erase(response.client_tag_hash);
+ }
}
// Send the responses back to the model thread. It needs to know which

Powered by Google App Engine
This is Rietveld 408576698