| OLD | NEW |
| 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 Loading... |
| 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 |
| OLD | NEW |