Chromium Code Reviews| Index: base/metrics/persistent_memory_allocator.h |
| diff --git a/base/metrics/persistent_memory_allocator.h b/base/metrics/persistent_memory_allocator.h |
| index 7004afecc024f2c79f3141417ee326127394c055..e8b2f6c3262f75e7e5aa397976fa98db84fd1b79 100644 |
| --- a/base/metrics/persistent_memory_allocator.h |
| +++ b/base/metrics/persistent_memory_allocator.h |
| @@ -76,6 +76,17 @@ class BASE_EXPORT PersistentMemoryAllocator { |
| Iterator(const PersistentMemoryAllocator* allocator, |
| Reference starting_after); |
| + // Resets the iterator back to the beginning. |
| + void Reset(); |
|
manzagop (departed)
2016/10/04 21:02:43
Is this dangerous to introduce since we have some
bcwhite
2016/10/05 16:34:11
Each thread has its own iterator and all iterators
|
| + |
| + // Resets the iterator, resuming from the |starting_after| reference. |
|
manzagop (departed)
2016/10/04 21:02:43
I'm guessing whenever you Reset(), then GetNext re
bcwhite
2016/10/05 16:34:11
Yes, the first iterable in the allocator.
|
| + void Reset(Reference starting_after); |
| + |
| + // Returns the previously retrieved reference, or kReferenceNull if none. |
| + // If constructor or reset with a starting_after location, this will return |
| + // that value. |
| + Reference GetLast(); |
|
manzagop (departed)
2016/10/04 21:02:43
Add a basic test for these?
bcwhite
2016/10/05 16:34:11
Done.
|
| + |
| // Gets the next iterable, storing that type in |type_return|. The actual |
| // return value is a reference to the allocation inside the allocator or |
| // zero if there are no more. GetNext() may still be called again at a |