Home | History | Annotate | Download | only in engine

Lines Matching refs:entry

25 #include "sync/syncable/entry.h"
43 using syncable::Entry;
77 // Expected entry points of this function:
88 // 1) Client has entry for tag already, ID is server style, matches
89 // 2) Client has entry for tag already, ID is server, doesn't match.
90 // 3) Client has entry for tag already, ID is local, (never matches)
91 // 4) Client has no entry for tag
94 // work just fine. Update will end up in the proper entry, via ID lookup.
100 // this update gets targeted at the correct local entry; we expect conflict
104 syncable::Entry local_entry(trans, syncable::GET_BY_CLIENT_TAG,
123 // Target this change to the existing local entry; later,
124 // we'll change the ID of the local entry to update_id
128 // Case 3: We have a local entry with the same client tag.
129 // We should change the ID of the local entry to the server entry.
152 // We need to check if we have an entry that didn't get its server
154 // and a local (negative) id. If we have a entry by that
161 syncable::Entry local_entry(trans, GET_BY_ID, client_item_id);
164 // the local entry.
171 // An entry should never be version 0 and SYNCED.
184 // Fallback: target an entry having the server ID, creating one if needed.
190 syncable::MutableEntry* const entry,
192 CHECK(entry->good());
193 if (!entry->Get(IS_UNAPPLIED_UPDATE))
195 syncable::Id id = entry->Get(ID);
196 const sync_pb::EntitySpecifics& specifics = entry->Get(SERVER_SPECIFICS);
210 << ModelTypeToString(entry->GetServerModelType())
214 entry->Get(UNIQUE_SERVER_TAG).empty()) {
224 if (!entry->Get(SERVER_IS_DEL)) {
225 syncable::Id new_parent = entry->Get(SERVER_PARENT_ID);
226 Entry parent(trans, GET_BY_ID, new_parent);
234 DVLOG(1) << "Entry has bad parent, returning conflict_hierarchy.";
237 if (entry->Get(PARENT_ID) != new_parent) {
238 if (!entry->Get(IS_DEL) && !IsLegalNewParent(trans, id, new_parent)) {
244 } else if (entry->Get(IS_DIR)) {
250 DVLOG(1) << "Not deleting directory; it's not empty " << *entry;
255 if (entry->Get(IS_UNSYNCED)) {
263 << ModelTypeToString(entry->GetServerModelType())
267 << ModelTypeToString(entry->GetServerModelType())
271 UpdateLocalDataFromServerData(trans, entry);
413 // We only mark the entry as unapplied if its version is greater than the
421 // Creates a new Entry iff no Entry exists with the given id.
424 syncable::MutableEntry entry(trans, GET_BY_ID, id);
425 if (!entry.good()) {
431 // This function is called on an entry when we can update the user-facing data
435 syncable::MutableEntry* entry) {
436 DCHECK(!entry->Get(IS_UNSYNCED));
437 DCHECK(entry->Get(IS_UNAPPLIED_UPDATE));
439 DVLOG(2) << "Updating entry : " << *entry;
441 entry->Put(SPECIFICS, entry->Get(SERVER_SPECIFICS));
443 entry->Put(BASE_SERVER_SPECIFICS, sync_pb::EntitySpecifics());
444 entry->Put(IS_DIR, entry->Get(SERVER_IS_DIR));
448 if (entry->Get(SERVER_IS_DEL)) {
449 entry->Put(IS_DEL, true);
451 entry->Put(NON_UNIQUE_NAME, entry->Get(SERVER_NON_UNIQUE_NAME));
452 entry->Put(PARENT_ID, entry->Get(SERVER_PARENT_ID));
453 entry->Put(UNIQUE_POSITION, entry->Get(SERVER_UNIQUE_POSITION));
454 CHECK(entry->Put(IS_DEL, false));
457 entry->Put(CTIME, entry->Get(SERVER_CTIME));
458 entry->Put(MTIME, entry->Get(SERVER_MTIME));
459 entry->Put(BASE_VERSION, entry->Get(SERVER_VERSION));
460 entry->Put(IS_DEL, entry->Get(SERVER_IS_DEL));
461 entry->Put(IS_UNAPPLIED_UPDATE, false);
464 VerifyCommitResult ValidateCommitEntry(syncable::Entry* entry) {
465 syncable::Id id = entry->Get(ID);
466 if (id == entry->Get(PARENT_ID)) {
467 CHECK(id.IsRoot()) << "Non-root item is self parenting." << *entry;
469 LOG(ERROR) << "Root item became unsynced " << *entry;
472 if (entry->IsRoot()) {
473 LOG(ERROR) << "Permanent item became unsynced " << *entry;
476 if (entry->Get(IS_DEL) && !entry->Get(ID).ServerKnows()) {
504 // Single transaction / entry we deal with.
506 MutableEntry entry(&trans, GET_BY_HANDLE, *it);
507 if (!entry.Get(IS_UNSYNCED) || !entry.Get(IS_DEL))
509 syncable::Id id = entry.Get(PARENT_ID);
513 entry.Put(IS_UNSYNCED, false);
516 Entry parent(&trans, GET_BY_ID, id);
526 syncable::Entry* target,
540 // Assumes we have an existing entry; check here for updates that break
564 // Then we've had an update for this entry before.
571 LOG(ERROR) << " Entry: " << *target;
596 LOG(ERROR) << " Entry: " << *target;
604 LOG(WARNING) << " Entry: " << *target;
614 // Assumes we have an existing entry; verify an update that seems to be