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

Side by Side 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, 5 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | sync/syncable/syncable_util.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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 #include "sync/syncable/mutable_entry.h" 5 #include "sync/syncable/mutable_entry.h"
6 6
7 #include "base/memory/scoped_ptr.h" 7 #include "base/memory/scoped_ptr.h"
8 #include "sync/syncable/directory.h" 8 #include "sync/syncable/directory.h"
9 #include "sync/syncable/scoped_index_updater.h" 9 #include "sync/syncable/scoped_index_updater.h"
10 #include "sync/syncable/scoped_kernel_lock.h" 10 #include "sync/syncable/scoped_kernel_lock.h"
(...skipping 390 matching lines...) Expand 10 before | Expand all | Expand 10 after
401 Put(NEXT_ID, successor_id); 401 Put(NEXT_ID, successor_id);
402 return true; 402 return true;
403 } 403 }
404 404
405 bool MutableEntry::Put(BitTemp field, bool value) { 405 bool MutableEntry::Put(BitTemp field, bool value) {
406 DCHECK(kernel_); 406 DCHECK(kernel_);
407 kernel_->put(field, value); 407 kernel_->put(field, value);
408 return true; 408 return true;
409 } 409 }
410 410
411 // This function sets only the flags needed to get this entry to sync.
412 bool MarkForSyncing(MutableEntry* e) {
413 DCHECK_NE(static_cast<MutableEntry*>(NULL), e);
414 DCHECK(!e->IsRoot()) << "We shouldn't mark a permanent object for syncing.";
415 if (!(e->Put(IS_UNSYNCED, true)))
416 return false;
417 e->Put(SYNCING, false);
418 return true;
419 }
420
411 } // namespace syncable 421 } // namespace syncable
412 } // namespace syncer 422 } // namespace syncer
OLDNEW
« 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