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 COMPONENTS_SYNC_SYNCABLE_DIRECTORY_H_ | 5 #ifndef COMPONENTS_SYNC_SYNCABLE_DIRECTORY_H_ |
6 #define COMPONENTS_SYNC_SYNCABLE_DIRECTORY_H_ | 6 #define COMPONENTS_SYNC_SYNCABLE_DIRECTORY_H_ |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 #include <stdint.h> | 9 #include <stdint.h> |
10 | 10 |
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
129 // the backing store. | 129 // the backing store. |
130 struct SaveChangesSnapshot { | 130 struct SaveChangesSnapshot { |
131 SaveChangesSnapshot(); | 131 SaveChangesSnapshot(); |
132 ~SaveChangesSnapshot(); | 132 ~SaveChangesSnapshot(); |
133 | 133 |
134 // Returns true if this snapshot has any unsaved metahandle changes. | 134 // Returns true if this snapshot has any unsaved metahandle changes. |
135 bool HasUnsavedMetahandleChanges() const; | 135 bool HasUnsavedMetahandleChanges() const; |
136 | 136 |
137 KernelShareInfoStatus kernel_info_status; | 137 KernelShareInfoStatus kernel_info_status; |
138 PersistedKernelInfo kernel_info; | 138 PersistedKernelInfo kernel_info; |
139 EntryKernelSet dirty_metas; | 139 OwnedEntryKernelSet dirty_metas; |
140 MetahandleSet metahandles_to_purge; | 140 MetahandleSet metahandles_to_purge; |
141 EntryKernelSet delete_journals; | 141 OwnedEntryKernelSet delete_journals; |
142 MetahandleSet delete_journals_to_purge; | 142 MetahandleSet delete_journals_to_purge; |
143 }; | 143 }; |
144 | 144 |
145 struct Kernel { | 145 struct Kernel { |
146 // |delegate| must not be NULL. |transaction_observer| must be | 146 // |delegate| must not be NULL. |transaction_observer| must be |
147 // initialized. | 147 // initialized. |
148 Kernel(const std::string& name, | 148 Kernel(const std::string& name, |
149 const KernelLoadInfo& info, | 149 const KernelLoadInfo& info, |
150 DirectoryChangeDelegate* delegate, | 150 DirectoryChangeDelegate* delegate, |
151 const WeakHandle<TransactionObserver>& transaction_observer); | 151 const WeakHandle<TransactionObserver>& transaction_observer); |
(...skipping 450 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
602 // Append the handles of the children of |parent_id| to |result|. | 602 // Append the handles of the children of |parent_id| to |result|. |
603 void AppendChildHandles(const ScopedKernelLock& lock, | 603 void AppendChildHandles(const ScopedKernelLock& lock, |
604 const Id& parent_id, | 604 const Id& parent_id, |
605 Directory::Metahandles* result); | 605 Directory::Metahandles* result); |
606 | 606 |
607 // Helper methods used by PurgeDisabledTypes. | 607 // Helper methods used by PurgeDisabledTypes. |
608 void UnapplyEntry(EntryKernel* entry); | 608 void UnapplyEntry(EntryKernel* entry); |
609 void DeleteEntry(const ScopedKernelLock& lock, | 609 void DeleteEntry(const ScopedKernelLock& lock, |
610 bool save_to_journal, | 610 bool save_to_journal, |
611 EntryKernel* entry, | 611 EntryKernel* entry, |
612 EntryKernelSet* entries_to_journal); | 612 OwnedEntryKernelSet* entries_to_journal); |
613 | 613 |
614 // A private version of the public GetMetaHandlesOfType for when you already | 614 // A private version of the public GetMetaHandlesOfType for when you already |
615 // have a ScopedKernelLock. | 615 // have a ScopedKernelLock. |
616 void GetMetaHandlesOfType(const ScopedKernelLock& lock, | 616 void GetMetaHandlesOfType(const ScopedKernelLock& lock, |
617 BaseTransaction* trans, | 617 BaseTransaction* trans, |
618 ModelType type, | 618 ModelType type, |
619 std::vector<int64_t>* result); | 619 std::vector<int64_t>* result); |
620 | 620 |
621 // Invoked by DirectoryBackingStore when a catastrophic database error is | 621 // Invoked by DirectoryBackingStore when a catastrophic database error is |
622 // detected. | 622 // detected. |
(...skipping 29 matching lines...) Expand all Loading... |
652 | 652 |
653 base::WeakPtrFactory<Directory> weak_ptr_factory_; | 653 base::WeakPtrFactory<Directory> weak_ptr_factory_; |
654 | 654 |
655 DISALLOW_COPY_AND_ASSIGN(Directory); | 655 DISALLOW_COPY_AND_ASSIGN(Directory); |
656 }; | 656 }; |
657 | 657 |
658 } // namespace syncable | 658 } // namespace syncable |
659 } // namespace syncer | 659 } // namespace syncer |
660 | 660 |
661 #endif // COMPONENTS_SYNC_SYNCABLE_DIRECTORY_H_ | 661 #endif // COMPONENTS_SYNC_SYNCABLE_DIRECTORY_H_ |
OLD | NEW |