Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(80)

Side by Side Diff: components/sync/core/base_transaction.h

Issue 2240613002: [Sync] Convert sync to a static library. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Try getting rid of sync_core source set. Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « components/sync/core/base_node.h ('k') | components/sync/core/change_record.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 COMPONENTS_SYNC_CORE_BASE_TRANSACTION_H_ 5 #ifndef COMPONENTS_SYNC_CORE_BASE_TRANSACTION_H_
6 #define COMPONENTS_SYNC_CORE_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 "components/sync/base/cryptographer.h" 9 #include "components/sync/base/cryptographer.h"
10 #include "components/sync/base/model_type.h" 10 #include "components/sync/base/model_type.h"
11 #include "components/sync/base/sync_export.h"
12 #include "components/sync/core/user_share.h" 11 #include "components/sync/core/user_share.h"
13 12
14 namespace syncer { 13 namespace syncer {
15 14
16 namespace syncable { 15 namespace syncable {
17 class BaseTransaction; 16 class BaseTransaction;
18 class Directory; 17 class Directory;
19 } 18 }
20 19
21 // Sync API's BaseTransaction, ReadTransaction, and WriteTransaction allow for 20 // Sync API's BaseTransaction, ReadTransaction, and WriteTransaction allow for
22 // batching of several read and/or write operations. The read and write 21 // batching of several read and/or write operations. The read and write
23 // operations are performed by creating ReadNode and WriteNode instances using 22 // operations are performed by creating ReadNode and WriteNode instances using
24 // the transaction. These transaction classes wrap identically named classes in 23 // the transaction. These transaction classes wrap identically named classes in
25 // syncable, and are used in a similar way. Unlike syncable::BaseTransaction, 24 // syncable, and are used in a similar way. Unlike syncable::BaseTransaction,
26 // whose construction requires an explicit syncable::Directory, a sync 25 // whose construction requires an explicit syncable::Directory, a sync
27 // API BaseTransaction is created from a UserShare object. 26 // API BaseTransaction is created from a UserShare object.
28 // 27 //
29 // Note, these transactions are not atomic. Individual operations can 28 // Note, these transactions are not atomic. Individual operations can
30 // fail. There is no built-in rollback or undo mechanism. 29 // fail. There is no built-in rollback or undo mechanism.
31 class SYNC_EXPORT BaseTransaction { 30 class BaseTransaction {
32 public: 31 public:
33 // Provide access to the underlying syncable objects from BaseNode. 32 // Provide access to the underlying syncable objects from BaseNode.
34 virtual syncable::BaseTransaction* GetWrappedTrans() const = 0; 33 virtual syncable::BaseTransaction* GetWrappedTrans() const = 0;
35 Cryptographer* GetCryptographer() const; 34 Cryptographer* GetCryptographer() const;
36 ModelTypeSet GetEncryptedTypes() const; 35 ModelTypeSet GetEncryptedTypes() const;
37 36
38 syncable::Directory* GetDirectory() const { 37 syncable::Directory* GetDirectory() const {
39 if (!user_share_) { 38 if (!user_share_) {
40 return NULL; 39 return NULL;
41 } else { 40 } else {
(...skipping 11 matching lines...) Expand all
53 52
54 private: 53 private:
55 UserShare* user_share_; 54 UserShare* user_share_;
56 55
57 DISALLOW_COPY_AND_ASSIGN(BaseTransaction); 56 DISALLOW_COPY_AND_ASSIGN(BaseTransaction);
58 }; 57 };
59 58
60 } // namespace syncer 59 } // namespace syncer
61 60
62 #endif // COMPONENTS_SYNC_CORE_BASE_TRANSACTION_H_ 61 #endif // COMPONENTS_SYNC_CORE_BASE_TRANSACTION_H_
OLDNEW
« no previous file with comments | « components/sync/core/base_node.h ('k') | components/sync/core/change_record.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698