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

Side by Side Diff: services/resource_coordinator/public/cpp/coordination_unit_struct_traits.h

Issue 2798713002: Global Resource Coordinator: Basic service internals (Closed)
Patch Set: Buildfix after rebase Created 3 years, 7 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_RESOURCE_COORDINATOR_PUBLIC_CPP_COORDINATION_UNIT_STRUCT_TRAITS _H_
6 #define SERVICES_RESOURCE_COORDINATOR_PUBLIC_CPP_COORDINATION_UNIT_STRUCT_TRAITS _H_
7
8 #include "services/resource_coordinator/public/cpp/coordination_unit_types.h"
9 #include "services/resource_coordinator/public/interfaces/coordination_unit.mojo m.h"
10
11 namespace mojo {
12
13 template <>
14 struct EnumTraits<resource_coordinator::mojom::CoordinationUnitType,
15 resource_coordinator::CoordinationUnitType> {
16 static resource_coordinator::mojom::CoordinationUnitType ToMojom(
17 resource_coordinator::CoordinationUnitType type);
18 static bool FromMojom(resource_coordinator::mojom::CoordinationUnitType input,
19 resource_coordinator::CoordinationUnitType* out);
20 };
21
22 template <>
23 struct StructTraits<resource_coordinator::mojom::CoordinationUnitIDDataView,
24 resource_coordinator::CoordinationUnitID> {
25 static uint64_t id(const resource_coordinator::CoordinationUnitID& id) {
26 return id.id;
27 }
28 static resource_coordinator::CoordinationUnitType type(
29 const resource_coordinator::CoordinationUnitID& id) {
30 return id.type;
31 }
32 static bool Read(
33 resource_coordinator::mojom::CoordinationUnitIDDataView input,
34 resource_coordinator::CoordinationUnitID* out);
35 };
36
37 } // namespace mojo
38
39 #endif // SERVICES_RESOURCE_COORDINATOR_PUBLIC_CPP_COORDINATION_UNIT_STRUCT_TRA ITS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698