OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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_SYNCABLE_BASE_TRANSACTION_H_ | 5 #ifndef SYNC_SYNCABLE_BASE_TRANSACTION_H_ |
6 #define SYNC_SYNCABLE_BASE_TRANSACTION_H_ | 6 #define SYNC_SYNCABLE_BASE_TRANSACTION_H_ |
7 | 7 |
8 #include "base/location.h" | 8 #include "base/location.h" |
9 #include "sync/syncable/syncable_id.h" | 9 #include "sync/syncable/syncable_id.h" |
10 | 10 |
11 namespace syncer { | 11 namespace syncer { |
12 namespace syncable { | 12 namespace syncable { |
13 | 13 |
14 class Directory; | 14 class Directory; |
15 | 15 |
16 // A WriteTransaction has a writer tag describing which body of code is doing | 16 // A WriteTransaction has a writer tag describing which body of code is doing |
17 // the write. This is defined up here since WriteTransactionInfo also contains | 17 // the write. This is defined up here since WriteTransactionInfo also contains |
18 // one. | 18 // one. |
19 enum WriterTag { | 19 enum WriterTag { |
20 INVALID, | 20 INVALID, |
21 SYNCER, | 21 SYNCER, |
22 AUTHWATCHER, | 22 AUTHWATCHER, |
23 UNITTEST, | 23 UNITTEST, |
24 VACUUM_AFTER_SAVE, | 24 VACUUM_AFTER_SAVE, |
| 25 HANDLE_SAVE_FAILURE, |
25 PURGE_ENTRIES, | 26 PURGE_ENTRIES, |
26 SYNCAPI | 27 SYNCAPI, |
27 }; | 28 }; |
28 | 29 |
29 // Make sure to update this if you update WriterTag. | 30 // Make sure to update this if you update WriterTag. |
30 std::string WriterTagToString(WriterTag writer_tag); | 31 std::string WriterTagToString(WriterTag writer_tag); |
31 | 32 |
32 class BaseTransaction { | 33 class BaseTransaction { |
33 public: | 34 public: |
34 inline Directory* directory() const { return directory_; } | 35 inline Directory* directory() const { return directory_; } |
35 inline Id root_id() const { return Id(); } | 36 inline Id root_id() const { return Id(); } |
36 | 37 |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
73 | 74 |
74 private: | 75 private: |
75 friend class Entry; | 76 friend class Entry; |
76 DISALLOW_COPY_AND_ASSIGN(BaseTransaction); | 77 DISALLOW_COPY_AND_ASSIGN(BaseTransaction); |
77 }; | 78 }; |
78 | 79 |
79 } // namespace syncable | 80 } // namespace syncable |
80 } // namespace syncer | 81 } // namespace syncer |
81 | 82 |
82 #endif // SYNC_SYNCABLE_BASE_TRANSACTION_H_ | 83 #endif // SYNC_SYNCABLE_BASE_TRANSACTION_H_ |
OLD | NEW |