| 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 354 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 365 attachment_metadata_fields[dest - ATTACHMENT_METADATA_FIELDS_BEGIN] = | 365 attachment_metadata_fields[dest - ATTACHMENT_METADATA_FIELDS_BEGIN] = |
| 366 attachment_metadata_fields[src - ATTACHMENT_METADATA_FIELDS_BEGIN]; | 366 attachment_metadata_fields[src - ATTACHMENT_METADATA_FIELDS_BEGIN]; |
| 367 } | 367 } |
| 368 | 368 |
| 369 ModelType GetModelType() const; | 369 ModelType GetModelType() const; |
| 370 ModelType GetServerModelType() const; | 370 ModelType GetServerModelType() const; |
| 371 bool ShouldMaintainPosition() const; | 371 bool ShouldMaintainPosition() const; |
| 372 bool ShouldMaintainHierarchy() const; | 372 bool ShouldMaintainHierarchy() const; |
| 373 | 373 |
| 374 // Dumps all kernel info into a DictionaryValue and returns it. | 374 // Dumps all kernel info into a DictionaryValue and returns it. |
| 375 // Transfers ownership of the DictionaryValue to the caller. | |
| 376 // Note: |cryptographer| is an optional parameter for use in decrypting | 375 // Note: |cryptographer| is an optional parameter for use in decrypting |
| 377 // 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, |
| 378 // they will be serialized as empty proto's. | 377 // they will be serialized as empty proto's. |
| 379 base::DictionaryValue* ToValue(Cryptographer* cryptographer) const; | 378 std::unique_ptr<base::DictionaryValue> ToValue( |
| 379 Cryptographer* cryptographer) const; |
| 380 | 380 |
| 381 size_t EstimateMemoryUsage() const; | 381 size_t EstimateMemoryUsage() const; |
| 382 | 382 |
| 383 private: | 383 private: |
| 384 // Tracks whether this entry needs to be saved to the database. | 384 // Tracks whether this entry needs to be saved to the database. |
| 385 bool dirty_; | 385 bool dirty_; |
| 386 mutable size_t memory_usage_; | 386 mutable size_t memory_usage_; |
| 387 constexpr static size_t kMemoryUsageUnknown = size_t(-1); | 387 constexpr static size_t kMemoryUsageUnknown = size_t(-1); |
| 388 }; | 388 }; |
| 389 | 389 |
| (...skipping 26 matching lines...) Expand all Loading... |
| 416 | 416 |
| 417 std::unique_ptr<base::ListValue> EntryKernelMutationMapToValue( | 417 std::unique_ptr<base::ListValue> EntryKernelMutationMapToValue( |
| 418 const EntryKernelMutationMap& mutations); | 418 const EntryKernelMutationMap& mutations); |
| 419 | 419 |
| 420 std::ostream& operator<<(std::ostream& os, const EntryKernel& entry_kernel); | 420 std::ostream& operator<<(std::ostream& os, const EntryKernel& entry_kernel); |
| 421 | 421 |
| 422 } // namespace syncable | 422 } // namespace syncable |
| 423 } // namespace syncer | 423 } // namespace syncer |
| 424 | 424 |
| 425 #endif // COMPONENTS_SYNC_SYNCABLE_ENTRY_KERNEL_H_ | 425 #endif // COMPONENTS_SYNC_SYNCABLE_ENTRY_KERNEL_H_ |
| OLD | NEW |