OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 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_SYNC_DATA_H_ | 5 #ifndef COMPONENTS_SYNC_MODEL_SYNC_DATA_H_ |
6 #define COMPONENTS_SYNC_MODEL_SYNC_DATA_H_ | 6 #define COMPONENTS_SYNC_MODEL_SYNC_DATA_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <iosfwd> | 10 #include <iosfwd> |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
103 | 103 |
104 // TODO(zea): Query methods for other sync properties: parent, successor, etc. | 104 // TODO(zea): Query methods for other sync properties: parent, successor, etc. |
105 | 105 |
106 protected: | 106 protected: |
107 // These data members are protected so derived types like SyncDataLocal and | 107 // These data members are protected so derived types like SyncDataLocal and |
108 // SyncDataRemote can access them. | 108 // SyncDataRemote can access them. |
109 | 109 |
110 // Necessary since we forward-declare sync_pb::SyncEntity; see | 110 // Necessary since we forward-declare sync_pb::SyncEntity; see |
111 // comments in immutable.h. | 111 // comments in immutable.h. |
112 struct ImmutableSyncEntityTraits { | 112 struct ImmutableSyncEntityTraits { |
113 typedef sync_pb::SyncEntity* Wrapper; | 113 using Wrapper = sync_pb::SyncEntity*; |
114 | 114 |
115 static void InitializeWrapper(Wrapper* wrapper); | 115 static void InitializeWrapper(Wrapper* wrapper); |
116 | 116 |
117 static void DestroyWrapper(Wrapper* wrapper); | 117 static void DestroyWrapper(Wrapper* wrapper); |
118 | 118 |
119 static const sync_pb::SyncEntity& Unwrap(const Wrapper& wrapper); | 119 static const sync_pb::SyncEntity& Unwrap(const Wrapper& wrapper); |
120 | 120 |
121 static sync_pb::SyncEntity* UnwrapMutable(Wrapper* wrapper); | 121 static sync_pb::SyncEntity* UnwrapMutable(Wrapper* wrapper); |
122 | 122 |
123 static void Swap(sync_pb::SyncEntity* t1, sync_pb::SyncEntity* t2); | 123 static void Swap(sync_pb::SyncEntity* t1, sync_pb::SyncEntity* t2); |
124 }; | 124 }; |
125 | 125 |
126 typedef Immutable<sync_pb::SyncEntity, ImmutableSyncEntityTraits> | 126 using ImmutableSyncEntity = |
127 ImmutableSyncEntity; | 127 Immutable<sync_pb::SyncEntity, ImmutableSyncEntityTraits>; |
128 | 128 |
129 // Equal to kInvalidId iff this is local. | 129 // Equal to kInvalidId iff this is local. |
130 int64_t id_; | 130 int64_t id_; |
131 | 131 |
132 // This may be null if the SyncData represents a deleted item. | 132 // This may be null if the SyncData represents a deleted item. |
133 base::Time remote_modification_time_; | 133 base::Time remote_modification_time_; |
134 | 134 |
135 // The actual shared sync entity being held. | 135 // The actual shared sync entity being held. |
136 ImmutableSyncEntity immutable_entity_; | 136 ImmutableSyncEntity immutable_entity_; |
137 | 137 |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
191 // requesting the attachments from the network. | 191 // requesting the attachments from the network. |
192 // | 192 // |
193 void GetOrDownloadAttachments( | 193 void GetOrDownloadAttachments( |
194 const AttachmentIdList& attachment_ids, | 194 const AttachmentIdList& attachment_ids, |
195 const AttachmentService::GetOrDownloadCallback& callback); | 195 const AttachmentService::GetOrDownloadCallback& callback); |
196 }; | 196 }; |
197 | 197 |
198 // gmock printer helper. | 198 // gmock printer helper. |
199 void PrintTo(const SyncData& sync_data, std::ostream* os); | 199 void PrintTo(const SyncData& sync_data, std::ostream* os); |
200 | 200 |
201 typedef std::vector<SyncData> SyncDataList; | 201 using SyncDataList = std::vector<SyncData>; |
202 | 202 |
203 } // namespace syncer | 203 } // namespace syncer |
204 | 204 |
205 #endif // COMPONENTS_SYNC_MODEL_SYNC_DATA_H_ | 205 #endif // COMPONENTS_SYNC_MODEL_SYNC_DATA_H_ |
OLD | NEW |