| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include "base/time.h" | 9 #include "base/time.h" |
| 10 #include "base/values.h" | 10 #include "base/values.h" |
| (...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 209 inline void put(MetahandleField field, int64 value) { | 209 inline void put(MetahandleField field, int64 value) { |
| 210 int64_fields[field - INT64_FIELDS_BEGIN] = value; | 210 int64_fields[field - INT64_FIELDS_BEGIN] = value; |
| 211 } | 211 } |
| 212 inline void put(Int64Field field, int64 value) { | 212 inline void put(Int64Field field, int64 value) { |
| 213 int64_fields[field - INT64_FIELDS_BEGIN] = value; | 213 int64_fields[field - INT64_FIELDS_BEGIN] = value; |
| 214 } | 214 } |
| 215 inline void put(TimeField field, const base::Time& value) { | 215 inline void put(TimeField field, const base::Time& value) { |
| 216 // Round-trip to proto time format and back so that we have | 216 // Round-trip to proto time format and back so that we have |
| 217 // consistent time resolutions (ms). | 217 // consistent time resolutions (ms). |
| 218 time_fields[field - TIME_FIELDS_BEGIN] = | 218 time_fields[field - TIME_FIELDS_BEGIN] = |
| 219 csync::ProtoTimeToTime( | 219 syncer::ProtoTimeToTime( |
| 220 csync::TimeToProtoTime(value)); | 220 syncer::TimeToProtoTime(value)); |
| 221 } | 221 } |
| 222 inline void put(IdField field, const Id& value) { | 222 inline void put(IdField field, const Id& value) { |
| 223 id_fields[field - ID_FIELDS_BEGIN] = value; | 223 id_fields[field - ID_FIELDS_BEGIN] = value; |
| 224 } | 224 } |
| 225 inline void put(BaseVersion field, int64 value) { | 225 inline void put(BaseVersion field, int64 value) { |
| 226 int64_fields[field - INT64_FIELDS_BEGIN] = value; | 226 int64_fields[field - INT64_FIELDS_BEGIN] = value; |
| 227 } | 227 } |
| 228 inline void put(IndexedBitField field, bool value) { | 228 inline void put(IndexedBitField field, bool value) { |
| 229 bit_fields[field - BIT_FIELDS_BEGIN] = value; | 229 bit_fields[field - BIT_FIELDS_BEGIN] = value; |
| 230 } | 230 } |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 300 // Tracks whether this entry needs to be saved to the database. | 300 // Tracks whether this entry needs to be saved to the database. |
| 301 bool dirty_; | 301 bool dirty_; |
| 302 }; | 302 }; |
| 303 | 303 |
| 304 struct EntryKernelMutation { | 304 struct EntryKernelMutation { |
| 305 EntryKernel original, mutated; | 305 EntryKernel original, mutated; |
| 306 }; | 306 }; |
| 307 | 307 |
| 308 typedef std::map<int64, EntryKernelMutation> EntryKernelMutationMap; | 308 typedef std::map<int64, EntryKernelMutation> EntryKernelMutationMap; |
| 309 | 309 |
| 310 typedef csync::Immutable<EntryKernelMutationMap> | 310 typedef syncer::Immutable<EntryKernelMutationMap> |
| 311 ImmutableEntryKernelMutationMap; | 311 ImmutableEntryKernelMutationMap; |
| 312 | 312 |
| 313 // Caller owns the return value. | 313 // Caller owns the return value. |
| 314 base::DictionaryValue* EntryKernelMutationToValue( | 314 base::DictionaryValue* EntryKernelMutationToValue( |
| 315 const EntryKernelMutation& mutation); | 315 const EntryKernelMutation& mutation); |
| 316 | 316 |
| 317 // Caller owns the return value. | 317 // Caller owns the return value. |
| 318 base::ListValue* EntryKernelMutationMapToValue( | 318 base::ListValue* EntryKernelMutationMapToValue( |
| 319 const EntryKernelMutationMap& mutations); | 319 const EntryKernelMutationMap& mutations); |
| 320 | 320 |
| 321 } // namespace syncable | 321 } // namespace syncable |
| 322 | 322 |
| 323 #endif // SYNC_SYNCABLE_ENTRY_KERNEL_H_ | 323 #endif // SYNC_SYNCABLE_ENTRY_KERNEL_H_ |
| OLD | NEW |