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

Unified Diff: chrome/browser/metrics/leak_detector_controller.cc

Issue 1665553002: metrics: Connect leak detector to allocator (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: primiano's feedback; Register observer sooner Created 4 years, 9 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
« no previous file with comments | « chrome/browser/metrics/leak_detector_controller.h ('k') | components/metrics/leak_detector/leak_detector.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/metrics/leak_detector_controller.cc
diff --git a/chrome/browser/metrics/leak_detector_controller.cc b/chrome/browser/metrics/leak_detector_controller.cc
index 5403f2cc2975ba1038611cb6d48d1d60fd11076e..aebd8a708591ef42e78f5a0b38d482cc075e6faf 100644
--- a/chrome/browser/metrics/leak_detector_controller.cc
+++ b/chrome/browser/metrics/leak_detector_controller.cc
@@ -21,18 +21,16 @@ const int kCallStackSuspicionThreshold = 4;
} // namespace
-LeakDetectorController::LeakDetectorController()
- : detector_(kSamplingRate,
- kMaxStackDepth,
- kAnalysisIntervalBytes,
- kSizeSuspicionThreshold,
- kCallStackSuspicionThreshold) {
- detector_.AddObserver(this);
+LeakDetectorController::LeakDetectorController() {
+ LeakDetector* detector = LeakDetector::GetInstance();
+ detector->AddObserver(this);
+ detector->Init(kSamplingRate, kMaxStackDepth, kAnalysisIntervalBytes,
+ kSizeSuspicionThreshold, kCallStackSuspicionThreshold);
}
LeakDetectorController::~LeakDetectorController() {
DCHECK(thread_checker_.CalledOnValidThread());
- detector_.RemoveObserver(this);
+ LeakDetector::GetInstance()->RemoveObserver(this);
}
void LeakDetectorController::OnLeakFound(
« no previous file with comments | « chrome/browser/metrics/leak_detector_controller.h ('k') | components/metrics/leak_detector/leak_detector.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698