| 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_WRITE_TRANSACTION_INFO_H_ | 5 #ifndef COMPONENTS_SYNC_SYNCABLE_WRITE_TRANSACTION_INFO_H_ |
| 6 #define COMPONENTS_SYNC_SYNCABLE_WRITE_TRANSACTION_INFO_H_ | 6 #define COMPONENTS_SYNC_SYNCABLE_WRITE_TRANSACTION_INFO_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 #include <stdint.h> | 9 #include <stdint.h> |
| 10 | 10 |
| 11 #include <memory> |
| 11 #include <string> | 12 #include <string> |
| 12 | 13 |
| 14 #include "base/values.h" |
| 13 #include "components/sync/syncable/entry_kernel.h" | 15 #include "components/sync/syncable/entry_kernel.h" |
| 14 #include "components/sync/syncable/syncable_base_transaction.h" | 16 #include "components/sync/syncable/syncable_base_transaction.h" |
| 15 | 17 |
| 16 namespace syncer { | 18 namespace syncer { |
| 17 namespace syncable { | 19 namespace syncable { |
| 18 | 20 |
| 19 // A struct describing the changes made during a transaction. | 21 // A struct describing the changes made during a transaction. |
| 20 struct WriteTransactionInfo { | 22 struct WriteTransactionInfo { |
| 21 WriteTransactionInfo(int64_t id, | 23 WriteTransactionInfo(int64_t id, |
| 22 tracked_objects::Location location, | 24 tracked_objects::Location location, |
| 23 WriterTag writer, | 25 WriterTag writer, |
| 24 ImmutableEntryKernelMutationMap mutations); | 26 ImmutableEntryKernelMutationMap mutations); |
| 25 WriteTransactionInfo(); | 27 WriteTransactionInfo(); |
| 26 WriteTransactionInfo(const WriteTransactionInfo& other); | 28 WriteTransactionInfo(const WriteTransactionInfo& other); |
| 27 ~WriteTransactionInfo(); | 29 ~WriteTransactionInfo(); |
| 28 | 30 |
| 29 // Caller owns the return value. | 31 std::unique_ptr<base::DictionaryValue> ToValue( |
| 30 base::DictionaryValue* ToValue(size_t max_mutations_size) const; | 32 size_t max_mutations_size) const; |
| 31 | 33 |
| 32 int64_t id; | 34 int64_t id; |
| 33 // If tracked_objects::Location becomes assignable, we can use that | 35 // If tracked_objects::Location becomes assignable, we can use that |
| 34 // instead. | 36 // instead. |
| 35 std::string location_string; | 37 std::string location_string; |
| 36 WriterTag writer; | 38 WriterTag writer; |
| 37 ImmutableEntryKernelMutationMap mutations; | 39 ImmutableEntryKernelMutationMap mutations; |
| 38 }; | 40 }; |
| 39 | 41 |
| 40 using ImmutableWriteTransactionInfo = Immutable<WriteTransactionInfo>; | 42 using ImmutableWriteTransactionInfo = Immutable<WriteTransactionInfo>; |
| 41 | 43 |
| 42 } // namespace syncable | 44 } // namespace syncable |
| 43 } // namespace syncer | 45 } // namespace syncer |
| 44 | 46 |
| 45 #endif // COMPONENTS_SYNC_SYNCABLE_WRITE_TRANSACTION_INFO_H_ | 47 #endif // COMPONENTS_SYNC_SYNCABLE_WRITE_TRANSACTION_INFO_H_ |
| OLD | NEW |