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_READ_TRANSACTION_H_ | 5 #ifndef COMPONENTS_SYNC_CORE_READ_TRANSACTION_H_ |
6 #define SYNC_INTERNAL_API_PUBLIC_READ_TRANSACTION_H_ | 6 #define COMPONENTS_SYNC_CORE_READ_TRANSACTION_H_ |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 #include <stdint.h> | 9 #include <stdint.h> |
10 | 10 |
11 #include <string> | 11 #include <string> |
12 | 12 |
13 #include "base/compiler_specific.h" | 13 #include "base/compiler_specific.h" |
14 #include "base/macros.h" | 14 #include "base/macros.h" |
15 #include "sync/api/attachments/attachment_id.h" | 15 #include "components/sync/api/attachments/attachment_id.h" |
16 #include "sync/base/sync_export.h" | 16 #include "components/sync/base/sync_export.h" |
17 #include "sync/internal_api/public/base_transaction.h" | 17 #include "components/sync/core/base_transaction.h" |
18 | 18 |
19 namespace tracked_objects { | 19 namespace tracked_objects { |
20 class Location; | 20 class Location; |
21 } // namespace tracked_objects | 21 } // namespace tracked_objects |
22 | 22 |
23 namespace sync_pb { | 23 namespace sync_pb { |
24 class DataTypeContext; | 24 class DataTypeContext; |
25 } | 25 } |
26 | 26 |
27 namespace syncer { | 27 namespace syncer { |
28 | 28 |
29 struct UserShare; | 29 struct UserShare; |
30 | 30 |
31 // Sync API's ReadTransaction is a read-only BaseTransaction. It wraps | 31 // Sync API's ReadTransaction is a read-only BaseTransaction. It wraps |
32 // a syncable::ReadTransaction. | 32 // a syncable::ReadTransaction. |
33 class SYNC_EXPORT ReadTransaction : public BaseTransaction { | 33 class SYNC_EXPORT ReadTransaction : public BaseTransaction { |
34 public: | 34 public: |
35 // Start a new read-only transaction on the specified repository. | 35 // Start a new read-only transaction on the specified repository. |
36 ReadTransaction(const tracked_objects::Location& from_here, | 36 ReadTransaction(const tracked_objects::Location& from_here, UserShare* share); |
37 UserShare* share); | |
38 | 37 |
39 // Resume the middle of a transaction. Will not close transaction. | 38 // Resume the middle of a transaction. Will not close transaction. |
40 ReadTransaction(UserShare* share, syncable::BaseTransaction* trans); | 39 ReadTransaction(UserShare* share, syncable::BaseTransaction* trans); |
41 | 40 |
42 ~ReadTransaction() override; | 41 ~ReadTransaction() override; |
43 | 42 |
44 // BaseTransaction override. | 43 // BaseTransaction override. |
45 syncable::BaseTransaction* GetWrappedTrans() const override; | 44 syncable::BaseTransaction* GetWrappedTrans() const override; |
46 | 45 |
47 // Return |transaction_version| of |type| stored in sync directory's | 46 // Return |transaction_version| of |type| stored in sync directory's |
(...skipping 16 matching lines...) Expand all Loading... |
64 | 63 |
65 // The underlying syncable object which this class wraps. | 64 // The underlying syncable object which this class wraps. |
66 syncable::BaseTransaction* transaction_; | 65 syncable::BaseTransaction* transaction_; |
67 bool close_transaction_; | 66 bool close_transaction_; |
68 | 67 |
69 DISALLOW_COPY_AND_ASSIGN(ReadTransaction); | 68 DISALLOW_COPY_AND_ASSIGN(ReadTransaction); |
70 }; | 69 }; |
71 | 70 |
72 } // namespace syncer | 71 } // namespace syncer |
73 | 72 |
74 #endif // SYNC_INTERNAL_API_PUBLIC_READ_TRANSACTION_H_ | 73 #endif // COMPONENTS_SYNC_CORE_READ_TRANSACTION_H_ |
OLD | NEW |