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

Unified Diff: components/sync/model/fake_model_type_sync_bridge.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/fake_model_type_sync_bridge.h
diff --git a/components/sync/model/fake_model_type_sync_bridge.h b/components/sync/model/fake_model_type_sync_bridge.h
index f71b347296c0ef41dd523ccdfe8ae4be8f23772b..b6e1226abbfa36cbb059aeb41540b12c9c75eccc 100644
--- a/components/sync/model/fake_model_type_sync_bridge.h
+++ b/components/sync/model/fake_model_type_sync_bridge.h
@@ -106,7 +106,10 @@ class FakeModelTypeSyncBridge : public ModelTypeSyncBridge {
std::unique_ptr<MetadataChangeList> CreateMetadataChangeList() override;
base::Optional<ModelError> MergeSyncData(
std::unique_ptr<MetadataChangeList> metadata_change_list,
- EntityDataMap entity_data_map) override;
+ EntityChangeList entity_data) override;
+ base::Optional<ModelError> MergeSyncData(
+ std::unique_ptr<MetadataChangeList> metadata_change_list,
+ EntityDataMap entity_data) override;
base::Optional<ModelError> ApplySyncChanges(
std::unique_ptr<MetadataChangeList> metadata_change_list,
EntityChangeList entity_changes) override;
@@ -114,6 +117,8 @@ class FakeModelTypeSyncBridge : public ModelTypeSyncBridge {
void GetAllData(DataCallback callback) override;
std::string GetClientTag(const EntityData& entity_data) override;
std::string GetStorageKey(const EntityData& entity_data) override;
+ bool SupportsGetStorageKey() const override;
+ void SetSupportsGetStorageKey(bool supports_get_storage_key);
ConflictResolution ResolveConflict(
const EntityData& local_data,
const EntityData& remote_data) const override;
@@ -140,11 +145,18 @@ class FakeModelTypeSyncBridge : public ModelTypeSyncBridge {
// Applies |change_list| to the metadata store.
void ApplyMetadataChangeList(std::unique_ptr<MetadataChangeList> change_list);
+ std::string GetStorageKeyImpl(const EntityData& entity_data);
+
// The conflict resolution to use for calls to ResolveConflict.
std::unique_ptr<ConflictResolution> conflict_resolution_;
// Whether an error should be produced on the next bridge call.
bool error_next_ = false;
+
+ // Whether the bridge supports call to GetStorageKey. If it doesn't bridge is
+ // responsible for calling UpdateStorageKey when processing new entities in
+ // MergeSyncData/ApplySyncChanges.
+ bool supports_get_storage_key_ = true;
};
} // namespace syncer
« no previous file with comments | « components/sync/model/fake_model_type_change_processor.cc ('k') | components/sync/model/fake_model_type_sync_bridge.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698