| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 CHROME_BROWSER_SYNC_FILE_SYSTEM_SUBTREE_SET_H_ | 5 #ifndef CHROME_BROWSER_SYNC_FILE_SYSTEM_SUBTREE_SET_H_ |
| 6 #define CHROME_BROWSER_SYNC_FILE_SYSTEM_SUBTREE_SET_H_ | 6 #define CHROME_BROWSER_SYNC_FILE_SYSTEM_SUBTREE_SET_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 | 9 |
| 10 #include <unordered_map> |
| 11 |
| 10 #include "base/containers/hash_tables.h" | 12 #include "base/containers/hash_tables.h" |
| 11 #include "base/files/file_path.h" | 13 #include "base/files/file_path.h" |
| 12 | 14 |
| 13 namespace base { | 15 namespace base { |
| 14 class FilePath; | 16 class FilePath; |
| 15 } // namespace base | 17 } // namespace base |
| 16 | 18 |
| 17 namespace sync_file_system { | 19 namespace sync_file_system { |
| 18 | 20 |
| 19 // Stores disjoint subtrees of a directory tree. | 21 // Stores disjoint subtrees of a directory tree. |
| (...skipping 22 matching lines...) Expand all Loading... |
| 42 struct Node { | 44 struct Node { |
| 43 bool contained_as_subtree_root; | 45 bool contained_as_subtree_root; |
| 44 size_t number_of_subtrees_below; | 46 size_t number_of_subtrees_below; |
| 45 | 47 |
| 46 Node(); | 48 Node(); |
| 47 Node(bool contained_as_subtree_root, | 49 Node(bool contained_as_subtree_root, |
| 48 size_t number_of_subtrees_below); | 50 size_t number_of_subtrees_below); |
| 49 }; | 51 }; |
| 50 | 52 |
| 51 typedef base::FilePath::StringType StringType; | 53 typedef base::FilePath::StringType StringType; |
| 52 typedef base::hash_map<StringType, Node> Subtrees; | 54 typedef std::unordered_map<StringType, Node> Subtrees; |
| 53 | 55 |
| 54 // Contains the root of subtrees and all upward node to root. | 56 // Contains the root of subtrees and all upward node to root. |
| 55 // Each subtree root has |contained_as_subtree_root| flag true. | 57 // Each subtree root has |contained_as_subtree_root| flag true. |
| 56 Subtrees inclusive_ancestors_of_subtree_roots_; | 58 Subtrees inclusive_ancestors_of_subtree_roots_; |
| 57 }; | 59 }; |
| 58 | 60 |
| 59 } // namespace sync_file_system | 61 } // namespace sync_file_system |
| 60 | 62 |
| 61 #endif // CHROME_BROWSER_SYNC_FILE_SYSTEM_SUBTREE_SET_H_ | 63 #endif // CHROME_BROWSER_SYNC_FILE_SYSTEM_SUBTREE_SET_H_ |
| OLD | NEW |