Chromium Code Reviews
Description[Sync] Implement support for updating storage key for new entities
TypedURL's storage key is ROWID which can only be obtained after url record is
inserted into history database. Processor interface should allow bridge to
update storage key of new entity after it was processed by Merge/Apply.
In this change:
- ModelTypeSyncBridge::SupportsGetStorageKey indicates if processor should
call GetStorageKey or rely on bridge to call UpdateStorageKey instead.
- MergeSyncData takes list of changes. The reason is that it needs to support
both types of bridges and EntityChange conveniently includes storage key.
- MergeSyncData currently has implementation that converts change list into
EntityDataMap. In a separate change I'll switch existing bridge
implementations, remove conversion code and method that takes map.
- ProcessorEntityTracker can have empty storage key. It can only be changed to
non-empty one once.
- ModelTypeChangeProcessor::UpdateStorageKey takes EntityData to identify
entity that corresponds to storage key.
- SMTP::OnUpdateReceived handles entities with empty storage keys and ensures
that all storage keys are populated by bridge.
- I refactored SharedModelTypeProcessor::ProcessUpdate to group actios
performed on entities.
R=skym@chromium.org
BUG=719570
Review-Url: https://codereview.chromium.org/2915763005
Cr-Commit-Position: refs/heads/master@{#477113}
Committed: https://chromium.googlesource.com/chromium/src/+/b877904be7dd60869488a48b722fbcf41986ea87
Patch Set 1 #
Total comments: 23
Patch Set 2 : Address Sky's comments #
Total comments: 1
Patch Set 3 : Rebase. Fix recommit for encryption scenario. #Messages
Total messages: 23 (17 generated)
|