Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(245)

Unified Diff: sync/syncable/mutable_entry.cc

Issue 10696083: sync: Move MarkForSyncing to mutable_entry.cc (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 8 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | sync/syncable/syncable_util.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sync/syncable/mutable_entry.cc
diff --git a/sync/syncable/mutable_entry.cc b/sync/syncable/mutable_entry.cc
index 64b5f7f1152a16329399cb036bb0eb20904ec666..95c021df30c894d60f573825ecacdb8367602afa 100644
--- a/sync/syncable/mutable_entry.cc
+++ b/sync/syncable/mutable_entry.cc
@@ -408,5 +408,15 @@ bool MutableEntry::Put(BitTemp field, bool value) {
return true;
}
+// This function sets only the flags needed to get this entry to sync.
+bool MarkForSyncing(MutableEntry* e) {
+ DCHECK_NE(static_cast<MutableEntry*>(NULL), e);
+ DCHECK(!e->IsRoot()) << "We shouldn't mark a permanent object for syncing.";
+ if (!(e->Put(IS_UNSYNCED, true)))
+ return false;
+ e->Put(SYNCING, false);
+ return true;
+}
+
} // namespace syncable
} // namespace syncer
« no previous file with comments | « no previous file | sync/syncable/syncable_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698