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

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: Address comment 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
« no previous file with comments | « no previous file | components/sync/engine_impl/model_type_worker_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..e7f364d1b9433224b5b97b91cd316db06f8f3748 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_deletion = entity->PendingCommitIsDeletion();
+
entity->ReceiveCommitResponse(&response);
+
+ if (is_deletion) {
+ entities_.erase(response.client_tag_hash);
+ }
}
// Send the responses back to the model thread. It needs to know which
« no previous file with comments | « no previous file | components/sync/engine_impl/model_type_worker_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698