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

Unified Diff: services/memory_infra/public/cpp/memory_infra_traits.h

Issue 2621143002: memory-infra: Introduce mojo interfaces and service stubs (Closed)
Patch Set: Created 3 years, 11 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/memory_infra/public/cpp/memory_infra_traits.h
diff --git a/services/memory_infra/public/cpp/memory_infra_traits.h b/services/memory_infra/public/cpp/memory_infra_traits.h
new file mode 100644
index 0000000000000000000000000000000000000000..3ad5e9fc7550a2dc817d5e18bd2192247c61e9df
--- /dev/null
+++ b/services/memory_infra/public/cpp/memory_infra_traits.h
@@ -0,0 +1,48 @@
+// Copyright 2017 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef SERVICES_MEMORY_INFRA_PUBLIC_CPP_MEMORY_INFRA_TRAITS_H_
+#define SERVICES_MEMORY_INFRA_PUBLIC_CPP_MEMORY_INFRA_TRAITS_H_
+
+#include "base/trace_event/memory_dump_request_args.h"
+#include "services/memory_infra/public/interfaces/memory_infra.mojom.h"
+
+namespace mojo {
+
+template<>
+struct EnumTraits<memory_infra::mojom::DumpType,
+ base::trace_event::MemoryDumpType> {
+ static memory_infra::mojom::DumpType ToMojom(
+ base::trace_event::MemoryDumpType type);
+ static bool FromMojom(memory_infra::mojom::DumpType input,
+ base::trace_event::MemoryDumpType* out);
+};
+
+template<>
+struct EnumTraits<memory_infra::mojom::LevelOfDetail,
+ base::trace_event::MemoryDumpLevelOfDetail> {
+ static memory_infra::mojom::LevelOfDetail ToMojom(
+ base::trace_event::MemoryDumpLevelOfDetail level_of_detail);
+ static bool FromMojom(memory_infra::mojom::LevelOfDetail input,
+ base::trace_event::MemoryDumpLevelOfDetail* out);
+};
+
+template<>
+struct StructTraits<memory_infra::mojom::RequestArgsDataView,
+ base::trace_event::MemoryDumpRequestArgs> {
+ static uint64_t dump_guid(
+ const base::trace_event::MemoryDumpRequestArgs& args) {
+ return args.dump_guid;
+ }
+ static memory_infra::mojom::DumpType dump_type(
+ const base::trace_event::MemoryDumpRequestArgs& args);
+ static memory_infra::mojom::LevelOfDetail level_of_detail(
+ const base::trace_event::MemoryDumpRequestArgs& args);
+ static bool Read(memory_infra::mojom::RequestArgsDataView input,
+ base::trace_event::MemoryDumpRequestArgs* out);
+};
+
+} // namespace mojo
+
+#endif // SERVICES_MEMORY_INFRA_PUBLIC_CPP_MEMORY_INFRA_TRAITS_H_

Powered by Google App Engine
This is Rietveld 408576698