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_SYNCABLE_ENTRY_KERNEL_H_ | 5 #ifndef COMPONENTS_SYNC_SYNCABLE_ENTRY_KERNEL_H_ |
6 #define COMPONENTS_SYNC_SYNCABLE_ENTRY_KERNEL_H_ | 6 #define COMPONENTS_SYNC_SYNCABLE_ENTRY_KERNEL_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <algorithm> | 10 #include <algorithm> |
11 #include <map> | 11 #include <map> |
| 12 #include <memory> |
12 #include <set> | 13 #include <set> |
13 #include <string> | 14 #include <string> |
14 | 15 |
15 #include "base/time/time.h" | 16 #include "base/time/time.h" |
16 #include "base/values.h" | 17 #include "base/values.h" |
17 #include "components/sync/base/immutable.h" | 18 #include "components/sync/base/immutable.h" |
18 #include "components/sync/base/model_type.h" | 19 #include "components/sync/base/model_type.h" |
19 #include "components/sync/base/proto_value_ptr.h" | 20 #include "components/sync/base/proto_value_ptr.h" |
20 #include "components/sync/base/time.h" | 21 #include "components/sync/base/time.h" |
21 #include "components/sync/base/unique_position.h" | 22 #include "components/sync/base/unique_position.h" |
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
187 // and was therefore in the middle of a commit operation. | 188 // and was therefore in the middle of a commit operation. |
188 // Note: must only be set if SYNCING is true. | 189 // Note: must only be set if SYNCING is true. |
189 DIRTY_SYNC, | 190 DIRTY_SYNC, |
190 BIT_TEMPS_END, | 191 BIT_TEMPS_END, |
191 }; | 192 }; |
192 | 193 |
193 enum { BIT_TEMPS_COUNT = BIT_TEMPS_END - BIT_TEMPS_BEGIN }; | 194 enum { BIT_TEMPS_COUNT = BIT_TEMPS_END - BIT_TEMPS_BEGIN }; |
194 | 195 |
195 struct EntryKernel { | 196 struct EntryKernel { |
196 private: | 197 private: |
197 typedef syncer::ProtoValuePtr<sync_pb::EntitySpecifics> EntitySpecificsPtr; | 198 typedef ProtoValuePtr<sync_pb::EntitySpecifics> EntitySpecificsPtr; |
198 typedef syncer::ProtoValuePtr<sync_pb::AttachmentMetadata> | 199 typedef ProtoValuePtr<sync_pb::AttachmentMetadata> AttachmentMetadataPtr; |
199 AttachmentMetadataPtr; | |
200 | 200 |
201 std::string string_fields[STRING_FIELDS_COUNT]; | 201 std::string string_fields[STRING_FIELDS_COUNT]; |
202 EntitySpecificsPtr specifics_fields[PROTO_FIELDS_COUNT]; | 202 EntitySpecificsPtr specifics_fields[PROTO_FIELDS_COUNT]; |
203 int64_t int64_fields[INT64_FIELDS_COUNT]; | 203 int64_t int64_fields[INT64_FIELDS_COUNT]; |
204 base::Time time_fields[TIME_FIELDS_COUNT]; | 204 base::Time time_fields[TIME_FIELDS_COUNT]; |
205 Id id_fields[ID_FIELDS_COUNT]; | 205 Id id_fields[ID_FIELDS_COUNT]; |
206 UniquePosition unique_position_fields[UNIQUE_POSITION_FIELDS_COUNT]; | 206 UniquePosition unique_position_fields[UNIQUE_POSITION_FIELDS_COUNT]; |
207 AttachmentMetadataPtr | 207 AttachmentMetadataPtr |
208 attachment_metadata_fields[ATTACHMENT_METADATA_FIELDS_COUNT]; | 208 attachment_metadata_fields[ATTACHMENT_METADATA_FIELDS_COUNT]; |
209 std::bitset<BIT_FIELDS_COUNT> bit_fields; | 209 std::bitset<BIT_FIELDS_COUNT> bit_fields; |
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
412 | 412 |
413 std::unique_ptr<base::ListValue> EntryKernelMutationMapToValue( | 413 std::unique_ptr<base::ListValue> EntryKernelMutationMapToValue( |
414 const EntryKernelMutationMap& mutations); | 414 const EntryKernelMutationMap& mutations); |
415 | 415 |
416 std::ostream& operator<<(std::ostream& os, const EntryKernel& entry_kernel); | 416 std::ostream& operator<<(std::ostream& os, const EntryKernel& entry_kernel); |
417 | 417 |
418 } // namespace syncable | 418 } // namespace syncable |
419 } // namespace syncer | 419 } // namespace syncer |
420 | 420 |
421 #endif // COMPONENTS_SYNC_SYNCABLE_ENTRY_KERNEL_H_ | 421 #endif // COMPONENTS_SYNC_SYNCABLE_ENTRY_KERNEL_H_ |
OLD | NEW |