Lines Matching refs:syncable
14 #include "chrome/browser/sync/syncable/directory_manager.h"
15 #include "chrome/browser/sync/syncable/syncable.h"
20 using syncable::BaseTransaction;
21 using syncable::Directory;
22 using syncable::Entry;
23 using syncable::Id;
24 using syncable::MutableEntry;
25 using syncable::ScopedDirLookup;
26 using syncable::WriteTransaction;
48 entry->Put(syncable::IS_UNSYNCED, false);
58 entry->Put(syncable::BASE_VERSION, entry->Get(syncable::SERVER_VERSION));
59 entry->Put(syncable::IS_UNAPPLIED_UPDATE, false);
66 MutableEntry entry(trans, syncable::GET_BY_ID, id);
71 if (!entry.Get(syncable::IS_UNSYNCED)) {
75 if (!entry.Get(syncable::IS_UNAPPLIED_UPDATE)) {
76 if (!entry.Get(syncable::PARENT_ID).ServerKnows()) {
87 if (entry.Get(syncable::IS_DEL) && entry.Get(syncable::SERVER_IS_DEL)) {
90 entry.Put(syncable::IS_UNSYNCED, false);
91 entry.Put(syncable::IS_UNAPPLIED_UPDATE, false);
97 if (!entry.Get(syncable::SERVER_IS_DEL)) {
104 bool name_matches = entry.Get(syncable::NON_UNIQUE_NAME) ==
105 entry.Get(syncable::SERVER_NON_UNIQUE_NAME);
106 bool parent_matches = entry.Get(syncable::PARENT_ID) ==
107 entry.Get(syncable::SERVER_PARENT_ID);
108 bool entry_deleted = entry.Get(syncable::IS_DEL);
122 if (entry.Get(syncable::IS_DIR)) {
125 entry.Get(syncable::ID),
135 if (!entry.Get(syncable::UNIQUE_CLIENT_TAG).empty()) {
138 DCHECK_EQ(entry.Get(syncable::SERVER_VERSION), 0) << "For the server to "
143 entry.Put(syncable::SERVER_VERSION, 0);
144 entry.Put(syncable::BASE_VERSION, 0);
150 MutableEntry server_update(trans, syncable::GET_BY_ID, id);
152 CHECK(server_update.Get(syncable::META_HANDLE) !=
153 entry.Get(syncable::META_HANDLE))
179 MutableEntry entryi(trans, syncable::GET_BY_ID, *i);
180 if (entryi.Get(syncable::PARENT_ID) ==
181 entryi.Get(syncable::SERVER_PARENT_ID) ||
182 !entryi.Get(syncable::IS_UNAPPLIED_UPDATE) ||
183 !entryi.Get(syncable::IS_DIR)) {
186 Id parentid = entryi.Get(syncable::SERVER_PARENT_ID);
189 Entry parent(trans, syncable::GET_BY_ID, parentid);
197 Entry parent(trans, syncable::GET_BY_ID, parentid);
201 parentid = parent.Get(syncable::PARENT_ID);
206 entryi.Put(syncable::BASE_VERSION, entryi.Get(syncable::SERVER_VERSION));
207 entryi.Put(syncable::IS_UNSYNCED, true);
208 entryi.Put(syncable::IS_UNAPPLIED_UPDATE, false);
218 if (!entry.Get(syncable::IS_UNSYNCED) || entry.Get(syncable::IS_DEL))
220 Id parentid = entry.Get(syncable::PARENT_ID);
221 MutableEntry parent(trans, syncable::GET_BY_ID, parentid);
222 if (!parent.good() || !parent.Get(syncable::IS_UNAPPLIED_UPDATE) ||
223 !parent.Get(syncable::SERVER_IS_DEL) ||
235 Entry parent(trans, syncable::GET_BY_ID, id);
236 if (!parent.good() || !parent.Get(syncable::IS_UNAPPLIED_UPDATE) ||
237 !parent.Get(syncable::SERVER_IS_DEL))
239 id = parent.Get(syncable::PARENT_ID);
244 MutableEntry parent(trans, syncable::GET_BY_ID, id);
251 parent.Put(syncable::BASE_VERSION, 0);
252 parent.Put(syncable::IS_UNSYNCED, true);
253 id = parent.Get(syncable::PARENT_ID);
263 if (!entry.Get(syncable::IS_UNAPPLIED_UPDATE) ||
264 entry.Get(syncable::SERVER_IS_DEL))
266 Id parent_id = entry.Get(syncable::SERVER_PARENT_ID);
267 MutableEntry parent(trans, syncable::GET_BY_ID, parent_id);
268 if (!parent.good() || !parent.Get(syncable::IS_DEL) ||
280 Id reroot_id = syncable::kNullId;
284 Entry parent(trans, syncable::GET_BY_ID, id);
291 CHECK(parent.Get(syncable::IS_DIR));
298 if (parent.Get(syncable::IS_DEL))
302 if (!parent.Get(syncable::IS_DEL) ||
303 parent.Get(syncable::SERVER_IS_DEL) ||
304 !parent.Get(syncable::IS_UNSYNCED)) {
307 id = parent.Get(syncable::PARENT_ID);
311 if (id == entry.Get(syncable::ID))
312 reroot_id = entry.Get(syncable::PARENT_ID);
322 MutableEntry entry(trans, syncable::GET_BY_ID, id);
325 << ", will have name " << entry.Get(syncable::NON_UNIQUE_NAME);
327 Id parent_id = entry.Get(syncable::PARENT_ID);
331 entry.Put(syncable::PARENT_ID, parent_id);
332 entry.Put(syncable::IS_DEL, false);
333 id = entry.Get(syncable::PARENT_ID);
343 Entry entry(trans, syncable::GET_BY_ID, *i);
405 Entry e(trans, syncable::GET_BY_ID, *i);
422 WriteTransaction trans(dir, syncable::SYNCER, __FILE__, __LINE__);
467 WriteTransaction trans(dir, syncable::SYNCER, __FILE__, __LINE__);