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

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

Issue 2562673003: [Sync] WorkerEntityTracker: Ensure that update and commit response have valid id. (Closed)
Patch Set: Created 4 years 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/worker_entity_tracker.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 85730ed3b7576c6c4b9223ce4feac4ee143459be..de5b19d8e4bcc4e4b7ee2549dd92684c7bd21b98 100644
--- a/components/sync/engine_impl/model_type_worker.cc
+++ b/components/sync/engine_impl/model_type_worker.cc
@@ -347,7 +347,7 @@ void ModelTypeWorker::AdjustCommitProto(sync_pb::SyncEntity* sync_entity) {
// Initial commits need our help to generate a client ID.
if (sync_entity->version() == kUncommittedVersion) {
- DCHECK(!sync_entity->has_id_string());
+ DCHECK(sync_entity->id_string().empty());
// TODO(crbug.com/516866): This is incorrect for bookmarks for two reasons:
// 1) Won't be able to match previously committed bookmarks to the ones
// with server ID.
@@ -358,7 +358,7 @@ void ModelTypeWorker::AdjustCommitProto(sync_pb::SyncEntity* sync_entity) {
sync_entity->set_id_string(base::GenerateGUID());
sync_entity->set_version(0);
} else {
- DCHECK(sync_entity->has_id_string());
+ DCHECK(!sync_entity->id_string().empty());
}
// Encrypt the specifics and hide the title if necessary.
« no previous file with comments | « no previous file | components/sync/engine_impl/worker_entity_tracker.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698