// services/viz/privileged/mojom/gl/gpu_host.mojom.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 "services/viz/privileged/mojom/gl/gpu_host.mojom.h"

#include <math.h>
#include <stdint.h>
#include <utility>

#include "base/hash/md5_constexpr.h"
#include "base/run_loop.h"
#include "base/strings/string_number_conversions.h"
#include "base/task/common/task_annotator.h"
#include "base/trace_event/trace_conversion_helper.h"
#include "base/trace_event/traced_value.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/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_context.h"
#include "mojo/public/cpp/bindings/lib/validation_errors.h"
#include "mojo/public/interfaces/bindings/interface_control_messages.mojom.h"

#include "services/viz/privileged/mojom/gl/gpu_host.mojom-params-data.h"
#include "services/viz/privileged/mojom/gl/gpu_host.mojom-shared-message-ids.h"

#include "services/viz/privileged/mojom/gl/gpu_host.mojom-import-headers.h"


#ifndef SERVICES_VIZ_PRIVILEGED_MOJOM_GL_GPU_HOST_MOJOM_JUMBO_H_
#define SERVICES_VIZ_PRIVILEGED_MOJOM_GL_GPU_HOST_MOJOM_JUMBO_H_
#endif
namespace viz {
namespace mojom {
const char GpuHost::Name_[] = "viz.mojom.GpuHost";

GpuHostProxy::GpuHostProxy(mojo::MessageReceiverWithResponder* receiver)
    : receiver_(receiver) {
}

void GpuHostProxy::DidInitialize(
    const ::gpu::GPUInfo& in_gpu_info, const ::gpu::GpuFeatureInfo& in_gpu_feature_info, const base::Optional<::gpu::GPUInfo>& in_gpu_info_for_hardware_gpu, const base::Optional<::gpu::GpuFeatureInfo>& in_gpu_feature_info_for_hardware_gpu, const ::gpu::GpuExtraInfo& in_gpu_extra_info) {
#if BUILDFLAG(MOJO_TRACE_ENABLED)
  TRACE_EVENT1(
    "mojom", "viz::mojom::GpuHost::DidInitialize", "input_parameters",
    [&](){
      auto value = std::make_unique<base::trace_event::TracedValue>();
      base::trace_event::TracedValue* raw_value = value.get();
      raw_value->SetString("gpu_info", base::trace_event::ValueToString(in_gpu_info, "<value of type const ::gpu::GPUInfo&>"));
      raw_value->SetString("gpu_feature_info", base::trace_event::ValueToString(in_gpu_feature_info, "<value of type const ::gpu::GpuFeatureInfo&>"));
      raw_value->SetString("gpu_info_for_hardware_gpu", base::trace_event::ValueToString(in_gpu_info_for_hardware_gpu, "<value of type const base::Optional<::gpu::GPUInfo>&>"));
      raw_value->SetString("gpu_feature_info_for_hardware_gpu", base::trace_event::ValueToString(in_gpu_feature_info_for_hardware_gpu, "<value of type const base::Optional<::gpu::GpuFeatureInfo>&>"));
      raw_value->SetString("gpu_extra_info", base::trace_event::ValueToString(in_gpu_extra_info, "<value of type const ::gpu::GpuExtraInfo&>"));
      return value;
    }());
#endif
  const bool kExpectsResponse = false;
  const bool kIsSync = false;
  
  const uint32_t kFlags =
      ((kExpectsResponse) ? mojo::Message::kFlagExpectsResponse : 0) |
      ((kIsSync) ? mojo::Message::kFlagIsSync : 0);
  
  mojo::Message message(
      internal::kGpuHost_DidInitialize_Name, kFlags, 0, 0, nullptr);
  auto* buffer = message.payload_buffer();
  ::viz::mojom::internal::GpuHost_DidInitialize_Params_Data::BufferWriter
      params;
  mojo::internal::SerializationContext serialization_context;
  params.Allocate(buffer);
  typename decltype(params->gpu_info)::BaseType::BufferWriter
      gpu_info_writer;
  mojo::internal::Serialize<::gpu::mojom::GpuInfoDataView>(
      in_gpu_info, buffer, &gpu_info_writer, &serialization_context);
  params->gpu_info.Set(
      gpu_info_writer.is_null() ? nullptr : gpu_info_writer.data());
  MOJO_INTERNAL_DLOG_SERIALIZATION_WARNING(
      params->gpu_info.is_null(),
      mojo::internal::VALIDATION_ERROR_UNEXPECTED_NULL_POINTER,
      "null gpu_info in GpuHost.DidInitialize request");
  typename decltype(params->gpu_feature_info)::BaseType::BufferWriter
      gpu_feature_info_writer;
  mojo::internal::Serialize<::gpu::mojom::GpuFeatureInfoDataView>(
      in_gpu_feature_info, buffer, &gpu_feature_info_writer, &serialization_context);
  params->gpu_feature_info.Set(
      gpu_feature_info_writer.is_null() ? nullptr : gpu_feature_info_writer.data());
  MOJO_INTERNAL_DLOG_SERIALIZATION_WARNING(
      params->gpu_feature_info.is_null(),
      mojo::internal::VALIDATION_ERROR_UNEXPECTED_NULL_POINTER,
      "null gpu_feature_info in GpuHost.DidInitialize request");
  typename decltype(params->gpu_info_for_hardware_gpu)::BaseType::BufferWriter
      gpu_info_for_hardware_gpu_writer;
  mojo::internal::Serialize<::gpu::mojom::GpuInfoDataView>(
      in_gpu_info_for_hardware_gpu, buffer, &gpu_info_for_hardware_gpu_writer, &serialization_context);
  params->gpu_info_for_hardware_gpu.Set(
      gpu_info_for_hardware_gpu_writer.is_null() ? nullptr : gpu_info_for_hardware_gpu_writer.data());
  typename decltype(params->gpu_feature_info_for_hardware_gpu)::BaseType::BufferWriter
      gpu_feature_info_for_hardware_gpu_writer;
  mojo::internal::Serialize<::gpu::mojom::GpuFeatureInfoDataView>(
      in_gpu_feature_info_for_hardware_gpu, buffer, &gpu_feature_info_for_hardware_gpu_writer, &serialization_context);
  params->gpu_feature_info_for_hardware_gpu.Set(
      gpu_feature_info_for_hardware_gpu_writer.is_null() ? nullptr : gpu_feature_info_for_hardware_gpu_writer.data());
  typename decltype(params->gpu_extra_info)::BaseType::BufferWriter
      gpu_extra_info_writer;
  mojo::internal::Serialize<::gpu::mojom::GpuExtraInfoDataView>(
      in_gpu_extra_info, buffer, &gpu_extra_info_writer, &serialization_context);
  params->gpu_extra_info.Set(
      gpu_extra_info_writer.is_null() ? nullptr : gpu_extra_info_writer.data());
  MOJO_INTERNAL_DLOG_SERIALIZATION_WARNING(
      params->gpu_extra_info.is_null(),
      mojo::internal::VALIDATION_ERROR_UNEXPECTED_NULL_POINTER,
      "null gpu_extra_info in GpuHost.DidInitialize request");
  message.AttachHandlesFromSerializationContext(
      &serialization_context);

#if defined(ENABLE_IPC_FUZZER)
  message.set_interface_name(GpuHost::Name_);
  message.set_method_name("DidInitialize");
#endif
  // This return value may be ignored as false implies the Connector has
  // encountered an error, which will be visible through other means.
  ignore_result(receiver_->Accept(&message));
}

void GpuHostProxy::DidFailInitialize(
    ) {
#if BUILDFLAG(MOJO_TRACE_ENABLED)
  TRACE_EVENT0("mojom", "viz::mojom::GpuHost::DidFailInitialize");
#endif
  const bool kExpectsResponse = false;
  const bool kIsSync = false;
  
  const uint32_t kFlags =
      ((kExpectsResponse) ? mojo::Message::kFlagExpectsResponse : 0) |
      ((kIsSync) ? mojo::Message::kFlagIsSync : 0);
  
  mojo::Message message(
      internal::kGpuHost_DidFailInitialize_Name, kFlags, 0, 0, nullptr);
  auto* buffer = message.payload_buffer();
  ::viz::mojom::internal::GpuHost_DidFailInitialize_Params_Data::BufferWriter
      params;
  mojo::internal::SerializationContext serialization_context;
  params.Allocate(buffer);
  message.AttachHandlesFromSerializationContext(
      &serialization_context);

#if defined(ENABLE_IPC_FUZZER)
  message.set_interface_name(GpuHost::Name_);
  message.set_method_name("DidFailInitialize");
#endif
  // This return value may be ignored as false implies the Connector has
  // encountered an error, which will be visible through other means.
  ignore_result(receiver_->Accept(&message));
}

void GpuHostProxy::DidCreateContextSuccessfully(
    ) {
#if BUILDFLAG(MOJO_TRACE_ENABLED)
  TRACE_EVENT0("mojom", "viz::mojom::GpuHost::DidCreateContextSuccessfully");
#endif
  const bool kExpectsResponse = false;
  const bool kIsSync = false;
  
  const uint32_t kFlags =
      ((kExpectsResponse) ? mojo::Message::kFlagExpectsResponse : 0) |
      ((kIsSync) ? mojo::Message::kFlagIsSync : 0);
  
  mojo::Message message(
      internal::kGpuHost_DidCreateContextSuccessfully_Name, kFlags, 0, 0, nullptr);
  auto* buffer = message.payload_buffer();
  ::viz::mojom::internal::GpuHost_DidCreateContextSuccessfully_Params_Data::BufferWriter
      params;
  mojo::internal::SerializationContext serialization_context;
  params.Allocate(buffer);
  message.AttachHandlesFromSerializationContext(
      &serialization_context);

#if defined(ENABLE_IPC_FUZZER)
  message.set_interface_name(GpuHost::Name_);
  message.set_method_name("DidCreateContextSuccessfully");
#endif
  // This return value may be ignored as false implies the Connector has
  // encountered an error, which will be visible through other means.
  ignore_result(receiver_->Accept(&message));
}

void GpuHostProxy::DidCreateOffscreenContext(
    const ::GURL& in_url) {
#if BUILDFLAG(MOJO_TRACE_ENABLED)
  TRACE_EVENT1(
    "mojom", "viz::mojom::GpuHost::DidCreateOffscreenContext", "input_parameters",
    [&](){
      auto value = std::make_unique<base::trace_event::TracedValue>();
      base::trace_event::TracedValue* raw_value = value.get();
      raw_value->SetString("url", base::trace_event::ValueToString(in_url, "<value of type const ::GURL&>"));
      return value;
    }());
#endif
  const bool kExpectsResponse = false;
  const bool kIsSync = false;
  
  const uint32_t kFlags =
      ((kExpectsResponse) ? mojo::Message::kFlagExpectsResponse : 0) |
      ((kIsSync) ? mojo::Message::kFlagIsSync : 0);
  
  mojo::Message message(
      internal::kGpuHost_DidCreateOffscreenContext_Name, kFlags, 0, 0, nullptr);
  auto* buffer = message.payload_buffer();
  ::viz::mojom::internal::GpuHost_DidCreateOffscreenContext_Params_Data::BufferWriter
      params;
  mojo::internal::SerializationContext serialization_context;
  params.Allocate(buffer);
  typename decltype(params->url)::BaseType::BufferWriter
      url_writer;
  mojo::internal::Serialize<::url::mojom::UrlDataView>(
      in_url, buffer, &url_writer, &serialization_context);
  params->url.Set(
      url_writer.is_null() ? nullptr : url_writer.data());
  MOJO_INTERNAL_DLOG_SERIALIZATION_WARNING(
      params->url.is_null(),
      mojo::internal::VALIDATION_ERROR_UNEXPECTED_NULL_POINTER,
      "null url in GpuHost.DidCreateOffscreenContext request");
  message.AttachHandlesFromSerializationContext(
      &serialization_context);

#if defined(ENABLE_IPC_FUZZER)
  message.set_interface_name(GpuHost::Name_);
  message.set_method_name("DidCreateOffscreenContext");
#endif
  // This return value may be ignored as false implies the Connector has
  // encountered an error, which will be visible through other means.
  ignore_result(receiver_->Accept(&message));
}

void GpuHostProxy::DidDestroyOffscreenContext(
    const ::GURL& in_url) {
#if BUILDFLAG(MOJO_TRACE_ENABLED)
  TRACE_EVENT1(
    "mojom", "viz::mojom::GpuHost::DidDestroyOffscreenContext", "input_parameters",
    [&](){
      auto value = std::make_unique<base::trace_event::TracedValue>();
      base::trace_event::TracedValue* raw_value = value.get();
      raw_value->SetString("url", base::trace_event::ValueToString(in_url, "<value of type const ::GURL&>"));
      return value;
    }());
#endif
  const bool kExpectsResponse = false;
  const bool kIsSync = false;
  
  const uint32_t kFlags =
      ((kExpectsResponse) ? mojo::Message::kFlagExpectsResponse : 0) |
      ((kIsSync) ? mojo::Message::kFlagIsSync : 0);
  
  mojo::Message message(
      internal::kGpuHost_DidDestroyOffscreenContext_Name, kFlags, 0, 0, nullptr);
  auto* buffer = message.payload_buffer();
  ::viz::mojom::internal::GpuHost_DidDestroyOffscreenContext_Params_Data::BufferWriter
      params;
  mojo::internal::SerializationContext serialization_context;
  params.Allocate(buffer);
  typename decltype(params->url)::BaseType::BufferWriter
      url_writer;
  mojo::internal::Serialize<::url::mojom::UrlDataView>(
      in_url, buffer, &url_writer, &serialization_context);
  params->url.Set(
      url_writer.is_null() ? nullptr : url_writer.data());
  MOJO_INTERNAL_DLOG_SERIALIZATION_WARNING(
      params->url.is_null(),
      mojo::internal::VALIDATION_ERROR_UNEXPECTED_NULL_POINTER,
      "null url in GpuHost.DidDestroyOffscreenContext request");
  message.AttachHandlesFromSerializationContext(
      &serialization_context);

#if defined(ENABLE_IPC_FUZZER)
  message.set_interface_name(GpuHost::Name_);
  message.set_method_name("DidDestroyOffscreenContext");
#endif
  // This return value may be ignored as false implies the Connector has
  // encountered an error, which will be visible through other means.
  ignore_result(receiver_->Accept(&message));
}

void GpuHostProxy::DidDestroyChannel(
    int32_t in_client_id) {
#if BUILDFLAG(MOJO_TRACE_ENABLED)
  TRACE_EVENT1(
    "mojom", "viz::mojom::GpuHost::DidDestroyChannel", "input_parameters",
    [&](){
      auto value = std::make_unique<base::trace_event::TracedValue>();
      base::trace_event::TracedValue* raw_value = value.get();
      raw_value->SetInteger("client_id", in_client_id);
      return value;
    }());
#endif
  const bool kExpectsResponse = false;
  const bool kIsSync = false;
  
  const uint32_t kFlags =
      ((kExpectsResponse) ? mojo::Message::kFlagExpectsResponse : 0) |
      ((kIsSync) ? mojo::Message::kFlagIsSync : 0);
  
  mojo::Message message(
      internal::kGpuHost_DidDestroyChannel_Name, kFlags, 0, 0, nullptr);
  auto* buffer = message.payload_buffer();
  ::viz::mojom::internal::GpuHost_DidDestroyChannel_Params_Data::BufferWriter
      params;
  mojo::internal::SerializationContext serialization_context;
  params.Allocate(buffer);
  params->client_id = in_client_id;
  message.AttachHandlesFromSerializationContext(
      &serialization_context);

#if defined(ENABLE_IPC_FUZZER)
  message.set_interface_name(GpuHost::Name_);
  message.set_method_name("DidDestroyChannel");
#endif
  // This return value may be ignored as false implies the Connector has
  // encountered an error, which will be visible through other means.
  ignore_result(receiver_->Accept(&message));
}

void GpuHostProxy::DidDestroyAllChannels(
    ) {
#if BUILDFLAG(MOJO_TRACE_ENABLED)
  TRACE_EVENT0("mojom", "viz::mojom::GpuHost::DidDestroyAllChannels");
#endif
  const bool kExpectsResponse = false;
  const bool kIsSync = false;
  
  const uint32_t kFlags =
      ((kExpectsResponse) ? mojo::Message::kFlagExpectsResponse : 0) |
      ((kIsSync) ? mojo::Message::kFlagIsSync : 0);
  
  mojo::Message message(
      internal::kGpuHost_DidDestroyAllChannels_Name, kFlags, 0, 0, nullptr);
  auto* buffer = message.payload_buffer();
  ::viz::mojom::internal::GpuHost_DidDestroyAllChannels_Params_Data::BufferWriter
      params;
  mojo::internal::SerializationContext serialization_context;
  params.Allocate(buffer);
  message.AttachHandlesFromSerializationContext(
      &serialization_context);

#if defined(ENABLE_IPC_FUZZER)
  message.set_interface_name(GpuHost::Name_);
  message.set_method_name("DidDestroyAllChannels");
#endif
  // This return value may be ignored as false implies the Connector has
  // encountered an error, which will be visible through other means.
  ignore_result(receiver_->Accept(&message));
}

void GpuHostProxy::DidLoseContext(
    bool in_offscreen, ::gpu::error::ContextLostReason in_reason, const ::GURL& in_active_url) {
#if BUILDFLAG(MOJO_TRACE_ENABLED)
  TRACE_EVENT1(
    "mojom", "viz::mojom::GpuHost::DidLoseContext", "input_parameters",
    [&](){
      auto value = std::make_unique<base::trace_event::TracedValue>();
      base::trace_event::TracedValue* raw_value = value.get();
      raw_value->SetBoolean("offscreen", in_offscreen);
      raw_value->SetInteger("reason", static_cast<int>(in_reason));
      raw_value->SetString("active_url", base::trace_event::ValueToString(in_active_url, "<value of type const ::GURL&>"));
      return value;
    }());
#endif
  const bool kExpectsResponse = false;
  const bool kIsSync = false;
  
  const uint32_t kFlags =
      ((kExpectsResponse) ? mojo::Message::kFlagExpectsResponse : 0) |
      ((kIsSync) ? mojo::Message::kFlagIsSync : 0);
  
  mojo::Message message(
      internal::kGpuHost_DidLoseContext_Name, kFlags, 0, 0, nullptr);
  auto* buffer = message.payload_buffer();
  ::viz::mojom::internal::GpuHost_DidLoseContext_Params_Data::BufferWriter
      params;
  mojo::internal::SerializationContext serialization_context;
  params.Allocate(buffer);
  params->offscreen = in_offscreen;
  mojo::internal::Serialize<::viz::mojom::ContextLostReason>(
      in_reason, &params->reason);
  typename decltype(params->active_url)::BaseType::BufferWriter
      active_url_writer;
  mojo::internal::Serialize<::url::mojom::UrlDataView>(
      in_active_url, buffer, &active_url_writer, &serialization_context);
  params->active_url.Set(
      active_url_writer.is_null() ? nullptr : active_url_writer.data());
  MOJO_INTERNAL_DLOG_SERIALIZATION_WARNING(
      params->active_url.is_null(),
      mojo::internal::VALIDATION_ERROR_UNEXPECTED_NULL_POINTER,
      "null active_url in GpuHost.DidLoseContext request");
  message.AttachHandlesFromSerializationContext(
      &serialization_context);

#if defined(ENABLE_IPC_FUZZER)
  message.set_interface_name(GpuHost::Name_);
  message.set_method_name("DidLoseContext");
#endif
  // This return value may be ignored as false implies the Connector has
  // encountered an error, which will be visible through other means.
  ignore_result(receiver_->Accept(&message));
}

void GpuHostProxy::DisableGpuCompositing(
    ) {
#if BUILDFLAG(MOJO_TRACE_ENABLED)
  TRACE_EVENT0("mojom", "viz::mojom::GpuHost::DisableGpuCompositing");
#endif
  const bool kExpectsResponse = false;
  const bool kIsSync = false;
  
  const uint32_t kFlags =
      ((kExpectsResponse) ? mojo::Message::kFlagExpectsResponse : 0) |
      ((kIsSync) ? mojo::Message::kFlagIsSync : 0);
  
  mojo::Message message(
      internal::kGpuHost_DisableGpuCompositing_Name, kFlags, 0, 0, nullptr);
  auto* buffer = message.payload_buffer();
  ::viz::mojom::internal::GpuHost_DisableGpuCompositing_Params_Data::BufferWriter
      params;
  mojo::internal::SerializationContext serialization_context;
  params.Allocate(buffer);
  message.AttachHandlesFromSerializationContext(
      &serialization_context);

#if defined(ENABLE_IPC_FUZZER)
  message.set_interface_name(GpuHost::Name_);
  message.set_method_name("DisableGpuCompositing");
#endif
  // This return value may be ignored as false implies the Connector has
  // encountered an error, which will be visible through other means.
  ignore_result(receiver_->Accept(&message));
}

void GpuHostProxy::StoreShaderToDisk(
    int32_t in_client_id, const std::string& in_key, const std::string& in_shader) {
#if BUILDFLAG(MOJO_TRACE_ENABLED)
  TRACE_EVENT1(
    "mojom", "viz::mojom::GpuHost::StoreShaderToDisk", "input_parameters",
    [&](){
      auto value = std::make_unique<base::trace_event::TracedValue>();
      base::trace_event::TracedValue* raw_value = value.get();
      raw_value->SetInteger("client_id", in_client_id);
      raw_value->SetString("key", in_key);
      raw_value->SetString("shader", in_shader);
      return value;
    }());
#endif
  const bool kExpectsResponse = false;
  const bool kIsSync = false;
  
  const uint32_t kFlags =
      ((kExpectsResponse) ? mojo::Message::kFlagExpectsResponse : 0) |
      ((kIsSync) ? mojo::Message::kFlagIsSync : 0);
  
  mojo::Message message(
      internal::kGpuHost_StoreShaderToDisk_Name, kFlags, 0, 0, nullptr);
  auto* buffer = message.payload_buffer();
  ::viz::mojom::internal::GpuHost_StoreShaderToDisk_Params_Data::BufferWriter
      params;
  mojo::internal::SerializationContext serialization_context;
  params.Allocate(buffer);
  params->client_id = in_client_id;
  typename decltype(params->key)::BaseType::BufferWriter
      key_writer;
  mojo::internal::Serialize<mojo::StringDataView>(
      in_key, buffer, &key_writer, &serialization_context);
  params->key.Set(
      key_writer.is_null() ? nullptr : key_writer.data());
  MOJO_INTERNAL_DLOG_SERIALIZATION_WARNING(
      params->key.is_null(),
      mojo::internal::VALIDATION_ERROR_UNEXPECTED_NULL_POINTER,
      "null key in GpuHost.StoreShaderToDisk request");
  typename decltype(params->shader)::BaseType::BufferWriter
      shader_writer;
  mojo::internal::Serialize<mojo::StringDataView>(
      in_shader, buffer, &shader_writer, &serialization_context);
  params->shader.Set(
      shader_writer.is_null() ? nullptr : shader_writer.data());
  MOJO_INTERNAL_DLOG_SERIALIZATION_WARNING(
      params->shader.is_null(),
      mojo::internal::VALIDATION_ERROR_UNEXPECTED_NULL_POINTER,
      "null shader in GpuHost.StoreShaderToDisk request");
  message.AttachHandlesFromSerializationContext(
      &serialization_context);

#if defined(ENABLE_IPC_FUZZER)
  message.set_interface_name(GpuHost::Name_);
  message.set_method_name("StoreShaderToDisk");
#endif
  // This return value may be ignored as false implies the Connector has
  // encountered an error, which will be visible through other means.
  ignore_result(receiver_->Accept(&message));
}

void GpuHostProxy::RecordLogMessage(
    int32_t in_severity, const std::string& in_header, const std::string& in_message) {
#if BUILDFLAG(MOJO_TRACE_ENABLED)
  TRACE_EVENT1(
    "mojom", "viz::mojom::GpuHost::RecordLogMessage", "input_parameters",
    [&](){
      auto value = std::make_unique<base::trace_event::TracedValue>();
      base::trace_event::TracedValue* raw_value = value.get();
      raw_value->SetInteger("severity", in_severity);
      raw_value->SetString("header", in_header);
      raw_value->SetString("message", in_message);
      return value;
    }());
#endif
  const bool kExpectsResponse = false;
  const bool kIsSync = false;
  
  const uint32_t kFlags =
      ((kExpectsResponse) ? mojo::Message::kFlagExpectsResponse : 0) |
      ((kIsSync) ? mojo::Message::kFlagIsSync : 0);
  
  mojo::Message message(
      internal::kGpuHost_RecordLogMessage_Name, kFlags, 0, 0, nullptr);
  auto* buffer = message.payload_buffer();
  ::viz::mojom::internal::GpuHost_RecordLogMessage_Params_Data::BufferWriter
      params;
  mojo::internal::SerializationContext serialization_context;
  params.Allocate(buffer);
  params->severity = in_severity;
  typename decltype(params->header)::BaseType::BufferWriter
      header_writer;
  mojo::internal::Serialize<mojo::StringDataView>(
      in_header, buffer, &header_writer, &serialization_context);
  params->header.Set(
      header_writer.is_null() ? nullptr : header_writer.data());
  MOJO_INTERNAL_DLOG_SERIALIZATION_WARNING(
      params->header.is_null(),
      mojo::internal::VALIDATION_ERROR_UNEXPECTED_NULL_POINTER,
      "null header in GpuHost.RecordLogMessage request");
  typename decltype(params->message)::BaseType::BufferWriter
      message_writer;
  mojo::internal::Serialize<mojo::StringDataView>(
      in_message, buffer, &message_writer, &serialization_context);
  params->message.Set(
      message_writer.is_null() ? nullptr : message_writer.data());
  MOJO_INTERNAL_DLOG_SERIALIZATION_WARNING(
      params->message.is_null(),
      mojo::internal::VALIDATION_ERROR_UNEXPECTED_NULL_POINTER,
      "null message in GpuHost.RecordLogMessage request");
  message.AttachHandlesFromSerializationContext(
      &serialization_context);

#if defined(ENABLE_IPC_FUZZER)
  message.set_interface_name(GpuHost::Name_);
  message.set_method_name("RecordLogMessage");
#endif
  // This return value may be ignored as false implies the Connector has
  // encountered an error, which will be visible through other means.
  ignore_result(receiver_->Accept(&message));
}

// static
bool GpuHostStubDispatch::Accept(
    GpuHost* impl,
    mojo::Message* message) {
  mojo::internal::MessageDispatchContext dispatch_context(message);
  mojo::internal::SerializationContext serialization_context;
  serialization_context.TakeHandlesFromMessage(message);
  switch (message->header()->name) {
    case internal::kGpuHost_DidInitialize_Name: {
#if BUILDFLAG(MOJO_TRACE_ENABLED)
      TRACE_EVENT1(
          "mojom",
          "(Impl)viz::mojom::GpuHost::DidInitialize",
          "message", message->name());
#endif
      static constexpr uint32_t kMessageHash = base::MD5Hash32Constexpr(
              "(Impl)viz::mojom::GpuHost::DidInitialize");
      base::TaskAnnotator::ScopedSetIpcHash scoped_ipc_hash(kMessageHash);

      DCHECK(message->is_serialized());
      internal::GpuHost_DidInitialize_Params_Data* params =
          reinterpret_cast<internal::GpuHost_DidInitialize_Params_Data*>(
              message->mutable_payload());
      
      bool success = true;
      ::gpu::GPUInfo p_gpu_info{};
      ::gpu::GpuFeatureInfo p_gpu_feature_info{};
      base::Optional<::gpu::GPUInfo> p_gpu_info_for_hardware_gpu{};
      base::Optional<::gpu::GpuFeatureInfo> p_gpu_feature_info_for_hardware_gpu{};
      ::gpu::GpuExtraInfo p_gpu_extra_info{};
      GpuHost_DidInitialize_ParamsDataView input_data_view(params, &serialization_context);
      
      if (success && !input_data_view.ReadGpuInfo(&p_gpu_info))
        success = false;
      if (success && !input_data_view.ReadGpuFeatureInfo(&p_gpu_feature_info))
        success = false;
      if (success && !input_data_view.ReadGpuInfoForHardwareGpu(&p_gpu_info_for_hardware_gpu))
        success = false;
      if (success && !input_data_view.ReadGpuFeatureInfoForHardwareGpu(&p_gpu_feature_info_for_hardware_gpu))
        success = false;
      if (success && !input_data_view.ReadGpuExtraInfo(&p_gpu_extra_info))
        success = false;
      if (!success) {
        ReportValidationErrorForMessage(
            message,
            mojo::internal::VALIDATION_ERROR_DESERIALIZATION_FAILED,
            GpuHost::Name_, 0, false);
        return false;
      }
      // A null |impl| means no implementation was bound.
      DCHECK(impl);
      impl->DidInitialize(
std::move(p_gpu_info), 
std::move(p_gpu_feature_info), 
std::move(p_gpu_info_for_hardware_gpu), 
std::move(p_gpu_feature_info_for_hardware_gpu), 
std::move(p_gpu_extra_info));
      return true;
    }
    case internal::kGpuHost_DidFailInitialize_Name: {
#if BUILDFLAG(MOJO_TRACE_ENABLED)
      TRACE_EVENT1(
          "mojom",
          "(Impl)viz::mojom::GpuHost::DidFailInitialize",
          "message", message->name());
#endif
      static constexpr uint32_t kMessageHash = base::MD5Hash32Constexpr(
              "(Impl)viz::mojom::GpuHost::DidFailInitialize");
      base::TaskAnnotator::ScopedSetIpcHash scoped_ipc_hash(kMessageHash);

      DCHECK(message->is_serialized());
      internal::GpuHost_DidFailInitialize_Params_Data* params =
          reinterpret_cast<internal::GpuHost_DidFailInitialize_Params_Data*>(
              message->mutable_payload());
      
      bool success = true;
      GpuHost_DidFailInitialize_ParamsDataView input_data_view(params, &serialization_context);
      
      if (!success) {
        ReportValidationErrorForMessage(
            message,
            mojo::internal::VALIDATION_ERROR_DESERIALIZATION_FAILED,
            GpuHost::Name_, 1, false);
        return false;
      }
      // A null |impl| means no implementation was bound.
      DCHECK(impl);
      impl->DidFailInitialize();
      return true;
    }
    case internal::kGpuHost_DidCreateContextSuccessfully_Name: {
#if BUILDFLAG(MOJO_TRACE_ENABLED)
      TRACE_EVENT1(
          "mojom",
          "(Impl)viz::mojom::GpuHost::DidCreateContextSuccessfully",
          "message", message->name());
#endif
      static constexpr uint32_t kMessageHash = base::MD5Hash32Constexpr(
              "(Impl)viz::mojom::GpuHost::DidCreateContextSuccessfully");
      base::TaskAnnotator::ScopedSetIpcHash scoped_ipc_hash(kMessageHash);

      DCHECK(message->is_serialized());
      internal::GpuHost_DidCreateContextSuccessfully_Params_Data* params =
          reinterpret_cast<internal::GpuHost_DidCreateContextSuccessfully_Params_Data*>(
              message->mutable_payload());
      
      bool success = true;
      GpuHost_DidCreateContextSuccessfully_ParamsDataView input_data_view(params, &serialization_context);
      
      if (!success) {
        ReportValidationErrorForMessage(
            message,
            mojo::internal::VALIDATION_ERROR_DESERIALIZATION_FAILED,
            GpuHost::Name_, 2, false);
        return false;
      }
      // A null |impl| means no implementation was bound.
      DCHECK(impl);
      impl->DidCreateContextSuccessfully();
      return true;
    }
    case internal::kGpuHost_DidCreateOffscreenContext_Name: {
#if BUILDFLAG(MOJO_TRACE_ENABLED)
      TRACE_EVENT1(
          "mojom",
          "(Impl)viz::mojom::GpuHost::DidCreateOffscreenContext",
          "message", message->name());
#endif
      static constexpr uint32_t kMessageHash = base::MD5Hash32Constexpr(
              "(Impl)viz::mojom::GpuHost::DidCreateOffscreenContext");
      base::TaskAnnotator::ScopedSetIpcHash scoped_ipc_hash(kMessageHash);

      DCHECK(message->is_serialized());
      internal::GpuHost_DidCreateOffscreenContext_Params_Data* params =
          reinterpret_cast<internal::GpuHost_DidCreateOffscreenContext_Params_Data*>(
              message->mutable_payload());
      
      bool success = true;
      ::GURL p_url{};
      GpuHost_DidCreateOffscreenContext_ParamsDataView input_data_view(params, &serialization_context);
      
      if (success && !input_data_view.ReadUrl(&p_url))
        success = false;
      if (!success) {
        ReportValidationErrorForMessage(
            message,
            mojo::internal::VALIDATION_ERROR_DESERIALIZATION_FAILED,
            GpuHost::Name_, 3, false);
        return false;
      }
      // A null |impl| means no implementation was bound.
      DCHECK(impl);
      impl->DidCreateOffscreenContext(
std::move(p_url));
      return true;
    }
    case internal::kGpuHost_DidDestroyOffscreenContext_Name: {
#if BUILDFLAG(MOJO_TRACE_ENABLED)
      TRACE_EVENT1(
          "mojom",
          "(Impl)viz::mojom::GpuHost::DidDestroyOffscreenContext",
          "message", message->name());
#endif
      static constexpr uint32_t kMessageHash = base::MD5Hash32Constexpr(
              "(Impl)viz::mojom::GpuHost::DidDestroyOffscreenContext");
      base::TaskAnnotator::ScopedSetIpcHash scoped_ipc_hash(kMessageHash);

      DCHECK(message->is_serialized());
      internal::GpuHost_DidDestroyOffscreenContext_Params_Data* params =
          reinterpret_cast<internal::GpuHost_DidDestroyOffscreenContext_Params_Data*>(
              message->mutable_payload());
      
      bool success = true;
      ::GURL p_url{};
      GpuHost_DidDestroyOffscreenContext_ParamsDataView input_data_view(params, &serialization_context);
      
      if (success && !input_data_view.ReadUrl(&p_url))
        success = false;
      if (!success) {
        ReportValidationErrorForMessage(
            message,
            mojo::internal::VALIDATION_ERROR_DESERIALIZATION_FAILED,
            GpuHost::Name_, 4, false);
        return false;
      }
      // A null |impl| means no implementation was bound.
      DCHECK(impl);
      impl->DidDestroyOffscreenContext(
std::move(p_url));
      return true;
    }
    case internal::kGpuHost_DidDestroyChannel_Name: {
#if BUILDFLAG(MOJO_TRACE_ENABLED)
      TRACE_EVENT1(
          "mojom",
          "(Impl)viz::mojom::GpuHost::DidDestroyChannel",
          "message", message->name());
#endif
      static constexpr uint32_t kMessageHash = base::MD5Hash32Constexpr(
              "(Impl)viz::mojom::GpuHost::DidDestroyChannel");
      base::TaskAnnotator::ScopedSetIpcHash scoped_ipc_hash(kMessageHash);

      DCHECK(message->is_serialized());
      internal::GpuHost_DidDestroyChannel_Params_Data* params =
          reinterpret_cast<internal::GpuHost_DidDestroyChannel_Params_Data*>(
              message->mutable_payload());
      
      bool success = true;
      int32_t p_client_id{};
      GpuHost_DidDestroyChannel_ParamsDataView input_data_view(params, &serialization_context);
      
      if (success)
        p_client_id = input_data_view.client_id();
      if (!success) {
        ReportValidationErrorForMessage(
            message,
            mojo::internal::VALIDATION_ERROR_DESERIALIZATION_FAILED,
            GpuHost::Name_, 5, false);
        return false;
      }
      // A null |impl| means no implementation was bound.
      DCHECK(impl);
      impl->DidDestroyChannel(
std::move(p_client_id));
      return true;
    }
    case internal::kGpuHost_DidDestroyAllChannels_Name: {
#if BUILDFLAG(MOJO_TRACE_ENABLED)
      TRACE_EVENT1(
          "mojom",
          "(Impl)viz::mojom::GpuHost::DidDestroyAllChannels",
          "message", message->name());
#endif
      static constexpr uint32_t kMessageHash = base::MD5Hash32Constexpr(
              "(Impl)viz::mojom::GpuHost::DidDestroyAllChannels");
      base::TaskAnnotator::ScopedSetIpcHash scoped_ipc_hash(kMessageHash);

      DCHECK(message->is_serialized());
      internal::GpuHost_DidDestroyAllChannels_Params_Data* params =
          reinterpret_cast<internal::GpuHost_DidDestroyAllChannels_Params_Data*>(
              message->mutable_payload());
      
      bool success = true;
      GpuHost_DidDestroyAllChannels_ParamsDataView input_data_view(params, &serialization_context);
      
      if (!success) {
        ReportValidationErrorForMessage(
            message,
            mojo::internal::VALIDATION_ERROR_DESERIALIZATION_FAILED,
            GpuHost::Name_, 6, false);
        return false;
      }
      // A null |impl| means no implementation was bound.
      DCHECK(impl);
      impl->DidDestroyAllChannels();
      return true;
    }
    case internal::kGpuHost_DidLoseContext_Name: {
#if BUILDFLAG(MOJO_TRACE_ENABLED)
      TRACE_EVENT1(
          "mojom",
          "(Impl)viz::mojom::GpuHost::DidLoseContext",
          "message", message->name());
#endif
      static constexpr uint32_t kMessageHash = base::MD5Hash32Constexpr(
              "(Impl)viz::mojom::GpuHost::DidLoseContext");
      base::TaskAnnotator::ScopedSetIpcHash scoped_ipc_hash(kMessageHash);

      DCHECK(message->is_serialized());
      internal::GpuHost_DidLoseContext_Params_Data* params =
          reinterpret_cast<internal::GpuHost_DidLoseContext_Params_Data*>(
              message->mutable_payload());
      
      bool success = true;
      bool p_offscreen{};
      ::gpu::error::ContextLostReason p_reason{};
      ::GURL p_active_url{};
      GpuHost_DidLoseContext_ParamsDataView input_data_view(params, &serialization_context);
      
      if (success)
        p_offscreen = input_data_view.offscreen();
      if (success && !input_data_view.ReadReason(&p_reason))
        success = false;
      if (success && !input_data_view.ReadActiveUrl(&p_active_url))
        success = false;
      if (!success) {
        ReportValidationErrorForMessage(
            message,
            mojo::internal::VALIDATION_ERROR_DESERIALIZATION_FAILED,
            GpuHost::Name_, 7, false);
        return false;
      }
      // A null |impl| means no implementation was bound.
      DCHECK(impl);
      impl->DidLoseContext(
std::move(p_offscreen), 
std::move(p_reason), 
std::move(p_active_url));
      return true;
    }
    case internal::kGpuHost_DisableGpuCompositing_Name: {
#if BUILDFLAG(MOJO_TRACE_ENABLED)
      TRACE_EVENT1(
          "mojom",
          "(Impl)viz::mojom::GpuHost::DisableGpuCompositing",
          "message", message->name());
#endif
      static constexpr uint32_t kMessageHash = base::MD5Hash32Constexpr(
              "(Impl)viz::mojom::GpuHost::DisableGpuCompositing");
      base::TaskAnnotator::ScopedSetIpcHash scoped_ipc_hash(kMessageHash);

      DCHECK(message->is_serialized());
      internal::GpuHost_DisableGpuCompositing_Params_Data* params =
          reinterpret_cast<internal::GpuHost_DisableGpuCompositing_Params_Data*>(
              message->mutable_payload());
      
      bool success = true;
      GpuHost_DisableGpuCompositing_ParamsDataView input_data_view(params, &serialization_context);
      
      if (!success) {
        ReportValidationErrorForMessage(
            message,
            mojo::internal::VALIDATION_ERROR_DESERIALIZATION_FAILED,
            GpuHost::Name_, 8, false);
        return false;
      }
      // A null |impl| means no implementation was bound.
      DCHECK(impl);
      impl->DisableGpuCompositing();
      return true;
    }
    case internal::kGpuHost_StoreShaderToDisk_Name: {
#if BUILDFLAG(MOJO_TRACE_ENABLED)
      TRACE_EVENT1(
          "mojom",
          "(Impl)viz::mojom::GpuHost::StoreShaderToDisk",
          "message", message->name());
#endif
      static constexpr uint32_t kMessageHash = base::MD5Hash32Constexpr(
              "(Impl)viz::mojom::GpuHost::StoreShaderToDisk");
      base::TaskAnnotator::ScopedSetIpcHash scoped_ipc_hash(kMessageHash);

      DCHECK(message->is_serialized());
      internal::GpuHost_StoreShaderToDisk_Params_Data* params =
          reinterpret_cast<internal::GpuHost_StoreShaderToDisk_Params_Data*>(
              message->mutable_payload());
      
      bool success = true;
      int32_t p_client_id{};
      std::string p_key{};
      std::string p_shader{};
      GpuHost_StoreShaderToDisk_ParamsDataView input_data_view(params, &serialization_context);
      
      if (success)
        p_client_id = input_data_view.client_id();
      if (success && !input_data_view.ReadKey(&p_key))
        success = false;
      if (success && !input_data_view.ReadShader(&p_shader))
        success = false;
      if (!success) {
        ReportValidationErrorForMessage(
            message,
            mojo::internal::VALIDATION_ERROR_DESERIALIZATION_FAILED,
            GpuHost::Name_, 9, false);
        return false;
      }
      // A null |impl| means no implementation was bound.
      DCHECK(impl);
      impl->StoreShaderToDisk(
std::move(p_client_id), 
std::move(p_key), 
std::move(p_shader));
      return true;
    }
    case internal::kGpuHost_RecordLogMessage_Name: {
#if BUILDFLAG(MOJO_TRACE_ENABLED)
      TRACE_EVENT1(
          "mojom",
          "(Impl)viz::mojom::GpuHost::RecordLogMessage",
          "message", message->name());
#endif
      static constexpr uint32_t kMessageHash = base::MD5Hash32Constexpr(
              "(Impl)viz::mojom::GpuHost::RecordLogMessage");
      base::TaskAnnotator::ScopedSetIpcHash scoped_ipc_hash(kMessageHash);

      DCHECK(message->is_serialized());
      internal::GpuHost_RecordLogMessage_Params_Data* params =
          reinterpret_cast<internal::GpuHost_RecordLogMessage_Params_Data*>(
              message->mutable_payload());
      
      bool success = true;
      int32_t p_severity{};
      std::string p_header{};
      std::string p_message{};
      GpuHost_RecordLogMessage_ParamsDataView input_data_view(params, &serialization_context);
      
      if (success)
        p_severity = input_data_view.severity();
      if (success && !input_data_view.ReadHeader(&p_header))
        success = false;
      if (success && !input_data_view.ReadMessage(&p_message))
        success = false;
      if (!success) {
        ReportValidationErrorForMessage(
            message,
            mojo::internal::VALIDATION_ERROR_DESERIALIZATION_FAILED,
            GpuHost::Name_, 10, false);
        return false;
      }
      // A null |impl| means no implementation was bound.
      DCHECK(impl);
      impl->RecordLogMessage(
std::move(p_severity), 
std::move(p_header), 
std::move(p_message));
      return true;
    }
  }
  return false;
}

// static
bool GpuHostStubDispatch::AcceptWithResponder(
    GpuHost* impl,
    mojo::Message* message,
    std::unique_ptr<mojo::MessageReceiverWithStatus> responder) {
  mojo::internal::MessageDispatchContext dispatch_context(message);
  mojo::internal::SerializationContext serialization_context;
  serialization_context.TakeHandlesFromMessage(message);
  const bool message_is_sync = message->has_flag(mojo::Message::kFlagIsSync);
  const uint64_t request_id = message->request_id();
  ALLOW_UNUSED_LOCAL(message_is_sync);
  ALLOW_UNUSED_LOCAL(request_id);
  switch (message->header()->name) {
    case internal::kGpuHost_DidInitialize_Name: {
      break;
    }
    case internal::kGpuHost_DidFailInitialize_Name: {
      break;
    }
    case internal::kGpuHost_DidCreateContextSuccessfully_Name: {
      break;
    }
    case internal::kGpuHost_DidCreateOffscreenContext_Name: {
      break;
    }
    case internal::kGpuHost_DidDestroyOffscreenContext_Name: {
      break;
    }
    case internal::kGpuHost_DidDestroyChannel_Name: {
      break;
    }
    case internal::kGpuHost_DidDestroyAllChannels_Name: {
      break;
    }
    case internal::kGpuHost_DidLoseContext_Name: {
      break;
    }
    case internal::kGpuHost_DisableGpuCompositing_Name: {
      break;
    }
    case internal::kGpuHost_StoreShaderToDisk_Name: {
      break;
    }
    case internal::kGpuHost_RecordLogMessage_Name: {
      break;
    }
  }
  return false;
}


static const std::pair<uint32_t, mojo::internal::GenericValidationInfo> kGpuHostValidationInfo[] = {
    {internal::kGpuHost_DidInitialize_Name,
     {&internal::GpuHost_DidInitialize_Params_Data::Validate,
      nullptr /* no response */}},
    {internal::kGpuHost_DidFailInitialize_Name,
     {&internal::GpuHost_DidFailInitialize_Params_Data::Validate,
      nullptr /* no response */}},
    {internal::kGpuHost_DidCreateContextSuccessfully_Name,
     {&internal::GpuHost_DidCreateContextSuccessfully_Params_Data::Validate,
      nullptr /* no response */}},
    {internal::kGpuHost_DidCreateOffscreenContext_Name,
     {&internal::GpuHost_DidCreateOffscreenContext_Params_Data::Validate,
      nullptr /* no response */}},
    {internal::kGpuHost_DidDestroyOffscreenContext_Name,
     {&internal::GpuHost_DidDestroyOffscreenContext_Params_Data::Validate,
      nullptr /* no response */}},
    {internal::kGpuHost_DidDestroyChannel_Name,
     {&internal::GpuHost_DidDestroyChannel_Params_Data::Validate,
      nullptr /* no response */}},
    {internal::kGpuHost_DidDestroyAllChannels_Name,
     {&internal::GpuHost_DidDestroyAllChannels_Params_Data::Validate,
      nullptr /* no response */}},
    {internal::kGpuHost_DidLoseContext_Name,
     {&internal::GpuHost_DidLoseContext_Params_Data::Validate,
      nullptr /* no response */}},
    {internal::kGpuHost_DisableGpuCompositing_Name,
     {&internal::GpuHost_DisableGpuCompositing_Params_Data::Validate,
      nullptr /* no response */}},
    {internal::kGpuHost_StoreShaderToDisk_Name,
     {&internal::GpuHost_StoreShaderToDisk_Params_Data::Validate,
      nullptr /* no response */}},
    {internal::kGpuHost_RecordLogMessage_Name,
     {&internal::GpuHost_RecordLogMessage_Params_Data::Validate,
      nullptr /* no response */}},
};

bool GpuHostRequestValidator::Accept(mojo::Message* message) {
  const char* name = ::viz::mojom::GpuHost::Name_;
  return mojo::internal::ValidateRequestGeneric(message, name, kGpuHostValidationInfo);
}

}  // namespace mojom
}  // namespace viz

namespace mojo {

}  // namespace mojo

#if defined(__clang__)
#pragma clang diagnostic pop
#endif