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

Unified Diff: components/sync/model/metadata_table.h

Issue 2794413002: [USS] Add SyncMetadataStore interface (Closed)
Patch Set: Created 3 years, 8 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/metadata_table.h
diff --git a/components/sync/model/metadata_table.h b/components/sync/model/metadata_table.h
new file mode 100644
index 0000000000000000000000000000000000000000..bc25755aa57c72346bb21d04c9d5a4decc8d44ce
--- /dev/null
+++ b/components/sync/model/metadata_table.h
@@ -0,0 +1,49 @@
+// 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.
+
+#ifndef COMPONENTS_SYNC_MODEL_METADATA_TABLE_H_
+#define COMPONENTS_SYNC_MODEL_METADATA_TABLE_H_
+
+#include <string>
+
+#include "components/sync/base/model_type.h"
+
+namespace sync_pb {
+class EntityMetadata;
+class ModelTypeState;
+} // namespace sync_pb
+
+namespace syncer {
+
+// Interface used by the MetadataChangeList and database to communicate about
pavely 2017/04/06 22:56:42 This interface will be used by developers outside
Gang Wu 2017/04/21 05:28:03 Done.
+// metadata. The purpose of the interface is to record metadata changes to
+// database for each datatype. The implementation of the interface is supposed
+// to add/update/delete metadata for each datatype in database.
+class MetadataTable {
pavely 2017/04/06 22:56:42 Word "Table" in MetadataTable was probably inspire
Gang Wu 2017/04/21 05:28:03 Done.
+ public:
+ MetadataTable() {}
+ virtual ~MetadataTable() {}
+
+ // Update the metadata row for |model_type|, keyed by |storage_key|, to
+ // contain the contents of |metadata|.
+ virtual bool UpdateSyncMetadata(syncer::ModelType model_type,
pavely 2017/04/06 22:56:42 Could you add description of return value for all
Gang Wu 2017/04/21 05:28:03 Done.
+ const std::string& storage_key,
+ const sync_pb::EntityMetadata& metadata) = 0;
+
+ // Remove the metadata row of type |model_type| keyed by |storage_key|.
+ virtual bool ClearSyncMetadata(syncer::ModelType model_type,
+ const std::string& storage_key) = 0;
+
+ // Update the stored sync state for the |model_type|.
+ virtual bool UpdateModelTypeState(
+ syncer::ModelType model_type,
+ const sync_pb::ModelTypeState& model_type_state) = 0;
+
+ // Clear the stored sync state for |model_type|.
+ virtual bool ClearModelTypeState(syncer::ModelType model_type) = 0;
+};
+
+} // namespace syncer
+
+#endif // COMPONENTS_SYNC_MODEL_METADATA_TABLE_H_

Powered by Google App Engine
This is Rietveld 408576698