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

Issue 2915763005: [Sync] Implement support for updating storage key for new entities (Closed)

Created:
3 years, 6 months ago by pavely
Modified:
3 years, 6 months ago
Reviewers:
skym
CC:
chromium-reviews
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

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. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+379 lines, -200 lines) Patch
M components/sync/model/entity_change.h View 1 1 chunk +4 lines, -0 lines 0 comments Download
M components/sync/model/fake_model_type_change_processor.h View 1 chunk +2 lines, -2 lines 0 comments Download
M components/sync/model/fake_model_type_change_processor.cc View 1 chunk +2 lines, -2 lines 0 comments Download
M components/sync/model/fake_model_type_sync_bridge.h View 3 chunks +13 lines, -1 line 0 comments Download
M components/sync/model/fake_model_type_sync_bridge.cc View 7 chunks +69 lines, -15 lines 0 comments Download
M components/sync/model/model_type_change_processor.h View 1 chunk +8 lines, -6 lines 0 comments Download
M components/sync/model/model_type_sync_bridge.h View 1 2 chunks +48 lines, -10 lines 0 comments Download
M components/sync/model/model_type_sync_bridge.cc View 2 chunks +18 lines, -0 lines 0 comments Download
M components/sync/model_impl/processor_entity_tracker.h View 1 chunk +4 lines, -5 lines 0 comments Download
M components/sync/model_impl/processor_entity_tracker.cc View 2 chunks +5 lines, -2 lines 0 comments Download
M components/sync/model_impl/processor_entity_tracker_unittest.cc View 2 chunks +18 lines, -0 lines 0 comments Download
M components/sync/model_impl/shared_model_type_processor.h View 1 2 3 chunks +14 lines, -6 lines 0 comments Download
M components/sync/model_impl/shared_model_type_processor.cc View 1 2 12 chunks +104 lines, -72 lines 0 comments Download
M components/sync/model_impl/shared_model_type_processor_unittest.cc View 1 2 10 chunks +70 lines, -79 lines 0 comments Download

Messages

Total messages: 23 (17 generated)
pavely
3 years, 6 months ago (2017-05-31 18:56:46 UTC) #3
skym
Looks awesome, love the upgrade/migration story here. Only concern is how this interacts with encryption. ...
3 years, 6 months ago (2017-05-31 19:53:12 UTC) #6
pavely
https://codereview.chromium.org/2915763005/diff/1/components/sync/model/entity_change.h File components/sync/model/entity_change.h (right): https://codereview.chromium.org/2915763005/diff/1/components/sync/model/entity_change.h#newcode31 components/sync/model/entity_change.h:31: // TODO(pavely): data_ptr() is added temporarily to support converting ...
3 years, 6 months ago (2017-06-02 18:23:46 UTC) #9
skym
lgtm, once unit tests are fixed. Not sure what issue you mentioned during standup that ...
3 years, 6 months ago (2017-06-02 23:07:57 UTC) #12
commit-bot: I haz the power
CQ is trying da patch. Follow status at: https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2915763005/40001
3 years, 6 months ago (2017-06-05 19:05:58 UTC) #19
commit-bot: I haz the power
3 years, 6 months ago (2017-06-05 22:54:45 UTC) #23
Message was sent while issue was closed.
Committed patchset #3 (id:40001) as
https://chromium.googlesource.com/chromium/src/+/b877904be7dd60869488a48b722f...

Powered by Google App Engine
This is Rietveld 408576698