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

Side by Side Diff: services/memory_infra/public/cpp/memory_infra_traits.h

Issue 2621143002: memory-infra: Introduce mojo interfaces and service stubs (Closed)
Patch Set: review 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 unified diff | Download patch
OLDNEW
(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<>
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(
Ken Rockot(use gerrit already) 2017/01/17 19:34:53 This implementation (and level_of_detail below) is
chiniforooshan1 2017/01/17 21:26:23 Done.
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_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698