forked from chromium/chromium
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This CL contains struct traits of the structs used by gpu::GPUInfo BUG=622707 CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_optional_gpu_tests_rel;master.tryserver.chromium.mac:mac_optional_gpu_tests_rel;master.tryserver.chromium.win:win_optional_gpu_tests_rel Review-Url: https://codereview.chromium.org/2147693002 Cr-Commit-Position: refs/heads/master@{#410053}
- Loading branch information
Showing
21 changed files
with
614 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
// Copyright 2014 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. | ||
|
||
module gpu.mojom; | ||
|
||
// gpu/config/dx_diag_node.h | ||
// gpu::DxDiagNode | ||
struct DxDiagNode { | ||
map<string, string> values; | ||
map<string, DxDiagNode> children; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# 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. | ||
|
||
mojom = "//gpu/ipc/common/dx_diag_node.mojom" | ||
public_headers = [ "//gpu/config/dx_diag_node.h" ] | ||
traits_headers = [ "//gpu/ipc/common/dx_diag_node_struct_traits.h" ] | ||
sources = [ | ||
"//gpu/ipc/common/dx_diag_node_struct_traits.cc", | ||
] | ||
type_mappings = [ "gpu.mojom.DxDiagNode=gpu::DxDiagNode" ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
// 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. | ||
|
||
#include "gpu/ipc/common/dx_diag_node_struct_traits.h" | ||
|
||
namespace mojo { | ||
|
||
// static | ||
bool StructTraits<gpu::mojom::DxDiagNode, gpu::DxDiagNode>::Read( | ||
gpu::mojom::DxDiagNodeDataView data, | ||
gpu::DxDiagNode* out) { | ||
return data.ReadValues(&out->values) && data.ReadChildren(&out->children); | ||
} | ||
|
||
} // namespace mojo |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
// 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); | ||
|
||
static const std::map<std::string, std::string>& values( | ||
const gpu::DxDiagNode& node) { | ||
return node.values; | ||
} | ||
|
||
static const std::map<std::string, gpu::DxDiagNode>& children( | ||
const gpu::DxDiagNode& node) { | ||
return node.children; | ||
} | ||
}; | ||
|
||
} // namespace mojo | ||
|
||
#endif // GPU_IPC_COMMON_DX_DIAG_NODE_STRUCT_TRAITS_H_ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.