| OLD | NEW |
| 1 // Copyright (c) 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 "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
| 10 #include "sync/base/sync_export.h" |
| 10 #include "sync/internal_api/public/base_transaction.h" | 11 #include "sync/internal_api/public/base_transaction.h" |
| 11 | 12 |
| 12 namespace tracked_objects { | 13 namespace tracked_objects { |
| 13 class Location; | 14 class Location; |
| 14 } // namespace tracked_objects | 15 } // namespace tracked_objects |
| 15 | 16 |
| 16 namespace syncer { | 17 namespace syncer { |
| 17 | 18 |
| 18 namespace syncable { | 19 namespace syncable { |
| 19 class BaseTransaction; | 20 class BaseTransaction; |
| 20 class WriteTransaction; | 21 class WriteTransaction; |
| 21 } // namespace syncable | 22 } // namespace syncable |
| 22 | 23 |
| 23 // Sync API's WriteTransaction is a read/write BaseTransaction. It wraps | 24 // Sync API's WriteTransaction is a read/write BaseTransaction. It wraps |
| 24 // a syncable::WriteTransaction. | 25 // a syncable::WriteTransaction. |
| 25 // | 26 // |
| 26 // NOTE: Only a single model type can be mutated for a given | 27 // NOTE: Only a single model type can be mutated for a given |
| 27 // WriteTransaction. | 28 // WriteTransaction. |
| 28 class WriteTransaction : public BaseTransaction { | 29 class SYNC_EXPORT WriteTransaction : public BaseTransaction { |
| 29 public: | 30 public: |
| 30 // Start a new read/write transaction. | 31 // Start a new read/write transaction. |
| 31 WriteTransaction(const tracked_objects::Location& from_here, | 32 WriteTransaction(const tracked_objects::Location& from_here, |
| 32 UserShare* share); | 33 UserShare* share); |
| 33 // |transaction_version| stores updated model and nodes version if model | 34 // |transaction_version| stores updated model and nodes version if model |
| 34 // is changed by the transaction, or syncer::syncable::kInvalidTransaction | 35 // is changed by the transaction, or syncer::syncable::kInvalidTransaction |
| 35 // if not after transaction is closed. This constructor is used for model | 36 // if not after transaction is closed. This constructor is used for model |
| 36 // types that support embassy data. | 37 // types that support embassy data. |
| 37 WriteTransaction(const tracked_objects::Location& from_here, | 38 WriteTransaction(const tracked_objects::Location& from_here, |
| 38 UserShare* share, int64* transaction_version); | 39 UserShare* share, int64* transaction_version); |
| (...skipping 15 matching lines...) Expand all Loading... |
| 54 | 55 |
| 55 // The underlying syncable object which this class wraps. | 56 // The underlying syncable object which this class wraps. |
| 56 syncable::WriteTransaction* transaction_; | 57 syncable::WriteTransaction* transaction_; |
| 57 | 58 |
| 58 DISALLOW_COPY_AND_ASSIGN(WriteTransaction); | 59 DISALLOW_COPY_AND_ASSIGN(WriteTransaction); |
| 59 }; | 60 }; |
| 60 | 61 |
| 61 } // namespace syncer | 62 } // namespace syncer |
| 62 | 63 |
| 63 #endif // SYNC_INTERNAL_API_PUBLIC_WRITE_TRANSACTION_H_ | 64 #endif // SYNC_INTERNAL_API_PUBLIC_WRITE_TRANSACTION_H_ |
| OLD | NEW |