| 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_SYNCABLE_WRITE_TRANSACTION_H_ | 5 #ifndef COMPONENTS_SYNC_SYNCABLE_SYNCABLE_WRITE_TRANSACTION_H_ |
| 6 #define COMPONENTS_SYNC_SYNCABLE_SYNCABLE_WRITE_TRANSACTION_H_ | 6 #define COMPONENTS_SYNC_SYNCABLE_SYNCABLE_WRITE_TRANSACTION_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <vector> | 10 #include <vector> |
| 11 | 11 |
| 12 #include "base/macros.h" | 12 #include "base/macros.h" |
| 13 #include "components/sync/base/sync_export.h" | |
| 14 #include "components/sync/syncable/entry_kernel.h" | 13 #include "components/sync/syncable/entry_kernel.h" |
| 15 #include "components/sync/syncable/syncable_base_write_transaction.h" | 14 #include "components/sync/syncable/syncable_base_write_transaction.h" |
| 16 | 15 |
| 17 namespace syncer { | 16 namespace syncer { |
| 18 namespace syncable { | 17 namespace syncable { |
| 19 | 18 |
| 20 SYNC_EXPORT extern const int64_t kInvalidTransactionVersion; | 19 extern const int64_t kInvalidTransactionVersion; |
| 21 | 20 |
| 22 // Locks db in constructor, unlocks in destructor. | 21 // Locks db in constructor, unlocks in destructor. |
| 23 class SYNC_EXPORT WriteTransaction : public BaseWriteTransaction { | 22 class WriteTransaction : public BaseWriteTransaction { |
| 24 public: | 23 public: |
| 25 WriteTransaction(const tracked_objects::Location& from_here, | 24 WriteTransaction(const tracked_objects::Location& from_here, |
| 26 WriterTag writer, | 25 WriterTag writer, |
| 27 Directory* directory); | 26 Directory* directory); |
| 28 | 27 |
| 29 // Constructor used for getting back transaction version after making sync | 28 // Constructor used for getting back transaction version after making sync |
| 30 // API changes to one model. If model is changed by the transaction, | 29 // API changes to one model. If model is changed by the transaction, |
| 31 // the new transaction version of the model and modified nodes will be saved | 30 // the new transaction version of the model and modified nodes will be saved |
| 32 // in |transaction_version| upon destruction of the transaction. If model is | 31 // in |transaction_version| upon destruction of the transaction. If model is |
| 33 // not changed, |transaction_version| will be kInvalidTransactionVersion. | 32 // not changed, |transaction_version| will be kInvalidTransactionVersion. |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 66 // indeed changed. kInvalidTransactionVersion otherwise. Not owned. | 65 // indeed changed. kInvalidTransactionVersion otherwise. Not owned. |
| 67 int64_t* transaction_version_; | 66 int64_t* transaction_version_; |
| 68 | 67 |
| 69 DISALLOW_COPY_AND_ASSIGN(WriteTransaction); | 68 DISALLOW_COPY_AND_ASSIGN(WriteTransaction); |
| 70 }; | 69 }; |
| 71 | 70 |
| 72 } // namespace syncable | 71 } // namespace syncable |
| 73 } // namespace syncer | 72 } // namespace syncer |
| 74 | 73 |
| 75 #endif // COMPONENTS_SYNC_SYNCABLE_SYNCABLE_WRITE_TRANSACTION_H_ | 74 #endif // COMPONENTS_SYNC_SYNCABLE_SYNCABLE_WRITE_TRANSACTION_H_ |
| OLD | NEW |