OLD | NEW |
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 #include "chrome/browser/metrics/leak_detector/leak_detector_controller.h" | 5 #include "chrome/browser/metrics/leak_detector/leak_detector_controller.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/strings/string_number_conversions.h" | 10 #include "base/strings/string_number_conversions.h" |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
107 const std::vector<MemoryLeakReportProto>& reports) { | 107 const std::vector<MemoryLeakReportProto>& reports) { |
108 DCHECK(thread_checker_.CalledOnValidThread()); | 108 DCHECK(thread_checker_.CalledOnValidThread()); |
109 | 109 |
110 for (const auto& report : reports) { | 110 for (const auto& report : reports) { |
111 // Store the report and insert stored parameters. | 111 // Store the report and insert stored parameters. |
112 stored_reports_.push_back(report); | 112 stored_reports_.push_back(report); |
113 stored_reports_.back().mutable_params()->CopyFrom(params_); | 113 stored_reports_.back().mutable_params()->CopyFrom(params_); |
114 } | 114 } |
115 } | 115 } |
116 | 116 |
| 117 MemoryLeakReportProto_Params LeakDetectorController::GetParams() const { |
| 118 return params_; |
| 119 } |
| 120 |
| 121 void LeakDetectorController::SendLeakReports( |
| 122 const std::vector<MemoryLeakReportProto>& reports) { |
| 123 OnLeaksFound(reports); |
| 124 } |
| 125 |
117 void LeakDetectorController::GetLeakReports( | 126 void LeakDetectorController::GetLeakReports( |
118 std::vector<MemoryLeakReportProto>* reports) { | 127 std::vector<MemoryLeakReportProto>* reports) { |
119 DCHECK(thread_checker_.CalledOnValidThread()); | 128 DCHECK(thread_checker_.CalledOnValidThread()); |
120 *reports = std::move(stored_reports_); | 129 *reports = std::move(stored_reports_); |
121 } | 130 } |
122 | 131 |
123 } // namespace metrics | 132 } // namespace metrics |
OLD | NEW |