OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 #ifndef SYNC_SYNCABLE_DIRECTORY_H_ | 5 #ifndef SYNC_SYNCABLE_DIRECTORY_H_ |
6 #define SYNC_SYNCABLE_DIRECTORY_H_ | 6 #define SYNC_SYNCABLE_DIRECTORY_H_ |
7 | 7 |
8 #include <deque> | 8 #include <deque> |
9 #include <set> | 9 #include <set> |
10 #include <string> | 10 #include <string> |
(...skipping 581 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
592 | 592 |
593 // Purges from memory any unused, safe to remove entries that were | 593 // Purges from memory any unused, safe to remove entries that were |
594 // successfully deleted on disk as a result of the SaveChanges that processed | 594 // successfully deleted on disk as a result of the SaveChanges that processed |
595 // |snapshot|. See SaveChanges() for more information. | 595 // |snapshot|. See SaveChanges() for more information. |
596 bool VacuumAfterSaveChanges(const SaveChangesSnapshot& snapshot); | 596 bool VacuumAfterSaveChanges(const SaveChangesSnapshot& snapshot); |
597 | 597 |
598 // Rolls back dirty bits in the event that the SaveChanges that | 598 // Rolls back dirty bits in the event that the SaveChanges that |
599 // processed |snapshot| failed, for example, due to no disk space. | 599 // processed |snapshot| failed, for example, due to no disk space. |
600 void HandleSaveChangesFailure(const SaveChangesSnapshot& snapshot); | 600 void HandleSaveChangesFailure(const SaveChangesSnapshot& snapshot); |
601 | 601 |
602 // Used by CheckTreeInvariants | 602 // Used by CheckTreeInvariants. |
603 void GetAllMetaHandles(BaseTransaction* trans, MetahandleSet* result); | 603 void GetAllMetaHandles(BaseTransaction* trans, MetahandleSet* result); |
| 604 |
| 605 // Used by VacuumAfterSaveChanges. |
604 bool SafeToPurgeFromMemory(WriteTransaction* trans, | 606 bool SafeToPurgeFromMemory(WriteTransaction* trans, |
605 const EntryKernel* const entry) const; | 607 const EntryKernel* const entry) const; |
606 | |
607 // A helper used by GetTotalNodeCount. | 608 // A helper used by GetTotalNodeCount. |
608 void GetChildSetForKernel( | 609 void GetChildSetForKernel( |
609 BaseTransaction*, | 610 BaseTransaction*, |
610 EntryKernel* kernel_, | 611 EntryKernel* kernel_, |
611 std::deque<const OrderedChildSet*>* child_sets) const; | 612 std::deque<const OrderedChildSet*>* child_sets) const; |
612 | 613 |
613 // Append the handles of the children of |parent_id| to |result|. | 614 // Append the handles of the children of |parent_id| to |result|. |
614 void AppendChildHandles(const ScopedKernelLock& lock, | 615 void AppendChildHandles(const ScopedKernelLock& lock, |
615 const Id& parent_id, | 616 const Id& parent_id, |
616 Directory::Metahandles* result); | 617 Directory::Metahandles* result); |
(...skipping 30 matching lines...) Expand all Loading... |
647 // are deleted in native models as well. | 648 // are deleted in native models as well. |
648 scoped_ptr<DeleteJournal> delete_journal_; | 649 scoped_ptr<DeleteJournal> delete_journal_; |
649 | 650 |
650 DISALLOW_COPY_AND_ASSIGN(Directory); | 651 DISALLOW_COPY_AND_ASSIGN(Directory); |
651 }; | 652 }; |
652 | 653 |
653 } // namespace syncable | 654 } // namespace syncable |
654 } // namespace syncer | 655 } // namespace syncer |
655 | 656 |
656 #endif // SYNC_SYNCABLE_DIRECTORY_H_ | 657 #endif // SYNC_SYNCABLE_DIRECTORY_H_ |
OLD | NEW |