New issue
Advanced search Search tips

Issue 719570 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Jun 2017
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug



Sign in to add a comment

[USS] StorageKey for type that generates primary key on insertion

Project Member Reported by gangwu@chromium.org, May 8 2017

Issue description

Processor should allow bridge to generate StorageKey on insertion.
 
Project Member

Comment 1 by bugdroid1@chromium.org, Jun 5 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/b877904be7dd60869488a48b722fbcf41986ea87

commit b877904be7dd60869488a48b722fbcf41986ea87
Author: pavely <pavely@chromium.org>
Date: Mon Jun 05 22:54:27 2017

[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}

[modify] https://crrev.com/b877904be7dd60869488a48b722fbcf41986ea87/components/sync/model/entity_change.h
[modify] https://crrev.com/b877904be7dd60869488a48b722fbcf41986ea87/components/sync/model/fake_model_type_change_processor.cc
[modify] https://crrev.com/b877904be7dd60869488a48b722fbcf41986ea87/components/sync/model/fake_model_type_change_processor.h
[modify] https://crrev.com/b877904be7dd60869488a48b722fbcf41986ea87/components/sync/model/fake_model_type_sync_bridge.cc
[modify] https://crrev.com/b877904be7dd60869488a48b722fbcf41986ea87/components/sync/model/fake_model_type_sync_bridge.h
[modify] https://crrev.com/b877904be7dd60869488a48b722fbcf41986ea87/components/sync/model/model_type_change_processor.h
[modify] https://crrev.com/b877904be7dd60869488a48b722fbcf41986ea87/components/sync/model/model_type_sync_bridge.cc
[modify] https://crrev.com/b877904be7dd60869488a48b722fbcf41986ea87/components/sync/model/model_type_sync_bridge.h
[modify] https://crrev.com/b877904be7dd60869488a48b722fbcf41986ea87/components/sync/model_impl/processor_entity_tracker.cc
[modify] https://crrev.com/b877904be7dd60869488a48b722fbcf41986ea87/components/sync/model_impl/processor_entity_tracker.h
[modify] https://crrev.com/b877904be7dd60869488a48b722fbcf41986ea87/components/sync/model_impl/processor_entity_tracker_unittest.cc
[modify] https://crrev.com/b877904be7dd60869488a48b722fbcf41986ea87/components/sync/model_impl/shared_model_type_processor.cc
[modify] https://crrev.com/b877904be7dd60869488a48b722fbcf41986ea87/components/sync/model_impl/shared_model_type_processor.h
[modify] https://crrev.com/b877904be7dd60869488a48b722fbcf41986ea87/components/sync/model_impl/shared_model_type_processor_unittest.cc

Project Member

Comment 2 by bugdroid1@chromium.org, Jun 13 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/3d6f939efc594429f36fa7ce9d2e2ebb97d34e01

commit 3d6f939efc594429f36fa7ce9d2e2ebb97d34e01
Author: pavely <pavely@chromium.org>
Date: Tue Jun 13 00:42:35 2017

[Sync] Migrate bridge implementations to change list based MergeSyncData

In the previous change (http://crrev.com/2915763005) I added version of
MergeSyncData that takes EntityChangeList instead of EntityDataMap. This is
needed to support bridges that can't generate storage key based on EntityData.

In this change I switch already implemented bridges to the new MergeSyncData
signature.

MergeSyncData takes EntityChangeList where each change has type ACTION_ADD, and
prepopulated storage_key.

R=skym@chromium.org
TBR=olivierrobin@chromium.org
BUG= 719570 

Review-Url: https://codereview.chromium.org/2923363004
Cr-Commit-Position: refs/heads/master@{#478844}

[modify] https://crrev.com/3d6f939efc594429f36fa7ce9d2e2ebb97d34e01/chrome/browser/chromeos/printing/printers_sync_bridge.cc
[modify] https://crrev.com/3d6f939efc594429f36fa7ce9d2e2ebb97d34e01/chrome/browser/chromeos/printing/printers_sync_bridge.h
[modify] https://crrev.com/3d6f939efc594429f36fa7ce9d2e2ebb97d34e01/components/autofill/core/browser/webdata/autocomplete_sync_bridge.cc
[modify] https://crrev.com/3d6f939efc594429f36fa7ce9d2e2ebb97d34e01/components/autofill/core/browser/webdata/autocomplete_sync_bridge.h
[modify] https://crrev.com/3d6f939efc594429f36fa7ce9d2e2ebb97d34e01/components/autofill/core/browser/webdata/autocomplete_sync_bridge_unittest.cc
[modify] https://crrev.com/3d6f939efc594429f36fa7ce9d2e2ebb97d34e01/components/history/core/browser/typed_url_sync_bridge.cc
[modify] https://crrev.com/3d6f939efc594429f36fa7ce9d2e2ebb97d34e01/components/history/core/browser/typed_url_sync_bridge.h
[modify] https://crrev.com/3d6f939efc594429f36fa7ce9d2e2ebb97d34e01/components/reading_list/core/reading_list_model_unittest.cc
[modify] https://crrev.com/3d6f939efc594429f36fa7ce9d2e2ebb97d34e01/components/reading_list/core/reading_list_store.cc
[modify] https://crrev.com/3d6f939efc594429f36fa7ce9d2e2ebb97d34e01/components/reading_list/core/reading_list_store.h
[modify] https://crrev.com/3d6f939efc594429f36fa7ce9d2e2ebb97d34e01/components/reading_list/core/reading_list_store_unittest.cc
[modify] https://crrev.com/3d6f939efc594429f36fa7ce9d2e2ebb97d34e01/components/sync/device_info/device_info_sync_bridge.cc
[modify] https://crrev.com/3d6f939efc594429f36fa7ce9d2e2ebb97d34e01/components/sync/device_info/device_info_sync_bridge.h
[modify] https://crrev.com/3d6f939efc594429f36fa7ce9d2e2ebb97d34e01/components/sync/device_info/device_info_sync_bridge_unittest.cc
[modify] https://crrev.com/3d6f939efc594429f36fa7ce9d2e2ebb97d34e01/components/sync/model/entity_change.h
[modify] https://crrev.com/3d6f939efc594429f36fa7ce9d2e2ebb97d34e01/components/sync/model/entity_data.h
[modify] https://crrev.com/3d6f939efc594429f36fa7ce9d2e2ebb97d34e01/components/sync/model/fake_model_type_sync_bridge.cc
[modify] https://crrev.com/3d6f939efc594429f36fa7ce9d2e2ebb97d34e01/components/sync/model/fake_model_type_sync_bridge.h
[modify] https://crrev.com/3d6f939efc594429f36fa7ce9d2e2ebb97d34e01/components/sync/model/model_type_sync_bridge.cc
[modify] https://crrev.com/3d6f939efc594429f36fa7ce9d2e2ebb97d34e01/components/sync/model/model_type_sync_bridge.h
[modify] https://crrev.com/3d6f939efc594429f36fa7ce9d2e2ebb97d34e01/components/sync/model/stub_model_type_sync_bridge.cc
[modify] https://crrev.com/3d6f939efc594429f36fa7ce9d2e2ebb97d34e01/components/sync/model/stub_model_type_sync_bridge.h
[modify] https://crrev.com/3d6f939efc594429f36fa7ce9d2e2ebb97d34e01/components/sync/user_events/user_event_sync_bridge.cc
[modify] https://crrev.com/3d6f939efc594429f36fa7ce9d2e2ebb97d34e01/components/sync/user_events/user_event_sync_bridge.h

Project Member

Comment 3 by bugdroid1@chromium.org, Jun 16 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/20065cfbc168c8a6d919196499c7ac484351c5d8

commit 20065cfbc168c8a6d919196499c7ac484351c5d8
Author: gangwu <gangwu@chromium.org>
Date: Fri Jun 16 17:51:53 2017

[Sync] Implement support for untracking new entities

This is a follow up CL for https://codereview.chromium.org/2915763005.
The CL above let processor can obtain storage key during bridge merge/apply,
but some entities maybe expired and bridge do not want to persist them, so this CL
add a function called UntrackEntity in processor to let processor to remove
tracker for those entities.

BUG= 719570 

Review-Url: https://codereview.chromium.org/2935583002
Cr-Commit-Position: refs/heads/master@{#480096}

[modify] https://crrev.com/20065cfbc168c8a6d919196499c7ac484351c5d8/components/sync/model/fake_model_type_change_processor.cc
[modify] https://crrev.com/20065cfbc168c8a6d919196499c7ac484351c5d8/components/sync/model/fake_model_type_change_processor.h
[modify] https://crrev.com/20065cfbc168c8a6d919196499c7ac484351c5d8/components/sync/model/fake_model_type_sync_bridge.cc
[modify] https://crrev.com/20065cfbc168c8a6d919196499c7ac484351c5d8/components/sync/model/fake_model_type_sync_bridge.h
[modify] https://crrev.com/20065cfbc168c8a6d919196499c7ac484351c5d8/components/sync/model/model_type_change_processor.h
[modify] https://crrev.com/20065cfbc168c8a6d919196499c7ac484351c5d8/components/sync/model_impl/shared_model_type_processor.cc
[modify] https://crrev.com/20065cfbc168c8a6d919196499c7ac484351c5d8/components/sync/model_impl/shared_model_type_processor.h
[modify] https://crrev.com/20065cfbc168c8a6d919196499c7ac484351c5d8/components/sync/model_impl/shared_model_type_processor_unittest.cc
[modify] https://crrev.com/20065cfbc168c8a6d919196499c7ac484351c5d8/components/sync/test/engine/mock_model_type_worker.cc
[modify] https://crrev.com/20065cfbc168c8a6d919196499c7ac484351c5d8/components/sync/test/engine/mock_model_type_worker.h

Comment 4 by gangwu@chromium.org, Jun 29 2017

Status: Fixed (was: Assigned)

Sign in to add a comment