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

Side by Side Diff: chrome/browser/metrics/leak_detector_controller.h

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 unified diff | Download patch
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CHROME_BROWSER_METRICS_LEAK_DETECTOR_CONTROLLER_H_ 5 #ifndef CHROME_BROWSER_METRICS_LEAK_DETECTOR_CONTROLLER_H_
6 #define CHROME_BROWSER_METRICS_LEAK_DETECTOR_CONTROLLER_H_ 6 #define CHROME_BROWSER_METRICS_LEAK_DETECTOR_CONTROLLER_H_
7 7
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/macros.h" 10 #include "base/macros.h"
(...skipping 12 matching lines...) Expand all
23 23
24 // Retrieves all reports in |stored_reports_|, moving them to |*reports|. 24 // Retrieves all reports in |stored_reports_|, moving them to |*reports|.
25 // |stored_reports_| is empty afterwards. 25 // |stored_reports_| is empty afterwards.
26 void GetLeakReports(std::vector<MemoryLeakReportProto>* reports); 26 void GetLeakReports(std::vector<MemoryLeakReportProto>* reports);
27 27
28 protected: 28 protected:
29 // LeakDetector::Observer: 29 // LeakDetector::Observer:
30 void OnLeakFound(const LeakDetector::LeakReport& report) override; 30 void OnLeakFound(const LeakDetector::LeakReport& report) override;
31 31
32 private: 32 private:
33 // Leak detector interface object.
34 LeakDetector detector_;
35
36 // All leak reports received through OnLeakFound() are stored in protobuf 33 // All leak reports received through OnLeakFound() are stored in protobuf
37 // format. 34 // format.
38 std::vector<MemoryLeakReportProto> stored_reports_; 35 std::vector<MemoryLeakReportProto> stored_reports_;
39 36
40 // For thread safety. 37 // For thread safety.
41 base::ThreadChecker thread_checker_; 38 base::ThreadChecker thread_checker_;
42 39
43 DISALLOW_COPY_AND_ASSIGN(LeakDetectorController); 40 DISALLOW_COPY_AND_ASSIGN(LeakDetectorController);
44 }; 41 };
45 42
46 } // namespace metrics 43 } // namespace metrics
47 44
48 #endif // CHROME_BROWSER_METRICS_LEAK_DETECTOR_CONTROLLER_H_ 45 #endif // CHROME_BROWSER_METRICS_LEAK_DETECTOR_CONTROLLER_H_
OLDNEW
« no previous file with comments | « base/allocator/allocator_extension.cc ('k') | chrome/browser/metrics/leak_detector_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698