OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_SYNCABLE_MODEL_NEUTRAL_MUTABLE_ENTRY_H_ | 5 #ifndef COMPONENTS_SYNC_SYNCABLE_MODEL_NEUTRAL_MUTABLE_ENTRY_H_ |
6 #define COMPONENTS_SYNC_SYNCABLE_MODEL_NEUTRAL_MUTABLE_ENTRY_H_ | 6 #define COMPONENTS_SYNC_SYNCABLE_MODEL_NEUTRAL_MUTABLE_ENTRY_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/macros.h" | 13 #include "base/macros.h" |
14 #include "components/sync/base/model_type.h" | 14 #include "components/sync/base/model_type.h" |
15 #include "components/sync/syncable/entry.h" | 15 #include "components/sync/syncable/entry.h" |
16 | 16 |
17 namespace syncer { | 17 namespace syncer { |
| 18 |
18 class WriteNode; | 19 class WriteNode; |
19 | 20 |
20 namespace syncable { | 21 namespace syncable { |
21 | 22 |
22 class BaseWriteTransaction; | 23 class BaseWriteTransaction; |
23 | 24 |
24 enum CreateNewUpdateItem { CREATE_NEW_UPDATE_ITEM }; | 25 enum CreateNewUpdateItem { CREATE_NEW_UPDATE_ITEM }; |
25 | 26 |
26 enum CreateNewTypeRoot { CREATE_NEW_TYPE_ROOT }; | 27 enum CreateNewTypeRoot { CREATE_NEW_TYPE_ROOT }; |
27 | 28 |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
98 // used its list of mutations by the time this function is called. | 99 // used its list of mutations by the time this function is called. |
99 void UpdateTransactionVersion(int64_t version); | 100 void UpdateTransactionVersion(int64_t version); |
100 | 101 |
101 protected: | 102 protected: |
102 explicit ModelNeutralMutableEntry(BaseWriteTransaction* trans); | 103 explicit ModelNeutralMutableEntry(BaseWriteTransaction* trans); |
103 | 104 |
104 void MarkDirty(); | 105 void MarkDirty(); |
105 | 106 |
106 private: | 107 private: |
107 friend class syncer::WriteNode; | 108 friend class syncer::WriteNode; |
108 friend class Directory; | 109 friend class syncer::syncable::Directory; |
109 | 110 |
110 // Don't allow creation on heap, except by sync API wrappers. | 111 // Don't allow creation on heap, except by sync API wrappers. |
111 void* operator new(size_t size) { return (::operator new)(size); } | 112 void* operator new(size_t size) { return (::operator new)(size); } |
112 | 113 |
113 // Kind of redundant. We should reduce the number of pointers | 114 // Kind of redundant. We should reduce the number of pointers |
114 // floating around if at all possible. Could we store this in Directory? | 115 // floating around if at all possible. Could we store this in Directory? |
115 // Scope: Set on construction, never changed after that. | 116 // Scope: Set on construction, never changed after that. |
116 BaseWriteTransaction* const base_write_transaction_; | 117 BaseWriteTransaction* const base_write_transaction_; |
117 | 118 |
118 DISALLOW_COPY_AND_ASSIGN(ModelNeutralMutableEntry); | 119 DISALLOW_COPY_AND_ASSIGN(ModelNeutralMutableEntry); |
119 }; | 120 }; |
120 | 121 |
121 } // namespace syncable | 122 } // namespace syncable |
122 } // namespace syncer | 123 } // namespace syncer |
123 | 124 |
124 #endif // COMPONENTS_SYNC_SYNCABLE_MODEL_NEUTRAL_MUTABLE_ENTRY_H_ | 125 #endif // COMPONENTS_SYNC_SYNCABLE_MODEL_NEUTRAL_MUTABLE_ENTRY_H_ |
OLD | NEW |