| 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 #ifndef SERVICES_RESOURCE_COORDINATOR_PUBLIC_CPP_MEMORY_MEMORY_INSTRUMENTATION_S
TRUCT_TRAITS_H_ | 5 #ifndef SERVICES_RESOURCE_COORDINATOR_PUBLIC_CPP_MEMORY_MEMORY_INSTRUMENTATION_S
TRUCT_TRAITS_H_ |
| 6 #define SERVICES_RESOURCE_COORDINATOR_PUBLIC_CPP_MEMORY_MEMORY_INSTRUMENTATION_S
TRUCT_TRAITS_H_ | 6 #define SERVICES_RESOURCE_COORDINATOR_PUBLIC_CPP_MEMORY_MEMORY_INSTRUMENTATION_S
TRUCT_TRAITS_H_ |
| 7 | 7 |
| 8 #include "base/process/process_handle.h" | |
| 9 #include "base/trace_event/memory_dump_request_args.h" | 8 #include "base/trace_event/memory_dump_request_args.h" |
| 10 #include "mojo/common/common_custom_types_struct_traits.h" | |
| 11 #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" |
| 12 | 10 |
| 13 namespace mojo { | 11 namespace mojo { |
| 14 | 12 |
| 15 template <> | 13 template <> |
| 16 struct EnumTraits<memory_instrumentation::mojom::DumpType, | 14 struct EnumTraits<memory_instrumentation::mojom::DumpType, |
| 17 base::trace_event::MemoryDumpType> { | 15 base::trace_event::MemoryDumpType> { |
| 18 static memory_instrumentation::mojom::DumpType ToMojom( | 16 static memory_instrumentation::mojom::DumpType ToMojom( |
| 19 base::trace_event::MemoryDumpType type); | 17 base::trace_event::MemoryDumpType type); |
| 20 static bool FromMojom(memory_instrumentation::mojom::DumpType input, | 18 static bool FromMojom(memory_instrumentation::mojom::DumpType input, |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 90 memory_instrumentation::mojom::MemoryDumpCallbackResultDataView, | 88 memory_instrumentation::mojom::MemoryDumpCallbackResultDataView, |
| 91 base::trace_event::MemoryDumpCallbackResult> { | 89 base::trace_event::MemoryDumpCallbackResult> { |
| 92 static base::trace_event::MemoryDumpCallbackResult::OSMemDump os_dump( | 90 static base::trace_event::MemoryDumpCallbackResult::OSMemDump os_dump( |
| 93 const base::trace_event::MemoryDumpCallbackResult& args) { | 91 const base::trace_event::MemoryDumpCallbackResult& args) { |
| 94 return args.os_dump; | 92 return args.os_dump; |
| 95 } | 93 } |
| 96 static base::trace_event::MemoryDumpCallbackResult::ChromeMemDump chrome_dump( | 94 static base::trace_event::MemoryDumpCallbackResult::ChromeMemDump chrome_dump( |
| 97 const base::trace_event::MemoryDumpCallbackResult& args) { | 95 const base::trace_event::MemoryDumpCallbackResult& args) { |
| 98 return args.chrome_dump; | 96 return args.chrome_dump; |
| 99 } | 97 } |
| 100 static const std::map<base::ProcessId, | |
| 101 base::trace_event::MemoryDumpCallbackResult::OSMemDump>& | |
| 102 extra_processes_dump( | |
| 103 const base::trace_event::MemoryDumpCallbackResult& args) { | |
| 104 return args.extra_processes_dump; | |
| 105 } | |
| 106 static bool Read( | 98 static bool Read( |
| 107 memory_instrumentation::mojom::MemoryDumpCallbackResultDataView input, | 99 memory_instrumentation::mojom::MemoryDumpCallbackResultDataView input, |
| 108 base::trace_event::MemoryDumpCallbackResult* out); | 100 base::trace_event::MemoryDumpCallbackResult* out); |
| 109 }; | 101 }; |
| 110 | 102 |
| 111 } // namespace mojo | 103 } // namespace mojo |
| 112 | 104 |
| 113 #endif // SERVICES_RESOURCE_COORDINATOR_PUBLIC_CPP_MEMORY_MEMORY_INSTRUMENTATIO
N_STRUCT_TRAITS_H_ | 105 #endif // SERVICES_RESOURCE_COORDINATOR_PUBLIC_CPP_MEMORY_MEMORY_INSTRUMENTATIO
N_STRUCT_TRAITS_H_ |
| OLD | NEW |