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 SYNC_SYNCABLE_ENTRY_KERNEL_H_ | 5 #ifndef SYNC_SYNCABLE_ENTRY_KERNEL_H_ |
6 #define SYNC_SYNCABLE_ENTRY_KERNEL_H_ | 6 #define SYNC_SYNCABLE_ENTRY_KERNEL_H_ |
7 | 7 |
8 #include <set> | 8 #include <set> |
9 | 9 |
10 #include "base/time/time.h" | 10 #include "base/time/time.h" |
(...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
240 inline void put(Int64Field field, int64 value) { | 240 inline void put(Int64Field field, int64 value) { |
241 int64_fields[field - INT64_FIELDS_BEGIN] = value; | 241 int64_fields[field - INT64_FIELDS_BEGIN] = value; |
242 } | 242 } |
243 inline void put(TimeField field, const base::Time& value) { | 243 inline void put(TimeField field, const base::Time& value) { |
244 // Round-trip to proto time format and back so that we have | 244 // Round-trip to proto time format and back so that we have |
245 // consistent time resolutions (ms). | 245 // consistent time resolutions (ms). |
246 time_fields[field - TIME_FIELDS_BEGIN] = | 246 time_fields[field - TIME_FIELDS_BEGIN] = |
247 ProtoTimeToTime(TimeToProtoTime(value)); | 247 ProtoTimeToTime(TimeToProtoTime(value)); |
248 } | 248 } |
249 inline void put(IdField field, const Id& value) { | 249 inline void put(IdField field, const Id& value) { |
250 DCHECK(!value.IsNull()); | |
251 id_fields[field - ID_FIELDS_BEGIN] = value; | 250 id_fields[field - ID_FIELDS_BEGIN] = value; |
252 } | 251 } |
253 inline void put(BaseVersion field, int64 value) { | 252 inline void put(BaseVersion field, int64 value) { |
254 int64_fields[field - INT64_FIELDS_BEGIN] = value; | 253 int64_fields[field - INT64_FIELDS_BEGIN] = value; |
255 } | 254 } |
256 inline void put(IndexedBitField field, bool value) { | 255 inline void put(IndexedBitField field, bool value) { |
257 bit_fields[field - BIT_FIELDS_BEGIN] = value; | 256 bit_fields[field - BIT_FIELDS_BEGIN] = value; |
258 } | 257 } |
259 inline void put(IsDelField field, bool value) { | 258 inline void put(IsDelField field, bool value) { |
260 bit_fields[field - BIT_FIELDS_BEGIN] = value; | 259 bit_fields[field - BIT_FIELDS_BEGIN] = value; |
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
381 const EntryKernelMutation& mutation); | 380 const EntryKernelMutation& mutation); |
382 | 381 |
383 // Caller owns the return value. | 382 // Caller owns the return value. |
384 base::ListValue* EntryKernelMutationMapToValue( | 383 base::ListValue* EntryKernelMutationMapToValue( |
385 const EntryKernelMutationMap& mutations); | 384 const EntryKernelMutationMap& mutations); |
386 | 385 |
387 } // namespace syncable | 386 } // namespace syncable |
388 } // namespace syncer | 387 } // namespace syncer |
389 | 388 |
390 #endif // SYNC_SYNCABLE_ENTRY_KERNEL_H_ | 389 #endif // SYNC_SYNCABLE_ENTRY_KERNEL_H_ |
OLD | NEW |