blob: cc648fddfb08a9cbc0702a4f8bfe1b90e2eb8af7 [file] [log] [blame]
// gpu/ipc/common/mailbox_holder.mojom-blink.cc 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.
#if defined(__clang__)
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wunused-private-field"
#endif
#include "gpu/ipc/common/mailbox_holder.mojom-blink.h"
#include <math.h>
#include <stdint.h>
#include <utility>
#include "base/debug/alias.h"
#include "base/hash/md5_constexpr.h"
#include "base/run_loop.h"
#include "base/strings/string_number_conversions.h"
#include "base/trace_event/trace_event.h"
#include "base/trace_event/typed_macros.h"
#include "mojo/public/cpp/bindings/lib/generated_code_util.h"
#include "mojo/public/cpp/bindings/lib/message_internal.h"
#include "mojo/public/cpp/bindings/lib/send_message_helper.h"
#include "mojo/public/cpp/bindings/lib/proxy_to_responder.h"
#include "mojo/public/cpp/bindings/lib/serialization_util.h"
#include "mojo/public/cpp/bindings/lib/unserialized_message_context.h"
#include "mojo/public/cpp/bindings/lib/validate_params.h"
#include "mojo/public/cpp/bindings/lib/validation_errors.h"
#include "mojo/public/cpp/bindings/mojo_buildflags.h"
#include "mojo/public/interfaces/bindings/interface_control_messages.mojom.h"
#include "third_party/perfetto/include/perfetto/tracing/traced_value.h"
#include "gpu/ipc/common/mailbox_holder.mojom-params-data.h"
#include "gpu/ipc/common/mailbox_holder.mojom-shared-message-ids.h"
#include "gpu/ipc/common/mailbox_holder.mojom-blink-import-headers.h"
#include "gpu/ipc/common/mailbox_holder.mojom-blink-test-utils.h"
#include "mojo/public/cpp/bindings/lib/wtf_serialization.h"
#ifndef GPU_IPC_COMMON_MAILBOX_HOLDER_MOJOM_BLINK_JUMBO_H_
#define GPU_IPC_COMMON_MAILBOX_HOLDER_MOJOM_BLINK_JUMBO_H_
#endif
namespace gpu {
namespace mojom {
namespace blink {
MailboxHolder::MailboxHolder()
: mailbox(),
sync_token(),
texture_target() {}
MailboxHolder::MailboxHolder(
const ::gpu::Mailbox& mailbox_in,
const ::gpu::SyncToken& sync_token_in,
uint32_t texture_target_in)
: mailbox(std::move(mailbox_in)),
sync_token(std::move(sync_token_in)),
texture_target(std::move(texture_target_in)) {}
MailboxHolder::~MailboxHolder() = default;
void MailboxHolder::WriteIntoTrace(
perfetto::TracedValue traced_context) const {
[[maybe_unused]] auto dict = std::move(traced_context).WriteDictionary();
perfetto::WriteIntoTracedValueWithFallback(
dict.AddItem(
"mailbox"), this->mailbox,
#if BUILDFLAG(MOJO_TRACE_ENABLED)
"<value of type const ::gpu::Mailbox&>"
#else
"<value>"
#endif // BUILDFLAG(MOJO_TRACE_ENABLED)
);
perfetto::WriteIntoTracedValueWithFallback(
dict.AddItem(
"sync_token"), this->sync_token,
#if BUILDFLAG(MOJO_TRACE_ENABLED)
"<value of type const ::gpu::SyncToken&>"
#else
"<value>"
#endif // BUILDFLAG(MOJO_TRACE_ENABLED)
);
perfetto::WriteIntoTracedValueWithFallback(
dict.AddItem(
"texture_target"), this->texture_target,
#if BUILDFLAG(MOJO_TRACE_ENABLED)
"<value of type uint32_t>"
#else
"<value>"
#endif // BUILDFLAG(MOJO_TRACE_ENABLED)
);
}
bool MailboxHolder::Validate(
const void* data,
mojo::internal::ValidationContext* validation_context) {
return Data_::Validate(data, validation_context);
}
} // namespace blink
} // namespace mojom
} // namespace gpu
namespace mojo {
// static
bool StructTraits<::gpu::mojom::blink::MailboxHolder::DataView, ::gpu::mojom::blink::MailboxHolderPtr>::Read(
::gpu::mojom::blink::MailboxHolder::DataView input,
::gpu::mojom::blink::MailboxHolderPtr* output) {
bool success = true;
::gpu::mojom::blink::MailboxHolderPtr result(::gpu::mojom::blink::MailboxHolder::New());
if (success && !input.ReadMailbox(&result->mailbox))
success = false;
if (success && !input.ReadSyncToken(&result->sync_token))
success = false;
if (success)
result->texture_target = input.texture_target();
*output = std::move(result);
return success;
}
} // namespace mojo
// Symbols declared in the -test-utils.h header are defined here instead of a
// separate .cc file to save compile time.
namespace gpu {
namespace mojom {
namespace blink {
} // namespace blink
} // namespace mojom
} // namespace gpu
#if defined(__clang__)
#pragma clang diagnostic pop
#endif