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

Unified Diff: components/sync/model_impl/in_memory_metadata_change_list.cc

Issue 2473553003: [Sync] Improve MetadataChangeList usage for types using ModelTypeStore. (Closed)
Patch Set: Fix comments + protected constructor. Created 4 years, 1 month 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_impl/in_memory_metadata_change_list.cc
diff --git a/components/sync/model_impl/in_memory_metadata_change_list.cc b/components/sync/model_impl/in_memory_metadata_change_list.cc
new file mode 100644
index 0000000000000000000000000000000000000000..23c2a947fc11145a210134cbfbf91421fbd8fefe
--- /dev/null
+++ b/components/sync/model_impl/in_memory_metadata_change_list.cc
@@ -0,0 +1,31 @@
+// Copyright 2016 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_impl/in_memory_metadata_change_list.h"
+
+namespace syncer {
+
+InMemoryMetadataChangeList::InMemoryMetadataChangeList() {}
+InMemoryMetadataChangeList::~InMemoryMetadataChangeList() {}
+
+void InMemoryMetadataChangeList::UpdateModelTypeState(
+ const sync_pb::ModelTypeState& model_type_state) {
+ state_change_.reset(new ModelTypeStateChange{UPDATE, model_type_state});
+}
+
+void InMemoryMetadataChangeList::ClearModelTypeState() {
+ state_change_.reset(new ModelTypeStateChange{CLEAR});
+}
+
+void InMemoryMetadataChangeList::UpdateMetadata(
+ const std::string& storage_key,
+ const sync_pb::EntityMetadata& metadata) {
+ metadata_changes_[storage_key] = {UPDATE, metadata};
+}
+
+void InMemoryMetadataChangeList::ClearMetadata(const std::string& storage_key) {
+ metadata_changes_[storage_key] = {CLEAR, sync_pb::EntityMetadata()};
+}
+
+} // namespace syncer
« no previous file with comments | « components/sync/model_impl/in_memory_metadata_change_list.h ('k') | components/sync/model_impl/model_type_store_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698