1 // Copyright 2018 The Chromium Authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style license that can be 3 // found in the LICENSE file. 4 5 #ifndef MOJO_PUBLIC_CPP_BASE_MEMORY_ALLOCATOR_DUMP_CROSS_PROCESS_UID_MOJOM_TRAITS_H_ 6 #define MOJO_PUBLIC_CPP_BASE_MEMORY_ALLOCATOR_DUMP_CROSS_PROCESS_UID_MOJOM_TRAITS_H_ 7 8 #include "base/component_export.h" 9 #include "base/trace_event/memory_allocator_dump_guid.h" 10 #include "mojo/public/mojom/base/memory_allocator_dump_cross_process_uid.mojom-shared.h" 11 12 namespace mojo { 13 14 template <> COMPONENT_EXPORT(MOJO_BASE_MOJOM)15struct COMPONENT_EXPORT(MOJO_BASE_MOJOM) 16 StructTraits<mojo_base::mojom::MemoryAllocatorDumpCrossProcessUidDataView, 17 base::trace_event::MemoryAllocatorDumpGuid> { 18 static uint64_t value(const base::trace_event::MemoryAllocatorDumpGuid& id) { 19 return id.ToUint64(); 20 } 21 22 static bool Read( 23 mojo_base::mojom::MemoryAllocatorDumpCrossProcessUidDataView data, 24 base::trace_event::MemoryAllocatorDumpGuid* out); 25 }; 26 27 } // namespace mojo 28 29 #endif // MOJO_PUBLIC_CPP_BASE_MEMORY_ALLOCATOR_DUMP_CROSS_PROCESS_UID_MOJOM_TRAITS_H_ 30