| 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 "mojo/common/common_custom_types_struct_traits.h" | |
| 9 #include "services/resource_coordinator/public/interfaces/memory/memory_instrume
ntation.mojom.h" | 8 #include "services/resource_coordinator/public/interfaces/memory/memory_instrume
ntation.mojom.h" |
| 10 | 9 |
| 11 namespace mojo { | 10 namespace mojo { |
| 12 | 11 |
| 13 // static | 12 // static |
| 14 memory_instrumentation::mojom::DumpType | 13 memory_instrumentation::mojom::DumpType |
| 15 EnumTraits<memory_instrumentation::mojom::DumpType, | 14 EnumTraits<memory_instrumentation::mojom::DumpType, |
| 16 base::trace_event::MemoryDumpType>:: | 15 base::trace_event::MemoryDumpType>:: |
| 17 ToMojom(base::trace_event::MemoryDumpType type) { | 16 ToMojom(base::trace_event::MemoryDumpType type) { |
| 18 switch (type) { | 17 switch (type) { |
| (...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 129 // static | 128 // static |
| 130 bool StructTraits< | 129 bool StructTraits< |
| 131 memory_instrumentation::mojom::MemoryDumpCallbackResultDataView, | 130 memory_instrumentation::mojom::MemoryDumpCallbackResultDataView, |
| 132 base::trace_event::MemoryDumpCallbackResult>:: | 131 base::trace_event::MemoryDumpCallbackResult>:: |
| 133 Read(memory_instrumentation::mojom::MemoryDumpCallbackResultDataView input, | 132 Read(memory_instrumentation::mojom::MemoryDumpCallbackResultDataView input, |
| 134 base::trace_event::MemoryDumpCallbackResult* out) { | 133 base::trace_event::MemoryDumpCallbackResult* out) { |
| 135 if (!input.ReadChromeDump(&out->chrome_dump)) | 134 if (!input.ReadChromeDump(&out->chrome_dump)) |
| 136 return false; | 135 return false; |
| 137 if (!input.ReadOsDump(&out->os_dump)) | 136 if (!input.ReadOsDump(&out->os_dump)) |
| 138 return false; | 137 return false; |
| 139 if (!input.ReadExtraProcessesDump(&out->extra_processes_dump)) | |
| 140 return false; | |
| 141 return true; | 138 return true; |
| 142 } | 139 } |
| 143 | 140 |
| 144 } // namespace mojo | 141 } // namespace mojo |
| OLD | NEW |