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