Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef SERVICES_MEMORY_INFRA_PUBLIC_CPP_MEMORY_INFRA_TRAITS_H_ | |
| 6 #define SERVICES_MEMORY_INFRA_PUBLIC_CPP_MEMORY_INFRA_TRAITS_H_ | |
| 7 | |
| 8 #include "base/trace_event/memory_dump_request_args.h" | |
| 9 #include "services/memory_infra/public/interfaces/memory_infra.mojom.h" | |
| 10 | |
| 11 namespace mojo { | |
| 12 | |
| 13 template<> | |
|
Primiano Tucci (use gerrit)
2017/01/16 15:11:04
(not related to your code, more about the mojo arc
chiniforooshan1
2017/01/16 18:14:48
Ken, am I doing this correctly?
| |
| 14 struct EnumTraits<memory_infra::mojom::DumpType, | |
| 15 base::trace_event::MemoryDumpType> { | |
| 16 static memory_infra::mojom::DumpType ToMojom( | |
| 17 base::trace_event::MemoryDumpType type); | |
| 18 static bool FromMojom(memory_infra::mojom::DumpType input, | |
| 19 base::trace_event::MemoryDumpType* out); | |
| 20 }; | |
| 21 | |
| 22 template<> | |
| 23 struct EnumTraits<memory_infra::mojom::LevelOfDetail, | |
| 24 base::trace_event::MemoryDumpLevelOfDetail> { | |
| 25 static memory_infra::mojom::LevelOfDetail ToMojom( | |
| 26 base::trace_event::MemoryDumpLevelOfDetail level_of_detail); | |
| 27 static bool FromMojom(memory_infra::mojom::LevelOfDetail input, | |
| 28 base::trace_event::MemoryDumpLevelOfDetail* out); | |
| 29 }; | |
| 30 | |
| 31 template<> | |
| 32 struct StructTraits<memory_infra::mojom::RequestArgsDataView, | |
| 33 base::trace_event::MemoryDumpRequestArgs> { | |
| 34 static uint64_t dump_guid( | |
| 35 const base::trace_event::MemoryDumpRequestArgs& args) { | |
| 36 return args.dump_guid; | |
| 37 } | |
| 38 static memory_infra::mojom::DumpType dump_type( | |
| 39 const base::trace_event::MemoryDumpRequestArgs& args); | |
| 40 static memory_infra::mojom::LevelOfDetail level_of_detail( | |
| 41 const base::trace_event::MemoryDumpRequestArgs& args); | |
| 42 static bool Read(memory_infra::mojom::RequestArgsDataView input, | |
| 43 base::trace_event::MemoryDumpRequestArgs* out); | |
| 44 }; | |
| 45 | |
| 46 } // namespace mojo | |
| 47 | |
| 48 #endif // SERVICES_MEMORY_INFRA_PUBLIC_CPP_MEMORY_INFRA_TRAITS_H_ | |
| OLD | NEW |