OLD | NEW |
---|---|
(Empty) | |
1 // Copyright 2017 The Chromium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef COMPONENTS_SYNC_MODEL_METADATA_TABLE_H_ | |
6 #define COMPONENTS_SYNC_MODEL_METADATA_TABLE_H_ | |
7 | |
8 #include <string> | |
9 | |
10 #include "components/sync/base/model_type.h" | |
11 | |
12 namespace sync_pb { | |
13 class EntityMetadata; | |
14 class ModelTypeState; | |
15 } // namespace sync_pb | |
16 | |
17 namespace syncer { | |
18 | |
19 // 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.
| |
20 // metadata. The purpose of the interface is to record metadata changes to | |
21 // database for each datatype. The implementation of the interface is supposed | |
22 // to add/update/delete metadata for each datatype in database. | |
23 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.
| |
24 public: | |
25 MetadataTable() {} | |
26 virtual ~MetadataTable() {} | |
27 | |
28 // Update the metadata row for |model_type|, keyed by |storage_key|, to | |
29 // contain the contents of |metadata|. | |
30 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.
| |
31 const std::string& storage_key, | |
32 const sync_pb::EntityMetadata& metadata) = 0; | |
33 | |
34 // Remove the metadata row of type |model_type| keyed by |storage_key|. | |
35 virtual bool ClearSyncMetadata(syncer::ModelType model_type, | |
36 const std::string& storage_key) = 0; | |
37 | |
38 // Update the stored sync state for the |model_type|. | |
39 virtual bool UpdateModelTypeState( | |
40 syncer::ModelType model_type, | |
41 const sync_pb::ModelTypeState& model_type_state) = 0; | |
42 | |
43 // Clear the stored sync state for |model_type|. | |
44 virtual bool ClearModelTypeState(syncer::ModelType model_type) = 0; | |
45 }; | |
46 | |
47 } // namespace syncer | |
48 | |
49 #endif // COMPONENTS_SYNC_MODEL_METADATA_TABLE_H_ | |
OLD | NEW |