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

Unified Diff: components/metrics/leak_detector/leak_detector.cc

Issue 2403223002: Leak reports collect information about the last uptrend (Closed)
Patch Set: Created 4 years, 2 months 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 side-by-side diff with in-line comments
Download patch
Index: components/metrics/leak_detector/leak_detector.cc
diff --git a/components/metrics/leak_detector/leak_detector.cc b/components/metrics/leak_detector/leak_detector.cc
index 5f33bab50fc7e9ffa661b08749068f8ec78f4014..8f7bb05aec57f76e5333c3355430c579a80686da 100644
--- a/components/metrics/leak_detector/leak_detector.cc
+++ b/components/metrics/leak_detector/leak_detector.cc
@@ -121,6 +121,9 @@ MemoryLeakReportProto ConvertLeakReportToProto(
proto_entry->set_count_for_call_stack(entry.count_for_call_stack);
}
+ proto.set_num_rising_intervals(report.num_rising_intervals());
+ proto.set_num_allocs_increase(report.num_allocs_increase());
+
return proto;
}
@@ -273,7 +276,9 @@ void LeakDetector::AllocHook(const void* ptr, size_t size) {
total_alloc_size - total_alloc_size % analysis_interval_bytes;
InternalVector<InternalLeakReport> leak_reports;
- detector->impl_->TestForLeaks(&leak_reports);
+ detector->impl_->TestForLeaks(&leak_reports, total_alloc_size);
+ for(auto &report : leak_reports)
Simon Que 2016/10/11 01:11:06 Nit: space after "for" Nit: "auto& report"
mwlodar 2016/10/11 07:13:24 Done.
+ report.normalize_num_rising_intervals(analysis_interval_bytes);
Simon Que 2016/10/11 01:11:06 Do the division here. See my comments in that func
mwlodar 2016/10/11 07:13:24 Done.
// Pass leak reports to observers.
std::vector<MemoryLeakReportProto> leak_report_protos;

Powered by Google App Engine
This is Rietveld 408576698