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" | |
8 #include "base/trace_event/memory_dump_request_args.h" | 9 #include "base/trace_event/memory_dump_request_args.h" |
10 #include "mojo/common/common_custom_types_struct_traits.h" | |
9 #include "services/resource_coordinator/public/interfaces/memory/memory_instrume ntation.mojom.h" | 11 #include "services/resource_coordinator/public/interfaces/memory/memory_instrume ntation.mojom.h" |
10 | 12 |
11 namespace mojo { | 13 namespace mojo { |
12 | 14 |
13 template <> | 15 template <> |
14 struct EnumTraits<memory_instrumentation::mojom::DumpType, | 16 struct EnumTraits<memory_instrumentation::mojom::DumpType, |
15 base::trace_event::MemoryDumpType> { | 17 base::trace_event::MemoryDumpType> { |
16 static memory_instrumentation::mojom::DumpType ToMojom( | 18 static memory_instrumentation::mojom::DumpType ToMojom( |
17 base::trace_event::MemoryDumpType type); | 19 base::trace_event::MemoryDumpType type); |
18 static bool FromMojom(memory_instrumentation::mojom::DumpType input, | 20 static bool FromMojom(memory_instrumentation::mojom::DumpType input, |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
88 memory_instrumentation::mojom::MemoryDumpCallbackResultDataView, | 90 memory_instrumentation::mojom::MemoryDumpCallbackResultDataView, |
89 base::trace_event::MemoryDumpCallbackResult> { | 91 base::trace_event::MemoryDumpCallbackResult> { |
90 static base::trace_event::MemoryDumpCallbackResult::OSMemDump os_dump( | 92 static base::trace_event::MemoryDumpCallbackResult::OSMemDump os_dump( |
91 const base::trace_event::MemoryDumpCallbackResult& args) { | 93 const base::trace_event::MemoryDumpCallbackResult& args) { |
92 return args.os_dump; | 94 return args.os_dump; |
93 } | 95 } |
94 static base::trace_event::MemoryDumpCallbackResult::ChromeMemDump chrome_dump( | 96 static base::trace_event::MemoryDumpCallbackResult::ChromeMemDump chrome_dump( |
95 const base::trace_event::MemoryDumpCallbackResult& args) { | 97 const base::trace_event::MemoryDumpCallbackResult& args) { |
96 return args.chrome_dump; | 98 return args.chrome_dump; |
97 } | 99 } |
100 static std::map<base::ProcessId, | |
Ken Rockot(use gerrit already)
2017/04/19 21:19:37
This should return a const ref, otherwise it will
fmeawad
2017/04/19 21:40:21
Done.
| |
101 base::trace_event::MemoryDumpCallbackResult::OSMemDump> | |
102 extra_processes_dump( | |
103 const base::trace_event::MemoryDumpCallbackResult& args) { | |
104 return args.extra_processes_dump; | |
105 } | |
98 static bool Read( | 106 static bool Read( |
99 memory_instrumentation::mojom::MemoryDumpCallbackResultDataView input, | 107 memory_instrumentation::mojom::MemoryDumpCallbackResultDataView input, |
100 base::trace_event::MemoryDumpCallbackResult* out); | 108 base::trace_event::MemoryDumpCallbackResult* out); |
101 }; | 109 }; |
102 | 110 |
103 } // namespace mojo | 111 } // namespace mojo |
104 | 112 |
105 #endif // SERVICES_RESOURCE_COORDINATOR_PUBLIC_CPP_MEMORY_MEMORY_INSTRUMENTATIO N_STRUCT_TRAITS_H_ | 113 #endif // SERVICES_RESOURCE_COORDINATOR_PUBLIC_CPP_MEMORY_MEMORY_INSTRUMENTATIO N_STRUCT_TRAITS_H_ |
OLD | NEW |