diff options
author | skym <skym@chromium.org> | 2016-03-07 09:45:21 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-03-07 17:46:36 +0000 |
commit | 0a4cdc91f9c415a44bb2dc8e884b1bc311805bde (patch) | |
tree | f67b97baa0761aa89f7f85a31064485d1d0234f8 /sync | |
parent | e9f54102f094afa87dd22bdcbc26a5aec911e882 (diff) | |
download | chromium_src-0a4cdc91f9c415a44bb2dc8e884b1bc311805bde.zip chromium_src-0a4cdc91f9c415a44bb2dc8e884b1bc311805bde.tar.gz chromium_src-0a4cdc91f9c415a44bb2dc8e884b1bc311805bde.tar.bz2 |
[Sync] DeviceInfo implementation of MergeSyncData.
BUG=543404, 543405, 543406
Review URL: https://codereview.chromium.org/1712863002
Cr-Commit-Position: refs/heads/master@{#379578}
Diffstat (limited to 'sync')
-rw-r--r-- | sync/api/model_type_service.h | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/sync/api/model_type_service.h b/sync/api/model_type_service.h index 950060e..bba4211 100644 --- a/sync/api/model_type_service.h +++ b/sync/api/model_type_service.h @@ -38,8 +38,19 @@ class SYNC_EXPORT ModelTypeService { // model type store. virtual scoped_ptr<MetadataChangeList> CreateMetadataChangeList() = 0; - // Perform the initial merge of data from the sync server. Should only need - // to be called when sync is first turned on, not on every restart. + // Perform the initial merge between local and sync data. This should only be + // called when a data type is first enabled to start syncing, and there is no + // sync metadata. Best effort should be made to match local and sync data. The + // keys in the |entity_data_map| will have been created via GetClientTag(...), + // and if a local and sync data should match/merge but disagree on tags, the + // service should use the sync data's tag. Any local pieces of data that are + // not present in sync should immediately be Put(...) to the processor before + // returning. The same MetadataChangeList that was passed into this function + // can be passed to Put(...) calls. Delete(...) can also be called but should + // not be needed for most model types. Durable storage writes, if not able to + // combine all change atomically, should save the metadata after the data + // changes, so that this merge will be re-driven by sync if is not completely + // saved during the current run. virtual syncer::SyncError MergeSyncData( scoped_ptr<MetadataChangeList> metadata_change_list, EntityDataMap entity_data_map) = 0; |