Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(221)

Side by Side Diff: components/sync/syncable/parent_child_index.h

Issue 2452713003: [Sync] Implement MemoryDumpProvider. (Closed)
Patch Set: Fix presumit; fix Windows; git cl format Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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_PARENT_CHILD_INDEX_H_ 5 #ifndef COMPONENTS_SYNC_SYNCABLE_PARENT_CHILD_INDEX_H_
6 #define COMPONENTS_SYNC_SYNCABLE_PARENT_CHILD_INDEX_H_ 6 #define COMPONENTS_SYNC_SYNCABLE_PARENT_CHILD_INDEX_H_
7 7
8 #include <map> 8 #include <map>
9 #include <memory> 9 #include <memory>
10 #include <set> 10 #include <set>
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 // node has no children or the Id does not identify a valid directory node. 53 // node has no children or the Id does not identify a valid directory node.
54 const OrderedChildSet* GetChildren(const Id& id) const; 54 const OrderedChildSet* GetChildren(const Id& id) const;
55 55
56 // Returns all children of the entry. Returns null if the node has no 56 // Returns all children of the entry. Returns null if the node has no
57 // children. 57 // children.
58 const OrderedChildSet* GetChildren(EntryKernel* e) const; 58 const OrderedChildSet* GetChildren(EntryKernel* e) const;
59 59
60 // Returns all siblings of the entry. 60 // Returns all siblings of the entry.
61 const OrderedChildSet* GetSiblings(EntryKernel* e) const; 61 const OrderedChildSet* GetSiblings(EntryKernel* e) const;
62 62
63 // Estimates amount of heap memory used.
64 size_t EstimateMemoryUsage() const;
65
63 private: 66 private:
64 friend class ParentChildIndexTest; 67 friend class ParentChildIndexTest;
65 68
66 typedef std::map<Id, OrderedChildSetRef> ParentChildrenMap; 69 typedef std::map<Id, OrderedChildSetRef> ParentChildrenMap;
67 typedef std::vector<Id> TypeRootIds; 70 typedef std::vector<Id> TypeRootIds;
68 typedef std::vector<OrderedChildSetRef> TypeRootChildSets; 71 typedef std::vector<OrderedChildSetRef> TypeRootChildSets;
69 72
70 static bool ShouldUseParentId(const Id& parent_id, ModelType model_type); 73 static bool ShouldUseParentId(const Id& parent_id, ModelType model_type);
71 74
72 // Returns OrderedChildSet that should contain the specified entry 75 // Returns OrderedChildSet that should contain the specified entry
(...skipping 22 matching lines...) Expand all
95 // with implicit parent. 98 // with implicit parent.
96 TypeRootChildSets type_root_child_sets_; 99 TypeRootChildSets type_root_child_sets_;
97 100
98 DISALLOW_COPY_AND_ASSIGN(ParentChildIndex); 101 DISALLOW_COPY_AND_ASSIGN(ParentChildIndex);
99 }; 102 };
100 103
101 } // namespace syncable 104 } // namespace syncable
102 } // namespace syncer 105 } // namespace syncer
103 106
104 #endif // COMPONENTS_SYNC_SYNCABLE_PARENT_CHILD_INDEX_H_ 107 #endif // COMPONENTS_SYNC_SYNCABLE_PARENT_CHILD_INDEX_H_
OLDNEW
« no previous file with comments | « components/sync/syncable/entry_kernel.cc ('k') | components/sync/syncable/parent_child_index.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698