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

Unified Diff: components/sync/model/model_type_change_processor.h

Issue 2915763005: [Sync] Implement support for updating storage key for new entities (Closed)
Patch Set: Rebase. Fix recommit for encryption scenario. Created 3 years, 6 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/model/model_type_change_processor.h
diff --git a/components/sync/model/model_type_change_processor.h b/components/sync/model/model_type_change_processor.h
index 78d00a3974172ba99c1f306fbb0022ff0f6b0655..4e83b0044a63053bfe483dcb3e43225146229772 100644
--- a/components/sync/model/model_type_change_processor.h
+++ b/components/sync/model/model_type_change_processor.h
@@ -48,12 +48,14 @@ class ModelTypeChangeProcessor {
virtual void Delete(const std::string& storage_key,
MetadataChangeList* metadata_change_list) = 0;
- // Inform the processor that storage key has chagned.
- // TODO(gangwu): crbug.com/719570 should remove this after bug fixed.
- // This function should only be called for the data type which does not create
- // storage key based on syncer::EntityData.
- virtual void UpdateStorageKey(const std::string& old_storage_key,
- const std::string& new_storage_key,
+ // Sets storage key for the new entity. This function only applies to
+ // datatypes that can't generate storage key based on EntityData. Bridge
+ // should call this function when handling MergeSyncData/ApplySyncChanges to
+ // inform the processor about |storage_key| of an entity identified by
+ // |entity_data|. Metadata changes about new entity will be appended to
+ // |metadata_change_list|.
+ virtual void UpdateStorageKey(const EntityData& entity_data,
+ const std::string& storage_key,
MetadataChangeList* metadata_change_list) = 0;
// The bridge is expected to call this exactly once unless it encounters an
« no previous file with comments | « components/sync/model/fake_model_type_sync_bridge.cc ('k') | components/sync/model/model_type_sync_bridge.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698