OLD | NEW |
---|---|
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef COMPONENTS_SYNC_MODEL_METADATA_CHANGE_LIST_H_ | 5 #ifndef COMPONENTS_SYNC_MODEL_METADATA_CHANGE_LIST_H_ |
6 #define COMPONENTS_SYNC_MODEL_METADATA_CHANGE_LIST_H_ | 6 #define COMPONENTS_SYNC_MODEL_METADATA_CHANGE_LIST_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/optional.h" | |
11 #include "components/sync/model/model_error.h" | |
12 | |
10 namespace sync_pb { | 13 namespace sync_pb { |
11 class EntityMetadata; | 14 class EntityMetadata; |
12 class ModelTypeState; | 15 class ModelTypeState; |
13 } // namespace sync_pb | 16 } // namespace sync_pb |
14 | 17 |
15 namespace syncer { | 18 namespace syncer { |
16 | 19 |
17 // Interface used by the processor and service to communicate about metadata. | 20 // Interface used by the processor and service to communicate about metadata. |
18 // The purpose of the interface is to record changes to data type global and | 21 // The purpose of the interface is to record changes to data type global and |
19 // per entity metadata for the purpose of propagating changes to the datatype | 22 // per entity metadata for the purpose of propagating changes to the datatype |
(...skipping 16 matching lines...) Expand all Loading... | |
36 | 39 |
37 // Requests metadata entry to be updated in the storage. | 40 // Requests metadata entry to be updated in the storage. |
38 // Please note that the update might contain a deleted entry if | 41 // Please note that the update might contain a deleted entry if |
39 // metadata.is_deleted() is true (as opposed to clearing the entry from the | 42 // metadata.is_deleted() is true (as opposed to clearing the entry from the |
40 // storage completely by calling the Clear method). | 43 // storage completely by calling the Clear method). |
41 virtual void UpdateMetadata(const std::string& storage_key, | 44 virtual void UpdateMetadata(const std::string& storage_key, |
42 const sync_pb::EntityMetadata& metadata) = 0; | 45 const sync_pb::EntityMetadata& metadata) = 0; |
43 | 46 |
44 // Requests metadata entry to be cleared from the storage. | 47 // Requests metadata entry to be cleared from the storage. |
45 virtual void ClearMetadata(const std::string& storage_key) = 0; | 48 virtual void ClearMetadata(const std::string& storage_key) = 0; |
49 | |
50 // Returns the value of ModelError and unsets it. | |
51 virtual base::Optional<syncer::ModelError> TakeError() = 0; | |
skym
2017/04/06 23:01:58
What was the decision yesterday about returning er
pavely
2017/04/06 23:36:02
The decision was that we don't change the pattern
Gang Wu
2017/04/21 05:28:03
Done.
| |
46 }; | 52 }; |
47 | 53 |
48 } // namespace syncer | 54 } // namespace syncer |
49 | 55 |
50 #endif // COMPONENTS_SYNC_MODEL_METADATA_CHANGE_LIST_H_ | 56 #endif // COMPONENTS_SYNC_MODEL_METADATA_CHANGE_LIST_H_ |
OLD | NEW |