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

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

Issue 2620783002: [sync] Handle local changes in AutocompleteSyncBridge (Closed)
Patch Set: rebase onto sky's changes Created 3 years, 11 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
new file mode 100644
index 0000000000000000000000000000000000000000..148fe63927293c0d56351958611e69fb9a158a62
--- /dev/null
+++ b/components/sync/model/recording_model_type_change_processor.cc
@@ -0,0 +1,43 @@
+// Copyright 2017 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "components/sync/model/recording_model_type_change_processor.h"
+
+#include "components/sync/model/fake_model_type_change_processor.h"
+#include "components/sync/model/metadata_batch.h"
+
+namespace syncer {
+
+RecordingModelTypeChangeProcessor::RecordingModelTypeChangeProcessor() {}
+
+RecordingModelTypeChangeProcessor::~RecordingModelTypeChangeProcessor() {}
+
+void RecordingModelTypeChangeProcessor::Put(
+ const std::string& storage_key,
+ std::unique_ptr<EntityData> entity_data,
+ MetadataChangeList* metadata_changes) {
+ put_multimap_.insert(std::make_pair(storage_key, std::move(entity_data)));
+}
+
+void RecordingModelTypeChangeProcessor::Delete(
+ const std::string& storage_key,
+ MetadataChangeList* metadata_changes) {
+ delete_set_.insert(storage_key);
+}
+
+void RecordingModelTypeChangeProcessor::OnMetadataLoaded(
+ std::unique_ptr<MetadataBatch> batch) {
+ std::swap(metadata_, batch);
+}
+
+bool RecordingModelTypeChangeProcessor::IsTrackingMetadata() {
+ return is_tracking_metadata_;
+}
+
+void RecordingModelTypeChangeProcessor::SetIsTrackingMetadata(
+ bool is_tracking) {
+ is_tracking_metadata_ = is_tracking;
+}
+
+} // namespace syncer

Powered by Google App Engine
This is Rietveld 408576698