Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(396)

Unified Diff: services/resource_coordinator/public/cpp/memory/memory_instrumentation_struct_traits.h

Issue 2777093009: [Memory UMA] Return a memory summary struct with the ack message (Closed)
Patch Set: Rebase Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: services/resource_coordinator/public/cpp/memory/memory_instrumentation_struct_traits.h
diff --git a/services/resource_coordinator/public/cpp/memory/memory_instrumentation_struct_traits.h b/services/resource_coordinator/public/cpp/memory/memory_instrumentation_struct_traits.h
index c3b2761148f0a4f8f164311e084218ad44f9071c..c9c6770b78382ba7a4c0a5424f6f76c7d40b16c9 100644
--- a/services/resource_coordinator/public/cpp/memory/memory_instrumentation_struct_traits.h
+++ b/services/resource_coordinator/public/cpp/memory/memory_instrumentation_struct_traits.h
@@ -47,6 +47,59 @@ struct StructTraits<memory_instrumentation::mojom::RequestArgsDataView,
base::trace_event::MemoryDumpRequestArgs* out);
};
+template <>
+struct StructTraits<
+ memory_instrumentation::mojom::ChromeMemDumpDataView,
+ base::trace_event::MemoryDumpCallbackResult::ChromeMemDump> {
+ static uint32_t malloc_total_kb(
+ const base::trace_event::MemoryDumpCallbackResult::ChromeMemDump& args) {
+ return args.malloc_total_kb;
+ }
+ static uint32_t partition_alloc_total_kb(
+ const base::trace_event::MemoryDumpCallbackResult::ChromeMemDump& args) {
+ return args.partition_alloc_total_kb;
+ }
+ static uint32_t blink_gc_total_kb(
+ const base::trace_event::MemoryDumpCallbackResult::ChromeMemDump& args) {
+ return args.blink_gc_total_kb;
+ }
+ static uint32_t v8_total_kb(
+ const base::trace_event::MemoryDumpCallbackResult::ChromeMemDump& args) {
+ return args.v8_total_kb;
+ }
+ static bool Read(
+ memory_instrumentation::mojom::ChromeMemDumpDataView input,
+ base::trace_event::MemoryDumpCallbackResult::ChromeMemDump* out);
+};
+
+template <>
+struct StructTraits<memory_instrumentation::mojom::OSMemDumpDataView,
+ base::trace_event::MemoryDumpCallbackResult::OSMemDump> {
+ static uint32_t resident_set_kb(
+ const base::trace_event::MemoryDumpCallbackResult::OSMemDump& args) {
+ return args.resident_set_kb;
+ }
+ static bool Read(memory_instrumentation::mojom::OSMemDumpDataView input,
+ base::trace_event::MemoryDumpCallbackResult::OSMemDump* out);
+};
+
+template <>
+struct StructTraits<
+ memory_instrumentation::mojom::MemoryDumpCallbackResultDataView,
+ base::trace_event::MemoryDumpCallbackResult> {
+ static base::trace_event::MemoryDumpCallbackResult::OSMemDump os_dump(
+ const base::trace_event::MemoryDumpCallbackResult& args) {
+ return args.os_dump;
+ }
+ static base::trace_event::MemoryDumpCallbackResult::ChromeMemDump chrome_dump(
+ const base::trace_event::MemoryDumpCallbackResult& args) {
+ return args.chrome_dump;
+ }
+ static bool Read(
+ memory_instrumentation::mojom::MemoryDumpCallbackResultDataView input,
+ base::trace_event::MemoryDumpCallbackResult* out);
+};
+
} // namespace mojo
#endif // SERVICES_RESOURCE_COORDINATOR_PUBLIC_CPP_MEMORY_MEMORY_INSTRUMENTATION_STRUCT_TRAITS_H_

Powered by Google App Engine
This is Rietveld 408576698