| 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 #include "chrome/browser/sync_file_system/subtree_set.h" | 5 #include "chrome/browser/sync_file_system/subtree_set.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "base/stl_util.h" | 8 #include "base/stl_util.h" |
| 9 #include "webkit/common/fileapi/file_system_util.h" | 9 #include "storage/common/fileapi/file_system_util.h" |
| 10 | 10 |
| 11 namespace sync_file_system { | 11 namespace sync_file_system { |
| 12 | 12 |
| 13 SubtreeSet::Node::Node() | 13 SubtreeSet::Node::Node() |
| 14 : contained_as_subtree_root(false), | 14 : contained_as_subtree_root(false), |
| 15 number_of_subtrees_below(0) { | 15 number_of_subtrees_below(0) { |
| 16 } | 16 } |
| 17 | 17 |
| 18 SubtreeSet::Node::Node(bool contained_as_subtree_root, | 18 SubtreeSet::Node::Node(bool contained_as_subtree_root, |
| 19 size_t number_of_subtrees_below) | 19 size_t number_of_subtrees_below) |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 103 | 103 |
| 104 size_t SubtreeSet::size() const { | 104 size_t SubtreeSet::size() const { |
| 105 Subtrees::const_iterator found = | 105 Subtrees::const_iterator found = |
| 106 inclusive_ancestors_of_subtree_roots_.find(storage::VirtualPath::kRoot); | 106 inclusive_ancestors_of_subtree_roots_.find(storage::VirtualPath::kRoot); |
| 107 if (found == inclusive_ancestors_of_subtree_roots_.end()) | 107 if (found == inclusive_ancestors_of_subtree_roots_.end()) |
| 108 return 0; | 108 return 0; |
| 109 return found->second.number_of_subtrees_below; | 109 return found->second.number_of_subtrees_below; |
| 110 } | 110 } |
| 111 | 111 |
| 112 } // namespace sync_file_system | 112 } // namespace sync_file_system |
| OLD | NEW |