| 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 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 60 FULL_DB_VERIFICATION = 2 // Check every entry. This can be expensive. | 60 FULL_DB_VERIFICATION = 2 // Check every entry. This can be expensive. |
| 61 }; | 61 }; |
| 62 | 62 |
| 63 // Directory stores and manages EntryKernels. | 63 // Directory stores and manages EntryKernels. |
| 64 // | 64 // |
| 65 // This class is tightly coupled to several other classes via Directory::Kernel. | 65 // This class is tightly coupled to several other classes via Directory::Kernel. |
| 66 // Although Directory's kernel_ is exposed via public accessor it should be | 66 // Although Directory's kernel_ is exposed via public accessor it should be |
| 67 // treated as pseudo-private. | 67 // treated as pseudo-private. |
| 68 class Directory { | 68 class Directory { |
| 69 public: | 69 public: |
| 70 typedef std::vector<int64_t> Metahandles; | 70 using Metahandles = std::vector<int64_t>; |
| 71 | 71 |
| 72 typedef std::unordered_map<int64_t, std::unique_ptr<EntryKernel>> | 72 using MetahandlesMap = |
| 73 MetahandlesMap; | 73 std::unordered_map<int64_t, std::unique_ptr<EntryKernel>>; |
| 74 typedef std::unordered_map<std::string, EntryKernel*> IdsMap; | 74 using IdsMap = std::unordered_map<std::string, EntryKernel*>; |
| 75 typedef std::unordered_map<std::string, EntryKernel*> TagsMap; | 75 using TagsMap = std::unordered_map<std::string, EntryKernel*>; |
| 76 typedef std::string AttachmentIdUniqueId; | 76 using AttachmentIdUniqueId = std::string; |
| 77 typedef std::unordered_map<AttachmentIdUniqueId, MetahandleSet> | 77 using IndexByAttachmentId = |
| 78 IndexByAttachmentId; | 78 std::unordered_map<AttachmentIdUniqueId, MetahandleSet>; |
| 79 | 79 |
| 80 static const base::FilePath::CharType kSyncDatabaseFilename[]; | 80 static const base::FilePath::CharType kSyncDatabaseFilename[]; |
| 81 | 81 |
| 82 // The dirty/clean state of kernel fields backed by the share_info table. | 82 // The dirty/clean state of kernel fields backed by the share_info table. |
| 83 // This is public so it can be used in SaveChangesSnapshot for persistence. | 83 // This is public so it can be used in SaveChangesSnapshot for persistence. |
| 84 enum KernelShareInfoStatus { | 84 enum KernelShareInfoStatus { |
| 85 KERNEL_SHARE_INFO_INVALID, | 85 KERNEL_SHARE_INFO_INVALID, |
| 86 KERNEL_SHARE_INFO_VALID, | 86 KERNEL_SHARE_INFO_VALID, |
| 87 KERNEL_SHARE_INFO_DIRTY | 87 KERNEL_SHARE_INFO_DIRTY |
| 88 }; | 88 }; |
| (...skipping 578 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 667 | 667 |
| 668 base::WeakPtrFactory<Directory> weak_ptr_factory_; | 668 base::WeakPtrFactory<Directory> weak_ptr_factory_; |
| 669 | 669 |
| 670 DISALLOW_COPY_AND_ASSIGN(Directory); | 670 DISALLOW_COPY_AND_ASSIGN(Directory); |
| 671 }; | 671 }; |
| 672 | 672 |
| 673 } // namespace syncable | 673 } // namespace syncable |
| 674 } // namespace syncer | 674 } // namespace syncer |
| 675 | 675 |
| 676 #endif // COMPONENTS_SYNC_SYNCABLE_DIRECTORY_H_ | 676 #endif // COMPONENTS_SYNC_SYNCABLE_DIRECTORY_H_ |
| OLD | NEW |