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

Unified Diff: components/sync/model/recording_model_type_change_processor.cc

Issue 2961723003: [USS] Implement ApplySyncChanges and OnURLVisited/Modified/Deleted. (Closed)
Patch Set: update pavel's review Created 3 years, 5 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/recording_model_type_change_processor.cc
diff --git a/components/sync/model/recording_model_type_change_processor.cc b/components/sync/model/recording_model_type_change_processor.cc
index a20e2990fec038531c42966a6d887bfe5e502604..8eb0f5d81991255d62e5ce1455cedf7549e11150 100644
--- a/components/sync/model/recording_model_type_change_processor.cc
+++ b/components/sync/model/recording_model_type_change_processor.cc
@@ -8,6 +8,7 @@
#include "base/bind.h"
#include "base/memory/ptr_util.h"
+#include "components/sync/model/fake_model_type_sync_bridge.h"
#include "components/sync/model/metadata_batch.h"
namespace syncer {
@@ -38,6 +39,8 @@ void RecordingModelTypeChangeProcessor::Put(
const std::string& storage_key,
std::unique_ptr<EntityData> entity_data,
MetadataChangeList* metadata_changes) {
+ if (entity_data->modification_time.is_null())
+ entity_data->modification_time = base::Time::Now();
put_multimap_.insert(std::make_pair(storage_key, std::move(entity_data)));
}
@@ -47,6 +50,19 @@ void RecordingModelTypeChangeProcessor::Delete(
delete_set_.insert(storage_key);
}
+void RecordingModelTypeChangeProcessor::UpdateStorageKey(
+ const EntityData& entity_data,
+ const std::string& storage_key,
+ MetadataChangeList* metadata_change_list) {
+ update_multimap_.insert(std::make_pair(
+ storage_key, FakeModelTypeSyncBridge::CopyEntityData(entity_data)));
+}
+
+void RecordingModelTypeChangeProcessor::UntrackEntity(
+ const EntityData& entity_data) {
+ untrack_set_.insert(FakeModelTypeSyncBridge::CopyEntityData(entity_data));
+}
+
void RecordingModelTypeChangeProcessor::ModelReadyToSync(
std::unique_ptr<MetadataBatch> batch) {
std::swap(metadata_, batch);

Powered by Google App Engine
This is Rietveld 408576698