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_SYNCABLE_ENTRY_H_ | 5 #ifndef SYNC_SYNCABLE_ENTRY_H_ |
6 #define SYNC_SYNCABLE_ENTRY_H_ | 6 #define SYNC_SYNCABLE_ENTRY_H_ |
7 | 7 |
8 #include "sync/base/sync_export.h" | 8 #include "sync/base/sync_export.h" |
9 #include "sync/syncable/entry_kernel.h" | 9 #include "sync/syncable/entry_kernel.h" |
10 | 10 |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
102 return kernel_->ref(field); | 102 return kernel_->ref(field); |
103 } | 103 } |
104 | 104 |
105 ModelType GetServerModelType() const; | 105 ModelType GetServerModelType() const; |
106 ModelType GetModelType() const; | 106 ModelType GetModelType() const; |
107 | 107 |
108 Id GetPredecessorId() const; | 108 Id GetPredecessorId() const; |
109 Id GetSuccessorId() const; | 109 Id GetSuccessorId() const; |
110 Id GetFirstChildId() const; | 110 Id GetFirstChildId() const; |
111 | 111 |
112 // Returns a vector of this node's handles. | |
113 // The list is a snapshot of the state at the time this function was called; | |
Nicolas Zea
2013/05/22 22:34:02
nit: I don't think it's necessary to call out that
rlarocque
2013/05/23 00:39:39
Done.
| |
114 // it will not be updated as the directory is modified. Clears |result| if | |
115 // there are no children. If this node is of a type that supports | |
116 // user-defined ordering, then the resulting vector will be in the proper | |
117 // order. | |
118 void GetChildHandles(std::vector<int64>* result) const; | |
119 | |
112 inline bool ExistsOnClientBecauseNameIsNonEmpty() const { | 120 inline bool ExistsOnClientBecauseNameIsNonEmpty() const { |
113 DCHECK(kernel_); | 121 DCHECK(kernel_); |
114 return !kernel_->ref(NON_UNIQUE_NAME).empty(); | 122 return !kernel_->ref(NON_UNIQUE_NAME).empty(); |
115 } | 123 } |
116 | 124 |
117 inline bool IsRoot() const { | 125 inline bool IsRoot() const { |
118 DCHECK(kernel_); | 126 DCHECK(kernel_); |
119 return kernel_->ref(ID).IsRoot(); | 127 return kernel_->ref(ID).IsRoot(); |
120 } | 128 } |
121 | 129 |
(...skipping 11 matching lines...) Expand all Loading... | |
133 // Transfers ownership of the DictionaryValue to the caller. | 141 // Transfers ownership of the DictionaryValue to the caller. |
134 base::DictionaryValue* ToValue(Cryptographer* cryptographer) const; | 142 base::DictionaryValue* ToValue(Cryptographer* cryptographer) const; |
135 | 143 |
136 protected: // Don't allow creation on heap, except by sync API wrappers. | 144 protected: // Don't allow creation on heap, except by sync API wrappers. |
137 void* operator new(size_t size) { return (::operator new)(size); } | 145 void* operator new(size_t size) { return (::operator new)(size); } |
138 | 146 |
139 inline explicit Entry(BaseTransaction* trans) | 147 inline explicit Entry(BaseTransaction* trans) |
140 : basetrans_(trans), | 148 : basetrans_(trans), |
141 kernel_(NULL) { } | 149 kernel_(NULL) { } |
142 | 150 |
151 Entry(BaseTransaction* trans, EntryKernel *kernel) | |
Nicolas Zea
2013/05/22 22:34:02
what is this used by?
rlarocque
2013/05/23 00:39:39
Nothing. I thought I had removed that code. Appa
| |
152 : basetrans_(trans), | |
153 kernel_(kernel) { } | |
154 | |
143 protected: | 155 protected: |
144 BaseTransaction* const basetrans_; | 156 BaseTransaction* const basetrans_; |
145 | 157 |
146 EntryKernel* kernel_; | 158 EntryKernel* kernel_; |
147 | 159 |
148 private: | 160 private: |
149 friend class Directory; | 161 friend class Directory; |
150 friend class syncer::ReadNode; | 162 friend class syncer::ReadNode; |
151 friend std::ostream& operator << (std::ostream& s, const Entry& e); | 163 friend std::ostream& operator << (std::ostream& s, const Entry& e); |
152 | 164 |
153 DISALLOW_COPY_AND_ASSIGN(Entry); | 165 DISALLOW_COPY_AND_ASSIGN(Entry); |
154 }; | 166 }; |
155 | 167 |
156 std::ostream& operator<<(std::ostream& os, const Entry& entry); | 168 std::ostream& operator<<(std::ostream& os, const Entry& entry); |
157 | 169 |
158 } // namespace syncable | 170 } // namespace syncable |
159 } // namespace syncer | 171 } // namespace syncer |
160 | 172 |
161 #endif // SYNC_SYNCABLE_ENTRY_H_ | 173 #endif // SYNC_SYNCABLE_ENTRY_H_ |
OLD | NEW |