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_BASE_TRANSACTION_H_ | 5 #ifndef COMPONENTS_SYNC_CORE_BASE_TRANSACTION_H_ |
6 #define SYNC_INTERNAL_API_PUBLIC_BASE_TRANSACTION_H_ | 6 #define COMPONENTS_SYNC_CORE_BASE_TRANSACTION_H_ |
7 | 7 |
8 #include "base/macros.h" | 8 #include "base/macros.h" |
9 #include "sync/base/sync_export.h" | 9 #include "components/sync/base/cryptographer.h" |
10 #include "sync/internal_api/public/base/model_type.h" | 10 #include "components/sync/base/model_type.h" |
11 #include "sync/internal_api/public/user_share.h" | 11 #include "components/sync/base/sync_export.h" |
12 #include "sync/util/cryptographer.h" | 12 #include "components/sync/core/user_share.h" |
13 | 13 |
14 namespace syncer { | 14 namespace syncer { |
15 | 15 |
16 namespace syncable { | 16 namespace syncable { |
17 class BaseTransaction; | 17 class BaseTransaction; |
18 class Directory; | 18 class Directory; |
19 } | 19 } |
20 | 20 |
21 // Sync API's BaseTransaction, ReadTransaction, and WriteTransaction allow for | 21 // Sync API's BaseTransaction, ReadTransaction, and WriteTransaction allow for |
22 // batching of several read and/or write operations. The read and write | 22 // batching of several read and/or write operations. The read and write |
(...skipping 13 matching lines...) Expand all Loading... |
36 ModelTypeSet GetEncryptedTypes() const; | 36 ModelTypeSet GetEncryptedTypes() const; |
37 | 37 |
38 syncable::Directory* GetDirectory() const { | 38 syncable::Directory* GetDirectory() const { |
39 if (!user_share_) { | 39 if (!user_share_) { |
40 return NULL; | 40 return NULL; |
41 } else { | 41 } else { |
42 return user_share_->directory.get(); | 42 return user_share_->directory.get(); |
43 } | 43 } |
44 } | 44 } |
45 | 45 |
46 UserShare* GetUserShare() const { | 46 UserShare* GetUserShare() const { return user_share_; } |
47 return user_share_; | |
48 } | |
49 | 47 |
50 protected: | 48 protected: |
51 explicit BaseTransaction(UserShare* share); | 49 explicit BaseTransaction(UserShare* share); |
52 virtual ~BaseTransaction(); | 50 virtual ~BaseTransaction(); |
53 | 51 |
54 BaseTransaction() : user_share_(NULL) { } | 52 BaseTransaction() : user_share_(NULL) {} |
55 | 53 |
56 private: | 54 private: |
57 UserShare* user_share_; | 55 UserShare* user_share_; |
58 | 56 |
59 DISALLOW_COPY_AND_ASSIGN(BaseTransaction); | 57 DISALLOW_COPY_AND_ASSIGN(BaseTransaction); |
60 }; | 58 }; |
61 | 59 |
62 } // namespace syncer | 60 } // namespace syncer |
63 | 61 |
64 #endif // SYNC_INTERNAL_API_PUBLIC_BASE_TRANSACTION_H_ | 62 #endif // COMPONENTS_SYNC_CORE_BASE_TRANSACTION_H_ |
OLD | NEW |