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