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()); |
250 id_fields[field - ID_FIELDS_BEGIN] = value; | 251 id_fields[field - ID_FIELDS_BEGIN] = value; |
251 } | 252 } |
252 inline void put(BaseVersion field, int64 value) { | 253 inline void put(BaseVersion field, int64 value) { |
253 int64_fields[field - INT64_FIELDS_BEGIN] = value; | 254 int64_fields[field - INT64_FIELDS_BEGIN] = value; |
254 } | 255 } |
255 inline void put(IndexedBitField field, bool value) { | 256 inline void put(IndexedBitField field, bool value) { |
256 bit_fields[field - BIT_FIELDS_BEGIN] = value; | 257 bit_fields[field - BIT_FIELDS_BEGIN] = value; |
257 } | 258 } |
258 inline void put(IsDelField field, bool value) { | 259 inline void put(IsDelField field, bool value) { |
259 bit_fields[field - BIT_FIELDS_BEGIN] = value; | 260 bit_fields[field - BIT_FIELDS_BEGIN] = value; |
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
380 const EntryKernelMutation& mutation); | 381 const EntryKernelMutation& mutation); |
381 | 382 |
382 // Caller owns the return value. | 383 // Caller owns the return value. |
383 base::ListValue* EntryKernelMutationMapToValue( | 384 base::ListValue* EntryKernelMutationMapToValue( |
384 const EntryKernelMutationMap& mutations); | 385 const EntryKernelMutationMap& mutations); |
385 | 386 |
386 } // namespace syncable | 387 } // namespace syncable |
387 } // namespace syncer | 388 } // namespace syncer |
388 | 389 |
389 #endif // SYNC_SYNCABLE_ENTRY_KERNEL_H_ | 390 #endif // SYNC_SYNCABLE_ENTRY_KERNEL_H_ |
OLD | NEW |