blob: 6f373b12e018ef482a33e27796a887926a37bd2c [file] [log] [blame]
// gpu/ipc/common/dx_diag_node.mojom-blink.h is auto generated by mojom_bindings_generator.py, do not edit
// Copyright 2013 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_MOJOM_BLINK_H_
#define GPU_IPC_COMMON_DX_DIAG_NODE_MOJOM_BLINK_H_
#include <stdint.h>
#include <limits>
#include <type_traits>
#include <utility>
#include "third_party/abseil-cpp/absl/types/optional.h"
#include "mojo/public/cpp/bindings/clone_traits.h"
#include "mojo/public/cpp/bindings/equals_traits.h"
#include "mojo/public/cpp/bindings/lib/serialization.h"
#include "mojo/public/cpp/bindings/struct_ptr.h"
#include "mojo/public/cpp/bindings/struct_traits.h"
#include "mojo/public/cpp/bindings/union_traits.h"
#include "third_party/perfetto/include/perfetto/tracing/traced_value_forward.h"
#include "gpu/ipc/common/dx_diag_node.mojom-shared.h"
#include "gpu/ipc/common/dx_diag_node.mojom-blink-forward.h"
#include "mojo/public/cpp/bindings/lib/wtf_clone_equals_util.h"
#include "mojo/public/cpp/bindings/lib/wtf_hash_util.h"
#include "third_party/blink/renderer/platform/wtf/hash_functions.h"
#include "third_party/blink/renderer/platform/wtf/text/wtf_string.h"
#include "third_party/blink/public/platform/web_common.h"
#ifdef KYTHE_IS_RUNNING
#pragma kythe_inline_metadata "Metadata comment"
#endif
namespace gpu {
namespace mojom {
namespace blink {
// @generated_from: gpu.mojom.DxDiagNode
class BLINK_PLATFORM_EXPORT DxDiagNode {
public:
template <typename T>
using EnableIfSame = std::enable_if_t<std::is_same<DxDiagNode, T>::value>;
using DataView = DxDiagNodeDataView;
using Data_ = internal::DxDiagNode_Data;
template <typename... Args>
static DxDiagNodePtr New(Args&&... args) {
return DxDiagNodePtr(
absl::in_place, std::forward<Args>(args)...);
}
template <typename U>
static DxDiagNodePtr From(const U& u) {
return mojo::TypeConverter<DxDiagNodePtr, U>::Convert(u);
}
template <typename U>
U To() const {
return mojo::TypeConverter<U, DxDiagNode>::Convert(*this);
}
DxDiagNode();
DxDiagNode(
const WTF::HashMap<WTF::String, WTF::String>& values,
WTF::HashMap<WTF::String, DxDiagNodePtr> children);
DxDiagNode(const DxDiagNode&) = delete;
DxDiagNode& operator=(const DxDiagNode&) = delete;
~DxDiagNode();
// Clone() is a template so it is only instantiated if it is used. Thus, the
// bindings generator does not need to know whether Clone() or copy
// constructor/assignment are available for members.
template <typename StructPtrType = DxDiagNodePtr>
DxDiagNodePtr Clone() const;
// Equals() is a template so it is only instantiated if it is used. Thus, the
// bindings generator does not need to know whether Equals() or == operator
// are available for members.
template <typename T, DxDiagNode::EnableIfSame<T>* = nullptr>
bool Equals(const T& other) const;
template <typename T, DxDiagNode::EnableIfSame<T>* = nullptr>
bool operator==(const T& rhs) const { return Equals(rhs); }
template <typename UserType>
static WTF::Vector<uint8_t> Serialize(UserType* input) {
return mojo::internal::SerializeImpl<
DxDiagNode::DataView, WTF::Vector<uint8_t>>(input);
}
template <typename UserType>
static mojo::Message SerializeAsMessage(UserType* input) {
return mojo::internal::SerializeAsMessageImpl<
DxDiagNode::DataView>(input);
}
// The returned Message is serialized only if the message is moved
// cross-process or cross-language. Otherwise if the message is Deserialized
// as the same UserType |input| will just be moved to |output| in
// DeserializeFromMessage.
template <typename UserType>
static mojo::Message WrapAsMessage(UserType input) {
return mojo::Message(std::make_unique<
internal::DxDiagNode_UnserializedMessageContext<
UserType, DxDiagNode::DataView>>(0, 0, std::move(input)),
MOJO_CREATE_MESSAGE_FLAG_NONE);
}
template <typename UserType>
static bool Deserialize(const void* data,
size_t data_num_bytes,
UserType* output) {
mojo::Message message;
return mojo::internal::DeserializeImpl<DxDiagNode::DataView>(
message, data, data_num_bytes, output, Validate);
}
template <typename UserType>
static bool Deserialize(const WTF::Vector<uint8_t>& input,
UserType* output) {
return DxDiagNode::Deserialize(
input.size() == 0 ? nullptr : &input.front(), input.size(), output);
}
template <typename UserType>
static bool DeserializeFromMessage(mojo::Message input,
UserType* output) {
auto context = input.TakeUnserializedContext<
internal::DxDiagNode_UnserializedMessageContext<
UserType, DxDiagNode::DataView>>();
if (context) {
*output = std::move(context->TakeData());
return true;
}
input.SerializeIfNecessary();
return mojo::internal::DeserializeImpl<DxDiagNode::DataView>(
input, input.payload(), input.payload_num_bytes(), output, Validate);
}
// @generated_from: gpu.mojom.DxDiagNode.values
WTF::HashMap<WTF::String, WTF::String> values;
// @generated_from: gpu.mojom.DxDiagNode.children
WTF::HashMap<WTF::String, DxDiagNodePtr> children;
// Serialise this struct into a trace.
void WriteIntoTrace(perfetto::TracedValue traced_context) const;
private:
static bool Validate(const void* data,
mojo::internal::ValidationContext* validation_context);
};
// The comparison operators are templates, so they are only instantiated if they
// are used. Thus, the bindings generator does not need to know whether
// comparison operators are available for members.
template <typename T, DxDiagNode::EnableIfSame<T>* = nullptr>
bool operator<(const T& lhs, const T& rhs);
template <typename T, DxDiagNode::EnableIfSame<T>* = nullptr>
bool operator<=(const T& lhs, const T& rhs) {
return !(rhs < lhs);
}
template <typename T, DxDiagNode::EnableIfSame<T>* = nullptr>
bool operator>(const T& lhs, const T& rhs) {
return rhs < lhs;
}
template <typename T, DxDiagNode::EnableIfSame<T>* = nullptr>
bool operator>=(const T& lhs, const T& rhs) {
return !(lhs < rhs);
}
template <typename StructPtrType>
DxDiagNodePtr DxDiagNode::Clone() const {
return New(
mojo::Clone(values),
mojo::Clone(children)
);
}
template <typename T, DxDiagNode::EnableIfSame<T>*>
bool DxDiagNode::Equals(const T& other_struct) const {
if (!mojo::Equals(this->values, other_struct.values))
return false;
if (!mojo::Equals(this->children, other_struct.children))
return false;
return true;
}
template <typename T, DxDiagNode::EnableIfSame<T>*>
bool operator<(const T& lhs, const T& rhs) {
if (lhs.values < rhs.values)
return true;
if (rhs.values < lhs.values)
return false;
if (lhs.children < rhs.children)
return true;
if (rhs.children < lhs.children)
return false;
return false;
}
} // namespace blink
} // namespace mojom
} // namespace gpu
namespace mojo {
template <>
struct BLINK_PLATFORM_EXPORT StructTraits<::gpu::mojom::blink::DxDiagNode::DataView,
::gpu::mojom::blink::DxDiagNodePtr> {
static bool IsNull(const ::gpu::mojom::blink::DxDiagNodePtr& input) { return !input; }
static void SetToNull(::gpu::mojom::blink::DxDiagNodePtr* output) { output->reset(); }
static const decltype(::gpu::mojom::blink::DxDiagNode::values)& values(
const ::gpu::mojom::blink::DxDiagNodePtr& input) {
return input->values;
}
static const decltype(::gpu::mojom::blink::DxDiagNode::children)& children(
const ::gpu::mojom::blink::DxDiagNodePtr& input) {
return input->children;
}
static bool Read(::gpu::mojom::blink::DxDiagNode::DataView input, ::gpu::mojom::blink::DxDiagNodePtr* output);
};
} // namespace mojo
#endif // GPU_IPC_COMMON_DX_DIAG_NODE_MOJOM_BLINK_H_
/* Metadata comment
eyJtZXRhIjogW3siZW5kIjogMTU2NSwgImJlZ2luIjogMTU1NSwgImVkZ2UiOiAiJS9reXRoZS9l
ZGdlL2dlbmVyYXRlcyIsICJ0eXBlIjogImFuY2hvcl9kZWZpbmVzIiwgInZuYW1lIjogeyJjb3Jw
dXMiOiAiY2hyb21pdW0uZ29vZ2xlc291cmNlLmNvbS9jaHJvbWl1bS9zcmMiLCAibGFuZ3VhZ2Ui
OiAibW9qb20iLCAic2lnbmF0dXJlIjogImdwdS5tb2pvbS5EeERpYWdOb2RlIn19LCB7ImVuZCI6
IDUzMTUsICJiZWdpbiI6IDUzMDksICJlZGdlIjogIiUva3l0aGUvZWRnZS9nZW5lcmF0ZXMiLCAi
dHlwZSI6ICJhbmNob3JfZGVmaW5lcyIsICJ2bmFtZSI6IHsiY29ycHVzIjogImNocm9taXVtLmdv
b2dsZXNvdXJjZS5jb20vY2hyb21pdW0vc3JjIiwgImxhbmd1YWdlIjogIm1vam9tIiwgInNpZ25h
dHVyZSI6ICJncHUubW9qb20uRHhEaWFnTm9kZS52YWx1ZXMifX0sIHsiZW5kIjogNTQyMSwgImJl
Z2luIjogNTQxMywgImVkZ2UiOiAiJS9reXRoZS9lZGdlL2dlbmVyYXRlcyIsICJ0eXBlIjogImFu
Y2hvcl9kZWZpbmVzIiwgInZuYW1lIjogeyJjb3JwdXMiOiAiY2hyb21pdW0uZ29vZ2xlc291cmNl
LmNvbS9jaHJvbWl1bS9zcmMiLCAibGFuZ3VhZ2UiOiAibW9qb20iLCAic2lnbmF0dXJlIjogImdw
dS5tb2pvbS5EeERpYWdOb2RlLmNoaWxkcmVuIn19XSwgInR5cGUiOiAia3l0aGUwIn0=
*/