Chromium Code Reviews| Index: components/metrics/leak_detector/leak_detector.h |
| diff --git a/components/metrics/leak_detector/leak_detector.h b/components/metrics/leak_detector/leak_detector.h |
| index 319e38695949e7a2137d76ecd802cc22a740f61b..3e49888d807fd0ab4d8fd56fdb2c04b755e21003 100644 |
| --- a/components/metrics/leak_detector/leak_detector.h |
| +++ b/components/metrics/leak_detector/leak_detector.h |
| @@ -49,7 +49,21 @@ class LeakDetectorImpl; |
| class LeakDetector { |
| public: |
| // Contains a report of a detected memory leak. |
| + // TODO(sque): This is becoming a copy of LeakDetectorImpl::LeakReport. Need |
| + // to merge the two. |
|
Simon Que
2016/04/11 20:31:25
I wonder if LeakDetector should just create a prot
Ilya Sherman
2016/04/13 00:07:12
Yeah, that seems pretty reasonable.
Simon Que
2016/04/13 22:41:31
Done.
|
| struct LeakReport { |
| + // This is a copy of LeakDetectorImpl::LeakReport::AllocationBreakdown. The |
| + // only difference is that it uses a plain std::vector instead of an |
| + // InternalVector (custom std::vector). See the definition of that struct |
| + // for more information. |
| + struct AllocationBreakdown { |
| + AllocationBreakdown(); |
| + ~AllocationBreakdown(); |
| + |
| + std::vector<uint32_t> counts_by_size; |
| + uint32_t count_for_call_stack; |
| + }; |
| + |
| LeakReport(); |
| ~LeakReport(); |
| @@ -58,6 +72,9 @@ class LeakDetector { |
| // Unlike the CallStack struct, which consists of addresses, this call stack |
| // will contain offsets in the executable binary. |
| std::vector<uintptr_t> call_stack; |
| + |
| + // Historical records of allocation data. |
| + std::vector<AllocationBreakdown> alloc_breakdown_history; |
|
Ilya Sherman
2016/04/13 00:07:12
Optional nit: Mebbe s/alloc/allocation, given the
Simon Que
2016/04/13 22:41:31
The corresponding field in the protobuf is "alloc_
|
| }; |
| // Interface for receiving leak reports. |