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 "components/metrics/leak_detector/protobuf_to_mojo_converter.h" | 5 #include "components/metrics/leak_detector/protobuf_to_mojo_converter.h" |
6 | 6 |
7 namespace metrics { | 7 namespace metrics { |
8 namespace leak_detector { | 8 namespace leak_detector { |
9 namespace protobuf_to_mojo_converter { | 9 namespace protobuf_to_mojo_converter { |
10 | 10 |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
51 | 51 |
52 void MojoToReport(const mojom::MemoryLeakReport& mojo_report, | 52 void MojoToReport(const mojom::MemoryLeakReport& mojo_report, |
53 MemoryLeakReportProto* report) { | 53 MemoryLeakReportProto* report) { |
54 report->set_size_bytes(mojo_report.size_bytes); | 54 report->set_size_bytes(mojo_report.size_bytes); |
55 report->set_num_rising_intervals(mojo_report.num_rising_intervals); | 55 report->set_num_rising_intervals(mojo_report.num_rising_intervals); |
56 report->set_num_allocs_increase(mojo_report.num_allocs_increase); | 56 report->set_num_allocs_increase(mojo_report.num_allocs_increase); |
57 for (auto call_stack_addr : mojo_report.call_stack) | 57 for (auto call_stack_addr : mojo_report.call_stack) |
58 report->add_call_stack(call_stack_addr); | 58 report->add_call_stack(call_stack_addr); |
59 | 59 |
60 for (const auto& history_entry : mojo_report.alloc_breakdown_history) { | 60 for (const auto& history_entry : mojo_report.alloc_breakdown_history) { |
61 auto proto_entry = report->add_alloc_breakdown_history(); | 61 auto* proto_entry = report->add_alloc_breakdown_history(); |
62 for (auto count : history_entry->counts_by_size) { | 62 for (auto count : history_entry->counts_by_size) { |
63 proto_entry->add_counts_by_size(count); | 63 proto_entry->add_counts_by_size(count); |
64 } | 64 } |
65 proto_entry->set_count_for_call_stack(history_entry->count_for_call_stack); | 65 proto_entry->set_count_for_call_stack(history_entry->count_for_call_stack); |
66 } | 66 } |
67 } | 67 } |
68 | 68 |
69 } // namespace protobuf_to_mojo_converter | 69 } // namespace protobuf_to_mojo_converter |
70 } // namespace leak_detector | 70 } // namespace leak_detector |
71 } // namespace metrics | 71 } // namespace metrics |
OLD | NEW |