Chromium Code Reviews| Index: gpu/ipc/common/dx_diag_node_struct_traits.h |
| diff --git a/gpu/ipc/common/dx_diag_node_struct_traits.h b/gpu/ipc/common/dx_diag_node_struct_traits.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..cb67be34cd53ac7e0185c5f3e2be86950c554fcf |
| --- /dev/null |
| +++ b/gpu/ipc/common/dx_diag_node_struct_traits.h |
| @@ -0,0 +1,31 @@ |
| +// Copyright 2016 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 GPU_IPC_COMMON_DX_DIAG_NODE_STRUCT_TRAITS_H_ |
| +#define GPU_IPC_COMMON_DX_DIAG_NODE_STRUCT_TRAITS_H_ |
| + |
| +#include "gpu/ipc/common/dx_diag_node.mojom.h" |
| + |
| +namespace mojo { |
| + |
| +template <> |
| +struct StructTraits<gpu::mojom::DxDiagNode, gpu::DxDiagNode> { |
| + static bool Read(gpu::mojom::DxDiagNodeDataView data, gpu::DxDiagNode* out) { |
| + return data.ReadValues(&out->values) && data.ReadChildren(&out->children); |
| + } |
| + |
| + static const std::map<std::string, std::string> values( |
|
Fady Samuel
2016/07/18 15:59:39
return reference.
const std::map<std::string, std
Alex Z.
2016/07/19 15:13:19
Done.
|
| + const gpu::DxDiagNode& node) { |
| + return node.values; |
| + } |
| + |
| + static const std::map<std::string, gpu::DxDiagNode> children( |
|
Fady Samuel
2016/07/18 15:59:39
return reference:
const std::map<std::string, std
Alex Z.
2016/07/19 15:13:19
Done.
|
| + const gpu::DxDiagNode& node) { |
| + return node.children; |
| + } |
| +}; |
| + |
| +} // namespace mojo |
| + |
| +#endif // GPU_IPC_COMMON_DX_DIAG_NODE_STRUCT_TRAITS_H_ |