| OLD | NEW |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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 "services/resource_coordinator/public/cpp/memory/memory_instrumentation
_struct_traits.h" | 5 #include "services/resource_coordinator/public/cpp/memory/memory_instrumentation
_struct_traits.h" |
| 6 | 6 |
| 7 #include "base/trace_event/memory_dump_request_args.h" | 7 #include "base/trace_event/memory_dump_request_args.h" |
| 8 #include "base/trace_event/process_memory_totals.h" | 8 #include "base/trace_event/process_memory_totals.h" |
| 9 #include "mojo/common/common_custom_types_struct_traits.h" | 9 #include "mojo/common/common_custom_types_struct_traits.h" |
| 10 #include "services/resource_coordinator/public/interfaces/memory/memory_instrume
ntation.mojom.h" | 10 #include "services/resource_coordinator/public/interfaces/memory/memory_instrume
ntation.mojom.h" |
| (...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 142 bool StructTraits<memory_instrumentation::mojom::OSMemDumpDataView, | 142 bool StructTraits<memory_instrumentation::mojom::OSMemDumpDataView, |
| 143 base::trace_event::MemoryDumpCallbackResult::OSMemDump>:: | 143 base::trace_event::MemoryDumpCallbackResult::OSMemDump>:: |
| 144 Read(memory_instrumentation::mojom::OSMemDumpDataView input, | 144 Read(memory_instrumentation::mojom::OSMemDumpDataView input, |
| 145 base::trace_event::MemoryDumpCallbackResult::OSMemDump* out) { | 145 base::trace_event::MemoryDumpCallbackResult::OSMemDump* out) { |
| 146 out->resident_set_kb = input.resident_set_kb(); | 146 out->resident_set_kb = input.resident_set_kb(); |
| 147 if (!input.ReadPlatformPrivateFootprint(&out->platform_private_footprint)) | 147 if (!input.ReadPlatformPrivateFootprint(&out->platform_private_footprint)) |
| 148 return false; | 148 return false; |
| 149 return true; | 149 return true; |
| 150 } | 150 } |
| 151 | 151 |
| 152 // static | |
| 153 bool StructTraits< | |
| 154 memory_instrumentation::mojom::MemoryDumpCallbackResultDataView, | |
| 155 base::trace_event::MemoryDumpCallbackResult>:: | |
| 156 Read(memory_instrumentation::mojom::MemoryDumpCallbackResultDataView input, | |
| 157 base::trace_event::MemoryDumpCallbackResult* out) { | |
| 158 if (!input.ReadChromeDump(&out->chrome_dump)) | |
| 159 return false; | |
| 160 if (!input.ReadOsDump(&out->os_dump)) | |
| 161 return false; | |
| 162 if (!input.ReadExtraProcessesDump(&out->extra_processes_dump)) | |
| 163 return false; | |
| 164 return true; | |
| 165 } | |
| 166 | |
| 167 } // namespace mojo | 152 } // namespace mojo |
| OLD | NEW |