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

Side by Side Diff: components/metrics/leak_detector/leak_detector.cc

Issue 1681263003: metrics: Add leak detector controller in Chrome OS metrics system (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed comments, updated LeakDetector with default constructor Created 4 years, 10 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "components/metrics/leak_detector/leak_detector.h"
6
7 #include <algorithm>
8
9 namespace metrics {
10
11 LeakDetector::LeakReport::LeakReport() {}
12
13 LeakDetector::LeakReport::~LeakReport() {}
14
15 LeakDetector::LeakDetector(float sampling_rate,
16 int max_stack_depth,
17 uint64_t analysis_interval_bytes,
18 int size_suspicion_threshold,
19 int call_stack_suspicion_threshold) {}
20
21 LeakDetector::LeakDetector() : LeakDetector(1.0f, 4, 32 * 1024 * 1024, 4, 4) {}
22
23 LeakDetector::~LeakDetector() {}
24
25 void LeakDetector::AddObserver(Observer* observer) {
26 observers_.AddObserver(observer);
27 }
28
29 void LeakDetector::RemoveObserver(Observer* observer) {
30 observers_.RemoveObserver(observer);
31 }
32
33 void LeakDetector::NotifyObservers(const std::vector<LeakReport>& reports) {
34 for (const LeakReport& report : reports) {
35 FOR_EACH_OBSERVER(Observer, observers_, OnLeakFound(report));
36 }
37 }
38
39 } // namespace metrics
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698