| 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> |
| (...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 133 UNIQUE_BOOKMARK_TAG, // Client tags for bookmark items | 133 UNIQUE_BOOKMARK_TAG, // Client tags for bookmark items |
| 134 STRING_FIELDS_END, | 134 STRING_FIELDS_END, |
| 135 }; | 135 }; |
| 136 | 136 |
| 137 enum { | 137 enum { |
| 138 STRING_FIELDS_COUNT = STRING_FIELDS_END - STRING_FIELDS_BEGIN, | 138 STRING_FIELDS_COUNT = STRING_FIELDS_END - STRING_FIELDS_BEGIN, |
| 139 PROTO_FIELDS_BEGIN = STRING_FIELDS_END | 139 PROTO_FIELDS_BEGIN = STRING_FIELDS_END |
| 140 }; | 140 }; |
| 141 | 141 |
| 142 // From looking at the sqlite3 docs, it's not directly stated, but it | 142 // From looking at the sqlite3 docs, it's not directly stated, but it |
| 143 // seems the overhead for storing a NULL blob is very small. | 143 // seems the overhead for storing a null blob is very small. |
| 144 enum ProtoField { | 144 enum ProtoField { |
| 145 SPECIFICS = PROTO_FIELDS_BEGIN, | 145 SPECIFICS = PROTO_FIELDS_BEGIN, |
| 146 SERVER_SPECIFICS, | 146 SERVER_SPECIFICS, |
| 147 BASE_SERVER_SPECIFICS, | 147 BASE_SERVER_SPECIFICS, |
| 148 PROTO_FIELDS_END, | 148 PROTO_FIELDS_END, |
| 149 }; | 149 }; |
| 150 | 150 |
| 151 enum { | 151 enum { |
| 152 PROTO_FIELDS_COUNT = PROTO_FIELDS_END - PROTO_FIELDS_BEGIN, | 152 PROTO_FIELDS_COUNT = PROTO_FIELDS_END - PROTO_FIELDS_BEGIN, |
| 153 UNIQUE_POSITION_FIELDS_BEGIN = PROTO_FIELDS_END | 153 UNIQUE_POSITION_FIELDS_BEGIN = PROTO_FIELDS_END |
| (...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 366 } | 366 } |
| 367 | 367 |
| 368 ModelType GetModelType() const; | 368 ModelType GetModelType() const; |
| 369 ModelType GetServerModelType() const; | 369 ModelType GetServerModelType() const; |
| 370 bool ShouldMaintainPosition() const; | 370 bool ShouldMaintainPosition() const; |
| 371 bool ShouldMaintainHierarchy() const; | 371 bool ShouldMaintainHierarchy() const; |
| 372 | 372 |
| 373 // Dumps all kernel info into a DictionaryValue and returns it. | 373 // Dumps all kernel info into a DictionaryValue and returns it. |
| 374 // Transfers ownership of the DictionaryValue to the caller. | 374 // Transfers ownership of the DictionaryValue to the caller. |
| 375 // Note: |cryptographer| is an optional parameter for use in decrypting | 375 // Note: |cryptographer| is an optional parameter for use in decrypting |
| 376 // encrypted specifics. If it is NULL or the specifics are not decryptsble, | 376 // encrypted specifics. If it is null or the specifics are not decryptsble, |
| 377 // they will be serialized as empty proto's. | 377 // they will be serialized as empty proto's. |
| 378 base::DictionaryValue* ToValue(Cryptographer* cryptographer) const; | 378 base::DictionaryValue* ToValue(Cryptographer* cryptographer) const; |
| 379 | 379 |
| 380 private: | 380 private: |
| 381 // Tracks whether this entry needs to be saved to the database. | 381 // Tracks whether this entry needs to be saved to the database. |
| 382 bool dirty_; | 382 bool dirty_; |
| 383 }; | 383 }; |
| 384 | 384 |
| 385 template <typename T> | 385 template <typename T> |
| 386 class EntryKernelLessByMetaHandle { | 386 class EntryKernelLessByMetaHandle { |
| (...skipping 25 matching lines...) Expand all 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 |