| 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_INTERNAL_API_PUBLIC_WRITE_TRANSACTION_H_ | 5 #ifndef SYNC_INTERNAL_API_PUBLIC_WRITE_TRANSACTION_H_ |
| 6 #define SYNC_INTERNAL_API_PUBLIC_WRITE_TRANSACTION_H_ | 6 #define SYNC_INTERNAL_API_PUBLIC_WRITE_TRANSACTION_H_ |
| 7 | 7 |
| 8 #include <stddef.h> |
| 9 #include <stdint.h> |
| 10 |
| 8 #include <string> | 11 #include <string> |
| 9 | 12 |
| 10 #include "base/basictypes.h" | |
| 11 #include "base/compiler_specific.h" | 13 #include "base/compiler_specific.h" |
| 14 #include "base/macros.h" |
| 12 #include "sync/api/sync_change_processor.h" | 15 #include "sync/api/sync_change_processor.h" |
| 13 #include "sync/base/sync_export.h" | 16 #include "sync/base/sync_export.h" |
| 14 #include "sync/internal_api/public/base_transaction.h" | 17 #include "sync/internal_api/public/base_transaction.h" |
| 15 | 18 |
| 16 namespace tracked_objects { | 19 namespace tracked_objects { |
| 17 class Location; | 20 class Location; |
| 18 } // namespace tracked_objects | 21 } // namespace tracked_objects |
| 19 | 22 |
| 20 namespace syncer { | 23 namespace syncer { |
| 21 | 24 |
| (...skipping 10 matching lines...) Expand all Loading... |
| 32 class SYNC_EXPORT WriteTransaction : public BaseTransaction { | 35 class SYNC_EXPORT WriteTransaction : public BaseTransaction { |
| 33 public: | 36 public: |
| 34 // Start a new read/write transaction. | 37 // Start a new read/write transaction. |
| 35 WriteTransaction(const tracked_objects::Location& from_here, | 38 WriteTransaction(const tracked_objects::Location& from_here, |
| 36 UserShare* share); | 39 UserShare* share); |
| 37 // |transaction_version| stores updated model and nodes version if model | 40 // |transaction_version| stores updated model and nodes version if model |
| 38 // is changed by the transaction, or syncer::syncable::kInvalidTransaction | 41 // is changed by the transaction, or syncer::syncable::kInvalidTransaction |
| 39 // if not after transaction is closed. This constructor is used for model | 42 // if not after transaction is closed. This constructor is used for model |
| 40 // types that support embassy data. | 43 // types that support embassy data. |
| 41 WriteTransaction(const tracked_objects::Location& from_here, | 44 WriteTransaction(const tracked_objects::Location& from_here, |
| 42 UserShare* share, int64* transaction_version); | 45 UserShare* share, |
| 46 int64_t* transaction_version); |
| 43 ~WriteTransaction() override; | 47 ~WriteTransaction() override; |
| 44 | 48 |
| 45 // Provide access to the syncable transaction from the API WriteNode. | 49 // Provide access to the syncable transaction from the API WriteNode. |
| 46 syncable::BaseTransaction* GetWrappedTrans() const override; | 50 syncable::BaseTransaction* GetWrappedTrans() const override; |
| 47 syncable::WriteTransaction* GetWrappedWriteTrans() { return transaction_; } | 51 syncable::WriteTransaction* GetWrappedWriteTrans() { return transaction_; } |
| 48 | 52 |
| 49 // Set's a |type|'s local context. |refresh_status| controls whether | 53 // Set's a |type|'s local context. |refresh_status| controls whether |
| 50 // a datatype refresh is performed (clearing the progress marker token and | 54 // a datatype refresh is performed (clearing the progress marker token and |
| 51 // setting the version of all synced entities to 1). | 55 // setting the version of all synced entities to 1). |
| 52 void SetDataTypeContext( | 56 void SetDataTypeContext( |
| (...skipping 17 matching lines...) Expand all Loading... |
| 70 | 74 |
| 71 // The underlying syncable object which this class wraps. | 75 // The underlying syncable object which this class wraps. |
| 72 syncable::WriteTransaction* transaction_; | 76 syncable::WriteTransaction* transaction_; |
| 73 | 77 |
| 74 DISALLOW_COPY_AND_ASSIGN(WriteTransaction); | 78 DISALLOW_COPY_AND_ASSIGN(WriteTransaction); |
| 75 }; | 79 }; |
| 76 | 80 |
| 77 } // namespace syncer | 81 } // namespace syncer |
| 78 | 82 |
| 79 #endif // SYNC_INTERNAL_API_PUBLIC_WRITE_TRANSACTION_H_ | 83 #endif // SYNC_INTERNAL_API_PUBLIC_WRITE_TRANSACTION_H_ |
| OLD | NEW |