// components/vrp_flags/vrp_flags.mojom.cc is auto generated by mojom_bindings_generator.py, do not edit

// Copyright 2013 The Chromium Authors
// 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 "components/vrp_flags/vrp_flags.mojom.h"
#include <math.h>
#include <stdint.h>
#include <utility>
#include "base/debug/alias.h"
#include "base/notreached.h"
#include "base/run_loop.h"
#include "base/strings/string_number_conversions.h"
#include "base/task/thread_pool/thread_pool_instance.h"
#include "base/trace_event/trace_event.h"
#include "base/trace_event/typed_macros.h"
#include "mojo/public/cpp/bindings/lib/default_construct_tag_internal.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/proxy_to_responder.h"
#include "mojo/public/cpp/bindings/lib/send_message_helper.h"
#include "mojo/public/cpp/bindings/lib/serialization.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/cpp/bindings/urgent_message_scope.h"
#include "mojo/public/interfaces/bindings/interface_control_messages.mojom.h"
#include "third_party/perfetto/include/perfetto/tracing/traced_value.h"

#include "components/vrp_flags/vrp_flags.mojom-params-data.h"
#include "components/vrp_flags/vrp_flags.mojom-shared-message-ids.h"

#include "components/vrp_flags/vrp_flags.mojom-import-headers.h"
#include "components/vrp_flags/vrp_flags.mojom-test-utils.h"


namespace vrp_flags::mojom {
// The declaration includes the definition on other builds.

VrpFlags::IPCStableHashFunction VrpFlags::MessageToMethodInfo_(mojo::Message& message) {
#if !BUILDFLAG(IS_FUCHSIA)
  switch (static_cast<messages::VrpFlags>(message.name())) {
    case messages::VrpFlags::kGetWriteLocations: {
      return &VrpFlags::GetWriteLocations_Sym::IPCStableHash;
    }
    case messages::VrpFlags::kWriteAttempted: {
      return &VrpFlags::WriteAttempted_Sym::IPCStableHash;
    }
    case messages::VrpFlags::kGetReadPrefix: {
      return &VrpFlags::GetReadPrefix_Sym::IPCStableHash;
    }
    case messages::VrpFlags::kReadAttempted: {
      return &VrpFlags::ReadAttempted_Sym::IPCStableHash;
    }
  }
#endif  // !BUILDFLAG(IS_FUCHSIA)
  return nullptr;
}


const char* VrpFlags::MessageToMethodName_(mojo::Message& message) {
#if BUILDFLAG(MOJO_TRACE_ENABLED)
  bool is_response = message.has_flag(mojo::Message::kFlagIsResponse);
  if (!is_response) {
    switch (static_cast<messages::VrpFlags>(message.name())) {
      case messages::VrpFlags::kGetWriteLocations:
            return "Receive vrp_flags::mojom::VrpFlags::GetWriteLocations";
      case messages::VrpFlags::kWriteAttempted:
            return "Receive vrp_flags::mojom::VrpFlags::WriteAttempted";
      case messages::VrpFlags::kGetReadPrefix:
            return "Receive vrp_flags::mojom::VrpFlags::GetReadPrefix";
      case messages::VrpFlags::kReadAttempted:
            return "Receive vrp_flags::mojom::VrpFlags::ReadAttempted";
    }
  } else {
    switch (static_cast<messages::VrpFlags>(message.name())) {
      case messages::VrpFlags::kGetWriteLocations:
            return "Receive reply vrp_flags::mojom::VrpFlags::GetWriteLocations";
      case messages::VrpFlags::kWriteAttempted:
            return "Receive reply vrp_flags::mojom::VrpFlags::WriteAttempted";
      case messages::VrpFlags::kGetReadPrefix:
            return "Receive reply vrp_flags::mojom::VrpFlags::GetReadPrefix";
      case messages::VrpFlags::kReadAttempted:
            return "Receive reply vrp_flags::mojom::VrpFlags::ReadAttempted";
    }
  }
  return "Receive unknown mojo message";
#else
  bool is_response = message.has_flag(mojo::Message::kFlagIsResponse);
  if (is_response) {
    return "Receive mojo reply";
  } else {
    return "Receive mojo message";
  }
#endif // BUILDFLAG(MOJO_TRACE_ENABLED)
}

#if !BUILDFLAG(IS_FUCHSIA)
uint32_t VrpFlags::GetWriteLocations_Sym::IPCStableHash() {
  // This method's address is used for identifying the mojo method name after
  // symbolization. So each IPCStableHash should have a unique address.
  // We cannot use NO_CODE_FOLDING() here - it relies on the uniqueness of
  // __LINE__ value, which is not unique across different mojo modules.
  // The code below is very similar to NO_CODE_FOLDING, but it uses a unique
  // hash instead of __LINE__.
  static constexpr uint32_t kHash = 0x710687ae;  // IPCStableHash for vrp_flags::mojom::VrpFlags::GetWriteLocations
  const uint32_t hash = kHash;
  base::debug::Alias(&hash);
  return hash;
}
uint32_t VrpFlags::WriteAttempted_Sym::IPCStableHash() {
  // This method's address is used for identifying the mojo method name after
  // symbolization. So each IPCStableHash should have a unique address.
  // We cannot use NO_CODE_FOLDING() here - it relies on the uniqueness of
  // __LINE__ value, which is not unique across different mojo modules.
  // The code below is very similar to NO_CODE_FOLDING, but it uses a unique
  // hash instead of __LINE__.
  static constexpr uint32_t kHash = 0xbff559a3;  // IPCStableHash for vrp_flags::mojom::VrpFlags::WriteAttempted
  const uint32_t hash = kHash;
  base::debug::Alias(&hash);
  return hash;
}
uint32_t VrpFlags::GetReadPrefix_Sym::IPCStableHash() {
  // This method's address is used for identifying the mojo method name after
  // symbolization. So each IPCStableHash should have a unique address.
  // We cannot use NO_CODE_FOLDING() here - it relies on the uniqueness of
  // __LINE__ value, which is not unique across different mojo modules.
  // The code below is very similar to NO_CODE_FOLDING, but it uses a unique
  // hash instead of __LINE__.
  static constexpr uint32_t kHash = 0xfdc23f4a;  // IPCStableHash for vrp_flags::mojom::VrpFlags::GetReadPrefix
  const uint32_t hash = kHash;
  base::debug::Alias(&hash);
  return hash;
}
uint32_t VrpFlags::ReadAttempted_Sym::IPCStableHash() {
  // This method's address is used for identifying the mojo method name after
  // symbolization. So each IPCStableHash should have a unique address.
  // We cannot use NO_CODE_FOLDING() here - it relies on the uniqueness of
  // __LINE__ value, which is not unique across different mojo modules.
  // The code below is very similar to NO_CODE_FOLDING, but it uses a unique
  // hash instead of __LINE__.
  static constexpr uint32_t kHash = 0x7ce9d319;  // IPCStableHash for vrp_flags::mojom::VrpFlags::ReadAttempted
  const uint32_t hash = kHash;
  base::debug::Alias(&hash);
  return hash;
}
# endif // !BUILDFLAG(IS_FUCHSIA)

class VrpFlags_GetWriteLocations_ForwardToCallback
    : public mojo::MessageReceiver {
 public:
  VrpFlags_GetWriteLocations_ForwardToCallback(
      VrpFlags::GetWriteLocationsCallback callback
      ) : callback_(std::move(callback)) {
  }

  VrpFlags_GetWriteLocations_ForwardToCallback(const VrpFlags_GetWriteLocations_ForwardToCallback&) = delete;
  VrpFlags_GetWriteLocations_ForwardToCallback& operator=(const VrpFlags_GetWriteLocations_ForwardToCallback&) = delete;

  bool Accept(mojo::Message* message) override;
 private:
  VrpFlags::GetWriteLocationsCallback callback_;
};

class VrpFlags_WriteAttempted_ForwardToCallback
    : public mojo::MessageReceiver {
 public:
  VrpFlags_WriteAttempted_ForwardToCallback(
      VrpFlags::WriteAttemptedCallback callback
      ) : callback_(std::move(callback)) {
  }

  VrpFlags_WriteAttempted_ForwardToCallback(const VrpFlags_WriteAttempted_ForwardToCallback&) = delete;
  VrpFlags_WriteAttempted_ForwardToCallback& operator=(const VrpFlags_WriteAttempted_ForwardToCallback&) = delete;

  bool Accept(mojo::Message* message) override;
 private:
  VrpFlags::WriteAttemptedCallback callback_;
};

class VrpFlags_GetReadPrefix_ForwardToCallback
    : public mojo::MessageReceiver {
 public:
  VrpFlags_GetReadPrefix_ForwardToCallback(
      VrpFlags::GetReadPrefixCallback callback
      ) : callback_(std::move(callback)) {
  }

  VrpFlags_GetReadPrefix_ForwardToCallback(const VrpFlags_GetReadPrefix_ForwardToCallback&) = delete;
  VrpFlags_GetReadPrefix_ForwardToCallback& operator=(const VrpFlags_GetReadPrefix_ForwardToCallback&) = delete;

  bool Accept(mojo::Message* message) override;
 private:
  VrpFlags::GetReadPrefixCallback callback_;
};

class VrpFlags_ReadAttempted_ForwardToCallback
    : public mojo::MessageReceiver {
 public:
  VrpFlags_ReadAttempted_ForwardToCallback(
      VrpFlags::ReadAttemptedCallback callback
      ) : callback_(std::move(callback)) {
  }

  VrpFlags_ReadAttempted_ForwardToCallback(const VrpFlags_ReadAttempted_ForwardToCallback&) = delete;
  VrpFlags_ReadAttempted_ForwardToCallback& operator=(const VrpFlags_ReadAttempted_ForwardToCallback&) = delete;

  bool Accept(mojo::Message* message) override;
 private:
  VrpFlags::ReadAttemptedCallback callback_;
};

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

void VrpFlagsProxy::GetWriteLocations(
    GetWriteLocationsCallback callback) {
#if BUILDFLAG(MOJO_TRACE_ENABLED)
  TRACE_EVENT0("mojom", "Send vrp_flags::mojom::VrpFlags::GetWriteLocations");
#endif

  const bool kExpectsResponse = true;
  const bool kIsSync = false;
  const bool kAllowInterrupt = true;
  const bool is_urgent = false;

  const uint32_t kFlags =
      ((kExpectsResponse) ? mojo::Message::kFlagExpectsResponse : 0) |
      ((kIsSync) ? mojo::Message::kFlagIsSync : 0) |
      ((kAllowInterrupt) ? 0 : mojo::Message::kFlagNoInterrupt) |
      ((is_urgent) ? mojo::Message::kFlagIsUrgent : 0);

  const size_t estimated_payload_size =
    0;
  mojo::Message message(
      std::to_underlying(messages::VrpFlags::kGetWriteLocations), kFlags, estimated_payload_size);
  mojo::internal::MessageFragment<
      ::vrp_flags::mojom::internal::VrpFlags_GetWriteLocations_Params_Data> params(
          message);
  params.Allocate();

#if defined(ENABLE_IPC_FUZZER)
  message.set_interface_name(VrpFlags::Name_);
  message.set_method_name("GetWriteLocations");
#endif
  std::unique_ptr<mojo::MessageReceiver> responder(
      new VrpFlags_GetWriteLocations_ForwardToCallback(
          std::move(callback)));
  ::mojo::internal::SendMojoMessage(*receiver_, message, std::move(responder));
}

void VrpFlagsProxy::WriteAttempted(
    uint64_t in_location, WriteAttemptedCallback callback) {
#if BUILDFLAG(MOJO_TRACE_ENABLED)
  TRACE_EVENT1(
    "mojom", "Send vrp_flags::mojom::VrpFlags::WriteAttempted", "input_parameters",
    [&](perfetto::TracedValue context){
      auto dict = std::move(context).WriteDictionary();
      perfetto::WriteIntoTracedValueWithFallback(
           dict.AddItem("location"), in_location,
                        "<value of type uint64_t>");
   });
#endif

  const bool kExpectsResponse = true;
  const bool kIsSync = false;
  const bool kAllowInterrupt = true;
  const bool is_urgent = false;

  const uint32_t kFlags =
      ((kExpectsResponse) ? mojo::Message::kFlagExpectsResponse : 0) |
      ((kIsSync) ? mojo::Message::kFlagIsSync : 0) |
      ((kAllowInterrupt) ? 0 : mojo::Message::kFlagNoInterrupt) |
      ((is_urgent) ? mojo::Message::kFlagIsUrgent : 0);

  const size_t estimated_payload_size =
    0;
  mojo::Message message(
      std::to_underlying(messages::VrpFlags::kWriteAttempted), kFlags, estimated_payload_size);
  mojo::internal::MessageFragment<
      ::vrp_flags::mojom::internal::VrpFlags_WriteAttempted_Params_Data> params(
          message);
  params.Allocate();

  params->location = in_location;

#if defined(ENABLE_IPC_FUZZER)
  message.set_interface_name(VrpFlags::Name_);
  message.set_method_name("WriteAttempted");
#endif
  std::unique_ptr<mojo::MessageReceiver> responder(
      new VrpFlags_WriteAttempted_ForwardToCallback(
          std::move(callback)));
  ::mojo::internal::SendMojoMessage(*receiver_, message, std::move(responder));
}

void VrpFlagsProxy::GetReadPrefix(
    GetReadPrefixCallback callback) {
#if BUILDFLAG(MOJO_TRACE_ENABLED)
  TRACE_EVENT0("mojom", "Send vrp_flags::mojom::VrpFlags::GetReadPrefix");
#endif

  const bool kExpectsResponse = true;
  const bool kIsSync = false;
  const bool kAllowInterrupt = true;
  const bool is_urgent = false;

  const uint32_t kFlags =
      ((kExpectsResponse) ? mojo::Message::kFlagExpectsResponse : 0) |
      ((kIsSync) ? mojo::Message::kFlagIsSync : 0) |
      ((kAllowInterrupt) ? 0 : mojo::Message::kFlagNoInterrupt) |
      ((is_urgent) ? mojo::Message::kFlagIsUrgent : 0);

  const size_t estimated_payload_size =
    0;
  mojo::Message message(
      std::to_underlying(messages::VrpFlags::kGetReadPrefix), kFlags, estimated_payload_size);
  mojo::internal::MessageFragment<
      ::vrp_flags::mojom::internal::VrpFlags_GetReadPrefix_Params_Data> params(
          message);
  params.Allocate();

#if defined(ENABLE_IPC_FUZZER)
  message.set_interface_name(VrpFlags::Name_);
  message.set_method_name("GetReadPrefix");
#endif
  std::unique_ptr<mojo::MessageReceiver> responder(
      new VrpFlags_GetReadPrefix_ForwardToCallback(
          std::move(callback)));
  ::mojo::internal::SendMojoMessage(*receiver_, message, std::move(responder));
}

void VrpFlagsProxy::ReadAttempted(
    const ::base::UnguessableToken& in_flag, ReadAttemptedCallback callback) {
#if BUILDFLAG(MOJO_TRACE_ENABLED)
  TRACE_EVENT1(
    "mojom", "Send vrp_flags::mojom::VrpFlags::ReadAttempted", "input_parameters",
    [&](perfetto::TracedValue context){
      auto dict = std::move(context).WriteDictionary();
      perfetto::WriteIntoTracedValueWithFallback(
           dict.AddItem("flag"), in_flag,
                        "<value of type const ::base::UnguessableToken&>");
   });
#endif

  const bool kExpectsResponse = true;
  const bool kIsSync = false;
  const bool kAllowInterrupt = true;
  const bool is_urgent = false;

  const uint32_t kFlags =
      ((kExpectsResponse) ? mojo::Message::kFlagExpectsResponse : 0) |
      ((kIsSync) ? mojo::Message::kFlagIsSync : 0) |
      ((kAllowInterrupt) ? 0 : mojo::Message::kFlagNoInterrupt) |
      ((is_urgent) ? mojo::Message::kFlagIsUrgent : 0);

  const size_t estimated_payload_size =
    0;
  mojo::Message message(
      std::to_underlying(messages::VrpFlags::kReadAttempted), kFlags, estimated_payload_size);
  mojo::internal::MessageFragment<
      ::vrp_flags::mojom::internal::VrpFlags_ReadAttempted_Params_Data> params(
          message);
  params.Allocate();
  mojo::internal::MessageFragment<
      typename decltype(params->flag)::BaseType> flag_fragment(
          params.message());
  
  mojo::internal::Serialize<::mojo_base::mojom::UnguessableTokenDataView>(
    in_flag,
    flag_fragment);

  params->flag.Set(
      flag_fragment.is_null() ? nullptr : flag_fragment.data());

  
  MOJO_INTERNAL_CHECK_SERIALIZATION(
    mojo::internal::SendValidation::kDefault,
    !(params->flag.is_null()),
    mojo::internal::VALIDATION_ERROR_UNEXPECTED_NULL_POINTER,
    "null flag in VrpFlags.ReadAttempted request");

#if defined(ENABLE_IPC_FUZZER)
  message.set_interface_name(VrpFlags::Name_);
  message.set_method_name("ReadAttempted");
#endif
  std::unique_ptr<mojo::MessageReceiver> responder(
      new VrpFlags_ReadAttempted_ForwardToCallback(
          std::move(callback)));
  ::mojo::internal::SendMojoMessage(*receiver_, message, std::move(responder));
}
class VrpFlags_GetWriteLocations_ProxyToResponder : public ::mojo::internal::ProxyToResponder {
 public:
  static VrpFlags::GetWriteLocationsCallback CreateCallback(
      ::mojo::Message& message,
      std::unique_ptr<mojo::MessageReceiverWithStatus> responder) {
    std::unique_ptr<VrpFlags_GetWriteLocations_ProxyToResponder> proxy(
        new VrpFlags_GetWriteLocations_ProxyToResponder(
            message, std::move(responder)));
    return base::BindOnce(&VrpFlags_GetWriteLocations_ProxyToResponder::Run,
                          std::move(proxy));
  }

  ~VrpFlags_GetWriteLocations_ProxyToResponder() {
#if DCHECK_IS_ON()
    if (responder_) {
      // If we're being destroyed without being run, we want to ensure the
      // binding endpoint has been closed. This checks for that asynchronously.
      // We pass a bound generated callback to handle the response so that any
      // resulting DCHECK stack will have useful interface type information.
      // Instantiate a ScopedFizzleBlockShutdownTasks to allow this request to
      // fizzle if this happens after shutdown and the endpoint is bound to a
      // BLOCK_SHUTDOWN sequence.
      base::ThreadPoolInstance::ScopedFizzleBlockShutdownTasks fizzler;
      responder_->IsConnectedAsync(base::BindOnce(&OnIsConnectedComplete));
    }
#endif
  }

 private:
  VrpFlags_GetWriteLocations_ProxyToResponder(
      ::mojo::Message& message,
      std::unique_ptr<mojo::MessageReceiverWithStatus> responder)
      : ::mojo::internal::ProxyToResponder(message, std::move(responder)) {
  }

#if DCHECK_IS_ON()
  static void OnIsConnectedComplete(bool connected) {
    DCHECK(!connected)
        << "VrpFlags::GetWriteLocationsCallback was destroyed without "
        << "first either being run or its corresponding binding being closed. "
        << "It is an error to drop response callbacks which still correspond "
        << "to an open interface pipe.";
  }
#endif

  void Run(
      const std::vector<uint64_t>& in_locations, uint64_t in_value);
};

bool VrpFlags_GetWriteLocations_ForwardToCallback::Accept(
    mojo::Message* message) {
  DCHECK(message->is_serialized());
  internal::VrpFlags_GetWriteLocations_ResponseParams_Data* params =
      reinterpret_cast<
          internal::VrpFlags_GetWriteLocations_ResponseParams_Data*>(
              message->mutable_payload());
  

  // Validation for VrpFlags.0
  bool success = true;
  std::vector<uint64_t> p_locations{};
  uint64_t p_value{};
  VrpFlags_GetWriteLocations_ResponseParamsDataView input_data_view(params, message);
  
  if (success && !input_data_view.ReadLocations(&p_locations))
    success = false;
  if (success)
    p_value = input_data_view.value();
  if (!success) {
    ReportValidationErrorForMessage(
        message,
        mojo::internal::VALIDATION_ERROR_DESERIALIZATION_FAILED,
        VrpFlags::Name_, 0, true);
    return false;
  }
  if (!callback_.is_null()) {
    std::move(callback_).Run(
std::move(p_locations), 
std::move(p_value));
  }
  return true;
}

void VrpFlags_GetWriteLocations_ProxyToResponder::Run(
    const std::vector<uint64_t>& in_locations, uint64_t in_value) {
#if BUILDFLAG(MOJO_TRACE_ENABLED)
  TRACE_EVENT1(
    "mojom", "Send reply vrp_flags::mojom::VrpFlags::GetWriteLocations", "async_response_parameters",
    [&](perfetto::TracedValue context){
      auto dict = std::move(context).WriteDictionary();
      perfetto::WriteIntoTracedValueWithFallback(
           dict.AddItem("locations"), in_locations,
                        "<value of type const std::vector<uint64_t>&>");
      perfetto::WriteIntoTracedValueWithFallback(
           dict.AddItem("value"), in_value,
                        "<value of type uint64_t>");
   });
#endif

  const uint32_t kFlags = mojo::Message::kFlagIsResponse |
      ((is_sync_) ? mojo::Message::kFlagIsSync : 0) |
      ((true) ? 0 : mojo::Message::kFlagNoInterrupt) |
      ((false) ? mojo::Message::kFlagIsUrgent : 0);

  const size_t estimated_payload_size =
    0;
  mojo::Message message(
      std::to_underlying(messages::VrpFlags::kGetWriteLocations), kFlags, estimated_payload_size);
  mojo::internal::MessageFragment<
      ::vrp_flags::mojom::internal::VrpFlags_GetWriteLocations_ResponseParams_Data> params(
          message);
  params.Allocate();
  mojo::internal::MessageFragment<
      typename decltype(params->locations)::BaseType>
      locations_fragment(params.message());
  constexpr const mojo::internal::ContainerValidateParams& locations_validate_params =
      mojo::internal::GetArrayValidator<0, false, nullptr>();
  
  mojo::internal::Serialize<mojo::ArrayDataView<uint64_t>>(
    in_locations,
    locations_fragment,
    &locations_validate_params);

  params->locations.Set(
      locations_fragment.is_null() ? nullptr : locations_fragment.data());

  
  MOJO_INTERNAL_CHECK_SERIALIZATION(
    mojo::internal::SendValidation::kDefault,
    !(params->locations.is_null()),
    mojo::internal::VALIDATION_ERROR_UNEXPECTED_NULL_POINTER,
    "null locations in ");

  params->value = in_value;

#if defined(ENABLE_IPC_FUZZER)
  message.set_interface_name(VrpFlags::Name_);
  message.set_method_name("GetWriteLocations");
#endif

  message.set_request_id(request_id_);
  message.set_trace_nonce(trace_nonce_);
  ::mojo::internal::SendMojoMessage(*responder_, message);
  // SendMojoMessage() fails silently if the responder connection is closed,
  // or if the message is malformed.
  //
  // TODO(darin): If Accept() returns false due to a malformed message, that
  // may be good reason to close the connection. However, we don't have a
  // way to do that from here. We should add a way.
  responder_ = nullptr;
}
class VrpFlags_WriteAttempted_ProxyToResponder : public ::mojo::internal::ProxyToResponder {
 public:
  static VrpFlags::WriteAttemptedCallback CreateCallback(
      ::mojo::Message& message,
      std::unique_ptr<mojo::MessageReceiverWithStatus> responder) {
    std::unique_ptr<VrpFlags_WriteAttempted_ProxyToResponder> proxy(
        new VrpFlags_WriteAttempted_ProxyToResponder(
            message, std::move(responder)));
    return base::BindOnce(&VrpFlags_WriteAttempted_ProxyToResponder::Run,
                          std::move(proxy));
  }

  ~VrpFlags_WriteAttempted_ProxyToResponder() {
#if DCHECK_IS_ON()
    if (responder_) {
      // If we're being destroyed without being run, we want to ensure the
      // binding endpoint has been closed. This checks for that asynchronously.
      // We pass a bound generated callback to handle the response so that any
      // resulting DCHECK stack will have useful interface type information.
      // Instantiate a ScopedFizzleBlockShutdownTasks to allow this request to
      // fizzle if this happens after shutdown and the endpoint is bound to a
      // BLOCK_SHUTDOWN sequence.
      base::ThreadPoolInstance::ScopedFizzleBlockShutdownTasks fizzler;
      responder_->IsConnectedAsync(base::BindOnce(&OnIsConnectedComplete));
    }
#endif
  }

 private:
  VrpFlags_WriteAttempted_ProxyToResponder(
      ::mojo::Message& message,
      std::unique_ptr<mojo::MessageReceiverWithStatus> responder)
      : ::mojo::internal::ProxyToResponder(message, std::move(responder)) {
  }

#if DCHECK_IS_ON()
  static void OnIsConnectedComplete(bool connected) {
    DCHECK(!connected)
        << "VrpFlags::WriteAttemptedCallback was destroyed without "
        << "first either being run or its corresponding binding being closed. "
        << "It is an error to drop response callbacks which still correspond "
        << "to an open interface pipe.";
  }
#endif

  void Run(
      bool in_success);
};

bool VrpFlags_WriteAttempted_ForwardToCallback::Accept(
    mojo::Message* message) {
  DCHECK(message->is_serialized());
  internal::VrpFlags_WriteAttempted_ResponseParams_Data* params =
      reinterpret_cast<
          internal::VrpFlags_WriteAttempted_ResponseParams_Data*>(
              message->mutable_payload());
  

  // Validation for VrpFlags.1
  bool success = true;
  bool p_success{};
  VrpFlags_WriteAttempted_ResponseParamsDataView input_data_view(params, message);
  
  if (success)
    p_success = input_data_view.success();
  if (!success) {
    ReportValidationErrorForMessage(
        message,
        mojo::internal::VALIDATION_ERROR_DESERIALIZATION_FAILED,
        VrpFlags::Name_, 1, true);
    return false;
  }
  if (!callback_.is_null()) {
    std::move(callback_).Run(
std::move(p_success));
  }
  return true;
}

void VrpFlags_WriteAttempted_ProxyToResponder::Run(
    bool in_success) {
#if BUILDFLAG(MOJO_TRACE_ENABLED)
  TRACE_EVENT1(
    "mojom", "Send reply vrp_flags::mojom::VrpFlags::WriteAttempted", "async_response_parameters",
    [&](perfetto::TracedValue context){
      auto dict = std::move(context).WriteDictionary();
      perfetto::WriteIntoTracedValueWithFallback(
           dict.AddItem("success"), in_success,
                        "<value of type bool>");
   });
#endif

  const uint32_t kFlags = mojo::Message::kFlagIsResponse |
      ((is_sync_) ? mojo::Message::kFlagIsSync : 0) |
      ((true) ? 0 : mojo::Message::kFlagNoInterrupt) |
      ((false) ? mojo::Message::kFlagIsUrgent : 0);

  const size_t estimated_payload_size =
    0;
  mojo::Message message(
      std::to_underlying(messages::VrpFlags::kWriteAttempted), kFlags, estimated_payload_size);
  mojo::internal::MessageFragment<
      ::vrp_flags::mojom::internal::VrpFlags_WriteAttempted_ResponseParams_Data> params(
          message);
  params.Allocate();

  params->success = in_success;

#if defined(ENABLE_IPC_FUZZER)
  message.set_interface_name(VrpFlags::Name_);
  message.set_method_name("WriteAttempted");
#endif

  message.set_request_id(request_id_);
  message.set_trace_nonce(trace_nonce_);
  ::mojo::internal::SendMojoMessage(*responder_, message);
  // SendMojoMessage() fails silently if the responder connection is closed,
  // or if the message is malformed.
  //
  // TODO(darin): If Accept() returns false due to a malformed message, that
  // may be good reason to close the connection. However, we don't have a
  // way to do that from here. We should add a way.
  responder_ = nullptr;
}
class VrpFlags_GetReadPrefix_ProxyToResponder : public ::mojo::internal::ProxyToResponder {
 public:
  static VrpFlags::GetReadPrefixCallback CreateCallback(
      ::mojo::Message& message,
      std::unique_ptr<mojo::MessageReceiverWithStatus> responder) {
    std::unique_ptr<VrpFlags_GetReadPrefix_ProxyToResponder> proxy(
        new VrpFlags_GetReadPrefix_ProxyToResponder(
            message, std::move(responder)));
    return base::BindOnce(&VrpFlags_GetReadPrefix_ProxyToResponder::Run,
                          std::move(proxy));
  }

  ~VrpFlags_GetReadPrefix_ProxyToResponder() {
#if DCHECK_IS_ON()
    if (responder_) {
      // If we're being destroyed without being run, we want to ensure the
      // binding endpoint has been closed. This checks for that asynchronously.
      // We pass a bound generated callback to handle the response so that any
      // resulting DCHECK stack will have useful interface type information.
      // Instantiate a ScopedFizzleBlockShutdownTasks to allow this request to
      // fizzle if this happens after shutdown and the endpoint is bound to a
      // BLOCK_SHUTDOWN sequence.
      base::ThreadPoolInstance::ScopedFizzleBlockShutdownTasks fizzler;
      responder_->IsConnectedAsync(base::BindOnce(&OnIsConnectedComplete));
    }
#endif
  }

 private:
  VrpFlags_GetReadPrefix_ProxyToResponder(
      ::mojo::Message& message,
      std::unique_ptr<mojo::MessageReceiverWithStatus> responder)
      : ::mojo::internal::ProxyToResponder(message, std::move(responder)) {
  }

#if DCHECK_IS_ON()
  static void OnIsConnectedComplete(bool connected) {
    DCHECK(!connected)
        << "VrpFlags::GetReadPrefixCallback was destroyed without "
        << "first either being run or its corresponding binding being closed. "
        << "It is an error to drop response callbacks which still correspond "
        << "to an open interface pipe.";
  }
#endif

  void Run(
      const ::base::UnguessableToken& in_prefix);
};

bool VrpFlags_GetReadPrefix_ForwardToCallback::Accept(
    mojo::Message* message) {
  DCHECK(message->is_serialized());
  internal::VrpFlags_GetReadPrefix_ResponseParams_Data* params =
      reinterpret_cast<
          internal::VrpFlags_GetReadPrefix_ResponseParams_Data*>(
              message->mutable_payload());
  

  // Validation for VrpFlags.2
  bool success = true;
  ::base::UnguessableToken p_prefix{};
  VrpFlags_GetReadPrefix_ResponseParamsDataView input_data_view(params, message);
  
  if (success && !input_data_view.ReadPrefix(&p_prefix))
    success = false;
  if (!success) {
    ReportValidationErrorForMessage(
        message,
        mojo::internal::VALIDATION_ERROR_DESERIALIZATION_FAILED,
        VrpFlags::Name_, 2, true);
    return false;
  }
  if (!callback_.is_null()) {
    std::move(callback_).Run(
std::move(p_prefix));
  }
  return true;
}

void VrpFlags_GetReadPrefix_ProxyToResponder::Run(
    const ::base::UnguessableToken& in_prefix) {
#if BUILDFLAG(MOJO_TRACE_ENABLED)
  TRACE_EVENT1(
    "mojom", "Send reply vrp_flags::mojom::VrpFlags::GetReadPrefix", "async_response_parameters",
    [&](perfetto::TracedValue context){
      auto dict = std::move(context).WriteDictionary();
      perfetto::WriteIntoTracedValueWithFallback(
           dict.AddItem("prefix"), in_prefix,
                        "<value of type const ::base::UnguessableToken&>");
   });
#endif

  const uint32_t kFlags = mojo::Message::kFlagIsResponse |
      ((is_sync_) ? mojo::Message::kFlagIsSync : 0) |
      ((true) ? 0 : mojo::Message::kFlagNoInterrupt) |
      ((false) ? mojo::Message::kFlagIsUrgent : 0);

  const size_t estimated_payload_size =
    0;
  mojo::Message message(
      std::to_underlying(messages::VrpFlags::kGetReadPrefix), kFlags, estimated_payload_size);
  mojo::internal::MessageFragment<
      ::vrp_flags::mojom::internal::VrpFlags_GetReadPrefix_ResponseParams_Data> params(
          message);
  params.Allocate();
  mojo::internal::MessageFragment<
      typename decltype(params->prefix)::BaseType> prefix_fragment(
          params.message());
  
  mojo::internal::Serialize<::mojo_base::mojom::UnguessableTokenDataView>(
    in_prefix,
    prefix_fragment);

  params->prefix.Set(
      prefix_fragment.is_null() ? nullptr : prefix_fragment.data());

  
  MOJO_INTERNAL_CHECK_SERIALIZATION(
    mojo::internal::SendValidation::kDefault,
    !(params->prefix.is_null()),
    mojo::internal::VALIDATION_ERROR_UNEXPECTED_NULL_POINTER,
    "null prefix in ");

#if defined(ENABLE_IPC_FUZZER)
  message.set_interface_name(VrpFlags::Name_);
  message.set_method_name("GetReadPrefix");
#endif

  message.set_request_id(request_id_);
  message.set_trace_nonce(trace_nonce_);
  ::mojo::internal::SendMojoMessage(*responder_, message);
  // SendMojoMessage() fails silently if the responder connection is closed,
  // or if the message is malformed.
  //
  // TODO(darin): If Accept() returns false due to a malformed message, that
  // may be good reason to close the connection. However, we don't have a
  // way to do that from here. We should add a way.
  responder_ = nullptr;
}
class VrpFlags_ReadAttempted_ProxyToResponder : public ::mojo::internal::ProxyToResponder {
 public:
  static VrpFlags::ReadAttemptedCallback CreateCallback(
      ::mojo::Message& message,
      std::unique_ptr<mojo::MessageReceiverWithStatus> responder) {
    std::unique_ptr<VrpFlags_ReadAttempted_ProxyToResponder> proxy(
        new VrpFlags_ReadAttempted_ProxyToResponder(
            message, std::move(responder)));
    return base::BindOnce(&VrpFlags_ReadAttempted_ProxyToResponder::Run,
                          std::move(proxy));
  }

  ~VrpFlags_ReadAttempted_ProxyToResponder() {
#if DCHECK_IS_ON()
    if (responder_) {
      // If we're being destroyed without being run, we want to ensure the
      // binding endpoint has been closed. This checks for that asynchronously.
      // We pass a bound generated callback to handle the response so that any
      // resulting DCHECK stack will have useful interface type information.
      // Instantiate a ScopedFizzleBlockShutdownTasks to allow this request to
      // fizzle if this happens after shutdown and the endpoint is bound to a
      // BLOCK_SHUTDOWN sequence.
      base::ThreadPoolInstance::ScopedFizzleBlockShutdownTasks fizzler;
      responder_->IsConnectedAsync(base::BindOnce(&OnIsConnectedComplete));
    }
#endif
  }

 private:
  VrpFlags_ReadAttempted_ProxyToResponder(
      ::mojo::Message& message,
      std::unique_ptr<mojo::MessageReceiverWithStatus> responder)
      : ::mojo::internal::ProxyToResponder(message, std::move(responder)) {
  }

#if DCHECK_IS_ON()
  static void OnIsConnectedComplete(bool connected) {
    DCHECK(!connected)
        << "VrpFlags::ReadAttemptedCallback was destroyed without "
        << "first either being run or its corresponding binding being closed. "
        << "It is an error to drop response callbacks which still correspond "
        << "to an open interface pipe.";
  }
#endif

  void Run(
      bool in_success);
};

bool VrpFlags_ReadAttempted_ForwardToCallback::Accept(
    mojo::Message* message) {
  DCHECK(message->is_serialized());
  internal::VrpFlags_ReadAttempted_ResponseParams_Data* params =
      reinterpret_cast<
          internal::VrpFlags_ReadAttempted_ResponseParams_Data*>(
              message->mutable_payload());
  

  // Validation for VrpFlags.3
  bool success = true;
  bool p_success{};
  VrpFlags_ReadAttempted_ResponseParamsDataView input_data_view(params, message);
  
  if (success)
    p_success = input_data_view.success();
  if (!success) {
    ReportValidationErrorForMessage(
        message,
        mojo::internal::VALIDATION_ERROR_DESERIALIZATION_FAILED,
        VrpFlags::Name_, 3, true);
    return false;
  }
  if (!callback_.is_null()) {
    std::move(callback_).Run(
std::move(p_success));
  }
  return true;
}

void VrpFlags_ReadAttempted_ProxyToResponder::Run(
    bool in_success) {
#if BUILDFLAG(MOJO_TRACE_ENABLED)
  TRACE_EVENT1(
    "mojom", "Send reply vrp_flags::mojom::VrpFlags::ReadAttempted", "async_response_parameters",
    [&](perfetto::TracedValue context){
      auto dict = std::move(context).WriteDictionary();
      perfetto::WriteIntoTracedValueWithFallback(
           dict.AddItem("success"), in_success,
                        "<value of type bool>");
   });
#endif

  const uint32_t kFlags = mojo::Message::kFlagIsResponse |
      ((is_sync_) ? mojo::Message::kFlagIsSync : 0) |
      ((true) ? 0 : mojo::Message::kFlagNoInterrupt) |
      ((false) ? mojo::Message::kFlagIsUrgent : 0);

  const size_t estimated_payload_size =
    0;
  mojo::Message message(
      std::to_underlying(messages::VrpFlags::kReadAttempted), kFlags, estimated_payload_size);
  mojo::internal::MessageFragment<
      ::vrp_flags::mojom::internal::VrpFlags_ReadAttempted_ResponseParams_Data> params(
          message);
  params.Allocate();

  params->success = in_success;

#if defined(ENABLE_IPC_FUZZER)
  message.set_interface_name(VrpFlags::Name_);
  message.set_method_name("ReadAttempted");
#endif

  message.set_request_id(request_id_);
  message.set_trace_nonce(trace_nonce_);
  ::mojo::internal::SendMojoMessage(*responder_, message);
  // SendMojoMessage() fails silently if the responder connection is closed,
  // or if the message is malformed.
  //
  // TODO(darin): If Accept() returns false due to a malformed message, that
  // may be good reason to close the connection. However, we don't have a
  // way to do that from here. We should add a way.
  responder_ = nullptr;
}

// static
bool VrpFlagsStubDispatch::Accept(
    VrpFlags* impl,
    mojo::Message* message) {
  switch (static_cast<messages::VrpFlags>(message->header()->name)) {
    case messages::VrpFlags::kGetWriteLocations: {
      break;
    }
    case messages::VrpFlags::kWriteAttempted: {
      break;
    }
    case messages::VrpFlags::kGetReadPrefix: {
      break;
    }
    case messages::VrpFlags::kReadAttempted: {
      break;
    }
  }
  return false;
}

// static
bool VrpFlagsStubDispatch::AcceptWithResponder(
    VrpFlags* impl,
    mojo::Message* message,
    std::unique_ptr<mojo::MessageReceiverWithStatus> responder) {
  [[maybe_unused]] const bool message_is_sync =
      message->has_flag(mojo::Message::kFlagIsSync);
  [[maybe_unused]] const uint64_t request_id = message->request_id();
  switch (static_cast<messages::VrpFlags>(message->header()->name)) {
    case messages::VrpFlags::kGetWriteLocations: {
      internal::VrpFlags_GetWriteLocations_Params_Data* params =
          reinterpret_cast<
              internal::VrpFlags_GetWriteLocations_Params_Data*>(
                  message->mutable_payload());
      

      // Validation for VrpFlags.0
      bool success = true;
      VrpFlags_GetWriteLocations_ParamsDataView input_data_view(params, message);
      
      if (!success) {
        ReportValidationErrorForMessage(
            message,
            mojo::internal::VALIDATION_ERROR_DESERIALIZATION_FAILED,
            VrpFlags::Name_, 0, false);
        return false;
      }
      auto callback =
          VrpFlags_GetWriteLocations_ProxyToResponder::CreateCallback(
              *message, std::move(responder));
      // A null |impl| means no implementation was bound.
      DCHECK(impl);
      impl->GetWriteLocations(std::move(callback));
      return true;
    }
    case messages::VrpFlags::kWriteAttempted: {
      internal::VrpFlags_WriteAttempted_Params_Data* params =
          reinterpret_cast<
              internal::VrpFlags_WriteAttempted_Params_Data*>(
                  message->mutable_payload());
      

      // Validation for VrpFlags.1
      bool success = true;
      uint64_t p_location{};
      VrpFlags_WriteAttempted_ParamsDataView input_data_view(params, message);
      
      if (success)
        p_location = input_data_view.location();
      if (!success) {
        ReportValidationErrorForMessage(
            message,
            mojo::internal::VALIDATION_ERROR_DESERIALIZATION_FAILED,
            VrpFlags::Name_, 1, false);
        return false;
      }
      auto callback =
          VrpFlags_WriteAttempted_ProxyToResponder::CreateCallback(
              *message, std::move(responder));
      // A null |impl| means no implementation was bound.
      DCHECK(impl);
      impl->WriteAttempted(        
        std::move(p_location), std::move(callback));
      return true;
    }
    case messages::VrpFlags::kGetReadPrefix: {
      internal::VrpFlags_GetReadPrefix_Params_Data* params =
          reinterpret_cast<
              internal::VrpFlags_GetReadPrefix_Params_Data*>(
                  message->mutable_payload());
      

      // Validation for VrpFlags.2
      bool success = true;
      VrpFlags_GetReadPrefix_ParamsDataView input_data_view(params, message);
      
      if (!success) {
        ReportValidationErrorForMessage(
            message,
            mojo::internal::VALIDATION_ERROR_DESERIALIZATION_FAILED,
            VrpFlags::Name_, 2, false);
        return false;
      }
      auto callback =
          VrpFlags_GetReadPrefix_ProxyToResponder::CreateCallback(
              *message, std::move(responder));
      // A null |impl| means no implementation was bound.
      DCHECK(impl);
      impl->GetReadPrefix(std::move(callback));
      return true;
    }
    case messages::VrpFlags::kReadAttempted: {
      internal::VrpFlags_ReadAttempted_Params_Data* params =
          reinterpret_cast<
              internal::VrpFlags_ReadAttempted_Params_Data*>(
                  message->mutable_payload());
      

      // Validation for VrpFlags.3
      bool success = true;
      ::base::UnguessableToken p_flag{};
      VrpFlags_ReadAttempted_ParamsDataView input_data_view(params, message);
      
      if (success && !input_data_view.ReadFlag(&p_flag))
        success = false;
      if (!success) {
        ReportValidationErrorForMessage(
            message,
            mojo::internal::VALIDATION_ERROR_DESERIALIZATION_FAILED,
            VrpFlags::Name_, 3, false);
        return false;
      }
      auto callback =
          VrpFlags_ReadAttempted_ProxyToResponder::CreateCallback(
              *message, std::move(responder));
      // A null |impl| means no implementation was bound.
      DCHECK(impl);
      impl->ReadAttempted(        
        std::move(p_flag), std::move(callback));
      return true;
    }
  }
  return false;
}
namespace {
}  // namespace
static const std::pair<uint32_t, mojo::internal::GenericValidationInfo> kVrpFlagsValidationInfo[] = {
    {std::to_underlying(messages::VrpFlags::kGetWriteLocations),
     { &internal::VrpFlags_GetWriteLocations_Params_Data::Validate,
      &internal::VrpFlags_GetWriteLocations_ResponseParams_Data::Validate}},
    {std::to_underlying(messages::VrpFlags::kWriteAttempted),
     { &internal::VrpFlags_WriteAttempted_Params_Data::Validate,
      &internal::VrpFlags_WriteAttempted_ResponseParams_Data::Validate}},
    {std::to_underlying(messages::VrpFlags::kGetReadPrefix),
     { &internal::VrpFlags_GetReadPrefix_Params_Data::Validate,
      &internal::VrpFlags_GetReadPrefix_ResponseParams_Data::Validate}},
    {std::to_underlying(messages::VrpFlags::kReadAttempted),
     { &internal::VrpFlags_ReadAttempted_Params_Data::Validate,
      &internal::VrpFlags_ReadAttempted_ResponseParams_Data::Validate}},
};

bool VrpFlagsRequestValidator::Accept(mojo::Message* message) {
  return mojo::internal::ValidateRequestGeneric(
    message,
    ::vrp_flags::mojom::VrpFlags::Name_,
    kVrpFlagsValidationInfo);
}

bool VrpFlagsResponseValidator::Accept(mojo::Message* message) {
  return mojo::internal::ValidateResponseGeneric(
    message,
    ::vrp_flags::mojom::VrpFlags::Name_,
    kVrpFlagsValidationInfo);

}
// The declaration includes the definition on other builds.

VrpFlagsFactory::IPCStableHashFunction VrpFlagsFactory::MessageToMethodInfo_(mojo::Message& message) {
#if !BUILDFLAG(IS_FUCHSIA)
  switch (static_cast<messages::VrpFlagsFactory>(message.name())) {
    case messages::VrpFlagsFactory::kBindBrowserVrpFlags: {
      return &VrpFlagsFactory::BindBrowserVrpFlags_Sym::IPCStableHash;
    }
    case messages::VrpFlagsFactory::kBindNetworkVrpFlags: {
      return &VrpFlagsFactory::BindNetworkVrpFlags_Sym::IPCStableHash;
    }
    case messages::VrpFlagsFactory::kBindGpuVrpFlags: {
      return &VrpFlagsFactory::BindGpuVrpFlags_Sym::IPCStableHash;
    }
    case messages::VrpFlagsFactory::kStartRendererForVrpFlags: {
      return &VrpFlagsFactory::StartRendererForVrpFlags_Sym::IPCStableHash;
    }
  }
#endif  // !BUILDFLAG(IS_FUCHSIA)
  return nullptr;
}


const char* VrpFlagsFactory::MessageToMethodName_(mojo::Message& message) {
#if BUILDFLAG(MOJO_TRACE_ENABLED)
  bool is_response = message.has_flag(mojo::Message::kFlagIsResponse);
  if (!is_response) {
    switch (static_cast<messages::VrpFlagsFactory>(message.name())) {
      case messages::VrpFlagsFactory::kBindBrowserVrpFlags:
            return "Receive vrp_flags::mojom::VrpFlagsFactory::BindBrowserVrpFlags";
      case messages::VrpFlagsFactory::kBindNetworkVrpFlags:
            return "Receive vrp_flags::mojom::VrpFlagsFactory::BindNetworkVrpFlags";
      case messages::VrpFlagsFactory::kBindGpuVrpFlags:
            return "Receive vrp_flags::mojom::VrpFlagsFactory::BindGpuVrpFlags";
      case messages::VrpFlagsFactory::kStartRendererForVrpFlags:
            return "Receive vrp_flags::mojom::VrpFlagsFactory::StartRendererForVrpFlags";
    }
  } else {
    switch (static_cast<messages::VrpFlagsFactory>(message.name())) {
      case messages::VrpFlagsFactory::kBindBrowserVrpFlags:
            return "Receive reply vrp_flags::mojom::VrpFlagsFactory::BindBrowserVrpFlags";
      case messages::VrpFlagsFactory::kBindNetworkVrpFlags:
            return "Receive reply vrp_flags::mojom::VrpFlagsFactory::BindNetworkVrpFlags";
      case messages::VrpFlagsFactory::kBindGpuVrpFlags:
            return "Receive reply vrp_flags::mojom::VrpFlagsFactory::BindGpuVrpFlags";
      case messages::VrpFlagsFactory::kStartRendererForVrpFlags:
            return "Receive reply vrp_flags::mojom::VrpFlagsFactory::StartRendererForVrpFlags";
    }
  }
  return "Receive unknown mojo message";
#else
  bool is_response = message.has_flag(mojo::Message::kFlagIsResponse);
  if (is_response) {
    return "Receive mojo reply";
  } else {
    return "Receive mojo message";
  }
#endif // BUILDFLAG(MOJO_TRACE_ENABLED)
}

#if !BUILDFLAG(IS_FUCHSIA)
uint32_t VrpFlagsFactory::BindBrowserVrpFlags_Sym::IPCStableHash() {
  // This method's address is used for identifying the mojo method name after
  // symbolization. So each IPCStableHash should have a unique address.
  // We cannot use NO_CODE_FOLDING() here - it relies on the uniqueness of
  // __LINE__ value, which is not unique across different mojo modules.
  // The code below is very similar to NO_CODE_FOLDING, but it uses a unique
  // hash instead of __LINE__.
  static constexpr uint32_t kHash = 0x229a9679;  // IPCStableHash for vrp_flags::mojom::VrpFlagsFactory::BindBrowserVrpFlags
  const uint32_t hash = kHash;
  base::debug::Alias(&hash);
  return hash;
}
uint32_t VrpFlagsFactory::BindNetworkVrpFlags_Sym::IPCStableHash() {
  // This method's address is used for identifying the mojo method name after
  // symbolization. So each IPCStableHash should have a unique address.
  // We cannot use NO_CODE_FOLDING() here - it relies on the uniqueness of
  // __LINE__ value, which is not unique across different mojo modules.
  // The code below is very similar to NO_CODE_FOLDING, but it uses a unique
  // hash instead of __LINE__.
  static constexpr uint32_t kHash = 0x0882d03e;  // IPCStableHash for vrp_flags::mojom::VrpFlagsFactory::BindNetworkVrpFlags
  const uint32_t hash = kHash;
  base::debug::Alias(&hash);
  return hash;
}
uint32_t VrpFlagsFactory::BindGpuVrpFlags_Sym::IPCStableHash() {
  // This method's address is used for identifying the mojo method name after
  // symbolization. So each IPCStableHash should have a unique address.
  // We cannot use NO_CODE_FOLDING() here - it relies on the uniqueness of
  // __LINE__ value, which is not unique across different mojo modules.
  // The code below is very similar to NO_CODE_FOLDING, but it uses a unique
  // hash instead of __LINE__.
  static constexpr uint32_t kHash = 0x31fd202d;  // IPCStableHash for vrp_flags::mojom::VrpFlagsFactory::BindGpuVrpFlags
  const uint32_t hash = kHash;
  base::debug::Alias(&hash);
  return hash;
}
uint32_t VrpFlagsFactory::StartRendererForVrpFlags_Sym::IPCStableHash() {
  // This method's address is used for identifying the mojo method name after
  // symbolization. So each IPCStableHash should have a unique address.
  // We cannot use NO_CODE_FOLDING() here - it relies on the uniqueness of
  // __LINE__ value, which is not unique across different mojo modules.
  // The code below is very similar to NO_CODE_FOLDING, but it uses a unique
  // hash instead of __LINE__.
  static constexpr uint32_t kHash = 0x35ba688a;  // IPCStableHash for vrp_flags::mojom::VrpFlagsFactory::StartRendererForVrpFlags
  const uint32_t hash = kHash;
  base::debug::Alias(&hash);
  return hash;
}
# endif // !BUILDFLAG(IS_FUCHSIA)

class VrpFlagsFactory_StartRendererForVrpFlags_ForwardToCallback
    : public mojo::MessageReceiver {
 public:
  VrpFlagsFactory_StartRendererForVrpFlags_ForwardToCallback(
      VrpFlagsFactory::StartRendererForVrpFlagsCallback callback
      ) : callback_(std::move(callback)) {
  }

  VrpFlagsFactory_StartRendererForVrpFlags_ForwardToCallback(const VrpFlagsFactory_StartRendererForVrpFlags_ForwardToCallback&) = delete;
  VrpFlagsFactory_StartRendererForVrpFlags_ForwardToCallback& operator=(const VrpFlagsFactory_StartRendererForVrpFlags_ForwardToCallback&) = delete;

  bool Accept(mojo::Message* message) override;
 private:
  VrpFlagsFactory::StartRendererForVrpFlagsCallback callback_;
};

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

void VrpFlagsFactoryProxy::BindBrowserVrpFlags(
    ::mojo::PendingReceiver<VrpFlags> in_receiver) {
#if BUILDFLAG(MOJO_TRACE_ENABLED)
  TRACE_EVENT1(
    "mojom", "Send vrp_flags::mojom::VrpFlagsFactory::BindBrowserVrpFlags", "input_parameters",
    [&](perfetto::TracedValue context){
      auto dict = std::move(context).WriteDictionary();
      perfetto::WriteIntoTracedValueWithFallback(
           dict.AddItem("receiver"), in_receiver,
                        "<value of type ::mojo::PendingReceiver<VrpFlags>>");
   });
#endif

  const bool kExpectsResponse = false;
  const bool kIsSync = false;
  const bool kAllowInterrupt = true;
  const bool is_urgent = false;

  const uint32_t kFlags =
      ((kExpectsResponse) ? mojo::Message::kFlagExpectsResponse : 0) |
      ((kIsSync) ? mojo::Message::kFlagIsSync : 0) |
      ((kAllowInterrupt) ? 0 : mojo::Message::kFlagNoInterrupt) |
      ((is_urgent) ? mojo::Message::kFlagIsUrgent : 0);

  const size_t estimated_payload_size =
    0;
  mojo::Message message(
      std::to_underlying(messages::VrpFlagsFactory::kBindBrowserVrpFlags), kFlags, estimated_payload_size);
  mojo::internal::MessageFragment<
      ::vrp_flags::mojom::internal::VrpFlagsFactory_BindBrowserVrpFlags_Params_Data> params(
          message);
  params.Allocate();

  
  mojo::internal::Serialize<mojo::InterfaceRequestDataView<::vrp_flags::mojom::VrpFlagsInterfaceBase>>(
    in_receiver,
    &params->receiver,
    &params.message());

  
  MOJO_INTERNAL_CHECK_SERIALIZATION(
    mojo::internal::SendValidation::kDefault,
    !(!mojo::internal::IsHandleOrInterfaceValid(params->receiver)),
    mojo::internal::VALIDATION_ERROR_UNEXPECTED_INVALID_HANDLE,
    "invalid receiver in VrpFlagsFactory.BindBrowserVrpFlags request");

#if defined(ENABLE_IPC_FUZZER)
  message.set_interface_name(VrpFlagsFactory::Name_);
  message.set_method_name("BindBrowserVrpFlags");
#endif
  // This return value may be ignored as false implies the Connector has
  // encountered an error, which will be visible through other means.
  ::mojo::internal::SendMojoMessage(*receiver_, message);
}

void VrpFlagsFactoryProxy::BindNetworkVrpFlags(
    ::mojo::PendingReceiver<VrpFlags> in_receiver) {
#if BUILDFLAG(MOJO_TRACE_ENABLED)
  TRACE_EVENT1(
    "mojom", "Send vrp_flags::mojom::VrpFlagsFactory::BindNetworkVrpFlags", "input_parameters",
    [&](perfetto::TracedValue context){
      auto dict = std::move(context).WriteDictionary();
      perfetto::WriteIntoTracedValueWithFallback(
           dict.AddItem("receiver"), in_receiver,
                        "<value of type ::mojo::PendingReceiver<VrpFlags>>");
   });
#endif

  const bool kExpectsResponse = false;
  const bool kIsSync = false;
  const bool kAllowInterrupt = true;
  const bool is_urgent = false;

  const uint32_t kFlags =
      ((kExpectsResponse) ? mojo::Message::kFlagExpectsResponse : 0) |
      ((kIsSync) ? mojo::Message::kFlagIsSync : 0) |
      ((kAllowInterrupt) ? 0 : mojo::Message::kFlagNoInterrupt) |
      ((is_urgent) ? mojo::Message::kFlagIsUrgent : 0);

  const size_t estimated_payload_size =
    0;
  mojo::Message message(
      std::to_underlying(messages::VrpFlagsFactory::kBindNetworkVrpFlags), kFlags, estimated_payload_size);
  mojo::internal::MessageFragment<
      ::vrp_flags::mojom::internal::VrpFlagsFactory_BindNetworkVrpFlags_Params_Data> params(
          message);
  params.Allocate();

  
  mojo::internal::Serialize<mojo::InterfaceRequestDataView<::vrp_flags::mojom::VrpFlagsInterfaceBase>>(
    in_receiver,
    &params->receiver,
    &params.message());

  
  MOJO_INTERNAL_CHECK_SERIALIZATION(
    mojo::internal::SendValidation::kDefault,
    !(!mojo::internal::IsHandleOrInterfaceValid(params->receiver)),
    mojo::internal::VALIDATION_ERROR_UNEXPECTED_INVALID_HANDLE,
    "invalid receiver in VrpFlagsFactory.BindNetworkVrpFlags request");

#if defined(ENABLE_IPC_FUZZER)
  message.set_interface_name(VrpFlagsFactory::Name_);
  message.set_method_name("BindNetworkVrpFlags");
#endif
  // This return value may be ignored as false implies the Connector has
  // encountered an error, which will be visible through other means.
  ::mojo::internal::SendMojoMessage(*receiver_, message);
}

void VrpFlagsFactoryProxy::BindGpuVrpFlags(
    ::mojo::PendingReceiver<VrpFlags> in_receiver) {
#if BUILDFLAG(MOJO_TRACE_ENABLED)
  TRACE_EVENT1(
    "mojom", "Send vrp_flags::mojom::VrpFlagsFactory::BindGpuVrpFlags", "input_parameters",
    [&](perfetto::TracedValue context){
      auto dict = std::move(context).WriteDictionary();
      perfetto::WriteIntoTracedValueWithFallback(
           dict.AddItem("receiver"), in_receiver,
                        "<value of type ::mojo::PendingReceiver<VrpFlags>>");
   });
#endif

  const bool kExpectsResponse = false;
  const bool kIsSync = false;
  const bool kAllowInterrupt = true;
  const bool is_urgent = false;

  const uint32_t kFlags =
      ((kExpectsResponse) ? mojo::Message::kFlagExpectsResponse : 0) |
      ((kIsSync) ? mojo::Message::kFlagIsSync : 0) |
      ((kAllowInterrupt) ? 0 : mojo::Message::kFlagNoInterrupt) |
      ((is_urgent) ? mojo::Message::kFlagIsUrgent : 0);

  const size_t estimated_payload_size =
    0;
  mojo::Message message(
      std::to_underlying(messages::VrpFlagsFactory::kBindGpuVrpFlags), kFlags, estimated_payload_size);
  mojo::internal::MessageFragment<
      ::vrp_flags::mojom::internal::VrpFlagsFactory_BindGpuVrpFlags_Params_Data> params(
          message);
  params.Allocate();

  
  mojo::internal::Serialize<mojo::InterfaceRequestDataView<::vrp_flags::mojom::VrpFlagsInterfaceBase>>(
    in_receiver,
    &params->receiver,
    &params.message());

  
  MOJO_INTERNAL_CHECK_SERIALIZATION(
    mojo::internal::SendValidation::kDefault,
    !(!mojo::internal::IsHandleOrInterfaceValid(params->receiver)),
    mojo::internal::VALIDATION_ERROR_UNEXPECTED_INVALID_HANDLE,
    "invalid receiver in VrpFlagsFactory.BindGpuVrpFlags request");

#if defined(ENABLE_IPC_FUZZER)
  message.set_interface_name(VrpFlagsFactory::Name_);
  message.set_method_name("BindGpuVrpFlags");
#endif
  // This return value may be ignored as false implies the Connector has
  // encountered an error, which will be visible through other means.
  ::mojo::internal::SendMojoMessage(*receiver_, message);
}

void VrpFlagsFactoryProxy::StartRendererForVrpFlags(
    VictimDisposition in_disposition, ::mojo::PendingReceiver<VrpFlags> in_receiver, StartRendererForVrpFlagsCallback callback) {
#if BUILDFLAG(MOJO_TRACE_ENABLED)
  TRACE_EVENT1(
    "mojom", "Send vrp_flags::mojom::VrpFlagsFactory::StartRendererForVrpFlags", "input_parameters",
    [&](perfetto::TracedValue context){
      auto dict = std::move(context).WriteDictionary();
      perfetto::WriteIntoTracedValueWithFallback(
           dict.AddItem("disposition"), in_disposition,
                        "<value of type VictimDisposition>");
      perfetto::WriteIntoTracedValueWithFallback(
           dict.AddItem("receiver"), in_receiver,
                        "<value of type ::mojo::PendingReceiver<VrpFlags>>");
   });
#endif

  const bool kExpectsResponse = true;
  const bool kIsSync = false;
  const bool kAllowInterrupt = true;
  const bool is_urgent = false;

  const uint32_t kFlags =
      ((kExpectsResponse) ? mojo::Message::kFlagExpectsResponse : 0) |
      ((kIsSync) ? mojo::Message::kFlagIsSync : 0) |
      ((kAllowInterrupt) ? 0 : mojo::Message::kFlagNoInterrupt) |
      ((is_urgent) ? mojo::Message::kFlagIsUrgent : 0);

  const size_t estimated_payload_size =
    0;
  mojo::Message message(
      std::to_underlying(messages::VrpFlagsFactory::kStartRendererForVrpFlags), kFlags, estimated_payload_size);
  mojo::internal::MessageFragment<
      ::vrp_flags::mojom::internal::VrpFlagsFactory_StartRendererForVrpFlags_Params_Data> params(
          message);
  params.Allocate();

  
  mojo::internal::Serialize<::vrp_flags::mojom::VictimDisposition>(
    in_disposition,
    &params->disposition);

  
  mojo::internal::Serialize<mojo::InterfaceRequestDataView<::vrp_flags::mojom::VrpFlagsInterfaceBase>>(
    in_receiver,
    &params->receiver,
    &params.message());

  
  MOJO_INTERNAL_CHECK_SERIALIZATION(
    mojo::internal::SendValidation::kDefault,
    !(!mojo::internal::IsHandleOrInterfaceValid(params->receiver)),
    mojo::internal::VALIDATION_ERROR_UNEXPECTED_INVALID_HANDLE,
    "invalid receiver in VrpFlagsFactory.StartRendererForVrpFlags request");

#if defined(ENABLE_IPC_FUZZER)
  message.set_interface_name(VrpFlagsFactory::Name_);
  message.set_method_name("StartRendererForVrpFlags");
#endif
  std::unique_ptr<mojo::MessageReceiver> responder(
      new VrpFlagsFactory_StartRendererForVrpFlags_ForwardToCallback(
          std::move(callback)));
  ::mojo::internal::SendMojoMessage(*receiver_, message, std::move(responder));
}
class VrpFlagsFactory_StartRendererForVrpFlags_ProxyToResponder : public ::mojo::internal::ProxyToResponder {
 public:
  static VrpFlagsFactory::StartRendererForVrpFlagsCallback CreateCallback(
      ::mojo::Message& message,
      std::unique_ptr<mojo::MessageReceiverWithStatus> responder) {
    std::unique_ptr<VrpFlagsFactory_StartRendererForVrpFlags_ProxyToResponder> proxy(
        new VrpFlagsFactory_StartRendererForVrpFlags_ProxyToResponder(
            message, std::move(responder)));
    return base::BindOnce(&VrpFlagsFactory_StartRendererForVrpFlags_ProxyToResponder::Run,
                          std::move(proxy));
  }

  ~VrpFlagsFactory_StartRendererForVrpFlags_ProxyToResponder() {
#if DCHECK_IS_ON()
    if (responder_) {
      // If we're being destroyed without being run, we want to ensure the
      // binding endpoint has been closed. This checks for that asynchronously.
      // We pass a bound generated callback to handle the response so that any
      // resulting DCHECK stack will have useful interface type information.
      // Instantiate a ScopedFizzleBlockShutdownTasks to allow this request to
      // fizzle if this happens after shutdown and the endpoint is bound to a
      // BLOCK_SHUTDOWN sequence.
      base::ThreadPoolInstance::ScopedFizzleBlockShutdownTasks fizzler;
      responder_->IsConnectedAsync(base::BindOnce(&OnIsConnectedComplete));
    }
#endif
  }

 private:
  VrpFlagsFactory_StartRendererForVrpFlags_ProxyToResponder(
      ::mojo::Message& message,
      std::unique_ptr<mojo::MessageReceiverWithStatus> responder)
      : ::mojo::internal::ProxyToResponder(message, std::move(responder)) {
  }

#if DCHECK_IS_ON()
  static void OnIsConnectedComplete(bool connected) {
    DCHECK(!connected)
        << "VrpFlagsFactory::StartRendererForVrpFlagsCallback was destroyed without "
        << "first either being run or its corresponding binding being closed. "
        << "It is an error to drop response callbacks which still correspond "
        << "to an open interface pipe.";
  }
#endif

  void Run(
      uint16_t in_port);
};

bool VrpFlagsFactory_StartRendererForVrpFlags_ForwardToCallback::Accept(
    mojo::Message* message) {
  DCHECK(message->is_serialized());
  internal::VrpFlagsFactory_StartRendererForVrpFlags_ResponseParams_Data* params =
      reinterpret_cast<
          internal::VrpFlagsFactory_StartRendererForVrpFlags_ResponseParams_Data*>(
              message->mutable_payload());
  

  // Validation for VrpFlagsFactory.3
  bool success = true;
  uint16_t p_port{};
  VrpFlagsFactory_StartRendererForVrpFlags_ResponseParamsDataView input_data_view(params, message);
  
  if (success)
    p_port = input_data_view.port();
  if (!success) {
    ReportValidationErrorForMessage(
        message,
        mojo::internal::VALIDATION_ERROR_DESERIALIZATION_FAILED,
        VrpFlagsFactory::Name_, 3, true);
    return false;
  }
  if (!callback_.is_null()) {
    std::move(callback_).Run(
std::move(p_port));
  }
  return true;
}

void VrpFlagsFactory_StartRendererForVrpFlags_ProxyToResponder::Run(
    uint16_t in_port) {
#if BUILDFLAG(MOJO_TRACE_ENABLED)
  TRACE_EVENT1(
    "mojom", "Send reply vrp_flags::mojom::VrpFlagsFactory::StartRendererForVrpFlags", "async_response_parameters",
    [&](perfetto::TracedValue context){
      auto dict = std::move(context).WriteDictionary();
      perfetto::WriteIntoTracedValueWithFallback(
           dict.AddItem("port"), in_port,
                        "<value of type uint16_t>");
   });
#endif

  const uint32_t kFlags = mojo::Message::kFlagIsResponse |
      ((is_sync_) ? mojo::Message::kFlagIsSync : 0) |
      ((true) ? 0 : mojo::Message::kFlagNoInterrupt) |
      ((false) ? mojo::Message::kFlagIsUrgent : 0);

  const size_t estimated_payload_size =
    0;
  mojo::Message message(
      std::to_underlying(messages::VrpFlagsFactory::kStartRendererForVrpFlags), kFlags, estimated_payload_size);
  mojo::internal::MessageFragment<
      ::vrp_flags::mojom::internal::VrpFlagsFactory_StartRendererForVrpFlags_ResponseParams_Data> params(
          message);
  params.Allocate();

  params->port = in_port;

#if defined(ENABLE_IPC_FUZZER)
  message.set_interface_name(VrpFlagsFactory::Name_);
  message.set_method_name("StartRendererForVrpFlags");
#endif

  message.set_request_id(request_id_);
  message.set_trace_nonce(trace_nonce_);
  ::mojo::internal::SendMojoMessage(*responder_, message);
  // SendMojoMessage() fails silently if the responder connection is closed,
  // or if the message is malformed.
  //
  // TODO(darin): If Accept() returns false due to a malformed message, that
  // may be good reason to close the connection. However, we don't have a
  // way to do that from here. We should add a way.
  responder_ = nullptr;
}

// static
bool VrpFlagsFactoryStubDispatch::Accept(
    VrpFlagsFactory* impl,
    mojo::Message* message) {
  switch (static_cast<messages::VrpFlagsFactory>(message->header()->name)) {
    case messages::VrpFlagsFactory::kBindBrowserVrpFlags: {
      DCHECK(message->is_serialized());
      internal::VrpFlagsFactory_BindBrowserVrpFlags_Params_Data* params =
          reinterpret_cast<internal::VrpFlagsFactory_BindBrowserVrpFlags_Params_Data*>(
              message->mutable_payload());
      

      // Validation for VrpFlagsFactory.0
      bool success = true;
      ::mojo::PendingReceiver<VrpFlags> p_receiver{};
      VrpFlagsFactory_BindBrowserVrpFlags_ParamsDataView input_data_view(params, message);
      
      if (success) {
        p_receiver =
            input_data_view.TakeReceiver<decltype(p_receiver)>();
      }
      if (!success) {
        ReportValidationErrorForMessage(
            message,
            mojo::internal::VALIDATION_ERROR_DESERIALIZATION_FAILED,
            VrpFlagsFactory::Name_, 0, false);
        return false;
      }
      // A null |impl| means no implementation was bound.
      DCHECK(impl);
      impl->BindBrowserVrpFlags(        
        std::move(p_receiver));
      return true;
    }
    case messages::VrpFlagsFactory::kBindNetworkVrpFlags: {
      DCHECK(message->is_serialized());
      internal::VrpFlagsFactory_BindNetworkVrpFlags_Params_Data* params =
          reinterpret_cast<internal::VrpFlagsFactory_BindNetworkVrpFlags_Params_Data*>(
              message->mutable_payload());
      

      // Validation for VrpFlagsFactory.1
      bool success = true;
      ::mojo::PendingReceiver<VrpFlags> p_receiver{};
      VrpFlagsFactory_BindNetworkVrpFlags_ParamsDataView input_data_view(params, message);
      
      if (success) {
        p_receiver =
            input_data_view.TakeReceiver<decltype(p_receiver)>();
      }
      if (!success) {
        ReportValidationErrorForMessage(
            message,
            mojo::internal::VALIDATION_ERROR_DESERIALIZATION_FAILED,
            VrpFlagsFactory::Name_, 1, false);
        return false;
      }
      // A null |impl| means no implementation was bound.
      DCHECK(impl);
      impl->BindNetworkVrpFlags(        
        std::move(p_receiver));
      return true;
    }
    case messages::VrpFlagsFactory::kBindGpuVrpFlags: {
      DCHECK(message->is_serialized());
      internal::VrpFlagsFactory_BindGpuVrpFlags_Params_Data* params =
          reinterpret_cast<internal::VrpFlagsFactory_BindGpuVrpFlags_Params_Data*>(
              message->mutable_payload());
      

      // Validation for VrpFlagsFactory.2
      bool success = true;
      ::mojo::PendingReceiver<VrpFlags> p_receiver{};
      VrpFlagsFactory_BindGpuVrpFlags_ParamsDataView input_data_view(params, message);
      
      if (success) {
        p_receiver =
            input_data_view.TakeReceiver<decltype(p_receiver)>();
      }
      if (!success) {
        ReportValidationErrorForMessage(
            message,
            mojo::internal::VALIDATION_ERROR_DESERIALIZATION_FAILED,
            VrpFlagsFactory::Name_, 2, false);
        return false;
      }
      // A null |impl| means no implementation was bound.
      DCHECK(impl);
      impl->BindGpuVrpFlags(        
        std::move(p_receiver));
      return true;
    }
    case messages::VrpFlagsFactory::kStartRendererForVrpFlags: {
      break;
    }
  }
  return false;
}

// static
bool VrpFlagsFactoryStubDispatch::AcceptWithResponder(
    VrpFlagsFactory* impl,
    mojo::Message* message,
    std::unique_ptr<mojo::MessageReceiverWithStatus> responder) {
  [[maybe_unused]] const bool message_is_sync =
      message->has_flag(mojo::Message::kFlagIsSync);
  [[maybe_unused]] const uint64_t request_id = message->request_id();
  switch (static_cast<messages::VrpFlagsFactory>(message->header()->name)) {
    case messages::VrpFlagsFactory::kBindBrowserVrpFlags: {
      break;
    }
    case messages::VrpFlagsFactory::kBindNetworkVrpFlags: {
      break;
    }
    case messages::VrpFlagsFactory::kBindGpuVrpFlags: {
      break;
    }
    case messages::VrpFlagsFactory::kStartRendererForVrpFlags: {
      internal::VrpFlagsFactory_StartRendererForVrpFlags_Params_Data* params =
          reinterpret_cast<
              internal::VrpFlagsFactory_StartRendererForVrpFlags_Params_Data*>(
                  message->mutable_payload());
      

      // Validation for VrpFlagsFactory.3
      bool success = true;
      VictimDisposition p_disposition{};
      ::mojo::PendingReceiver<VrpFlags> p_receiver{};
      VrpFlagsFactory_StartRendererForVrpFlags_ParamsDataView input_data_view(params, message);
      
      if (success && !input_data_view.ReadDisposition(&p_disposition))
        success = false;
      if (success) {
        p_receiver =
            input_data_view.TakeReceiver<decltype(p_receiver)>();
      }
      if (!success) {
        ReportValidationErrorForMessage(
            message,
            mojo::internal::VALIDATION_ERROR_DESERIALIZATION_FAILED,
            VrpFlagsFactory::Name_, 3, false);
        return false;
      }
      auto callback =
          VrpFlagsFactory_StartRendererForVrpFlags_ProxyToResponder::CreateCallback(
              *message, std::move(responder));
      // A null |impl| means no implementation was bound.
      DCHECK(impl);
      impl->StartRendererForVrpFlags(        
        std::move(p_disposition), 
        std::move(p_receiver), std::move(callback));
      return true;
    }
  }
  return false;
}
namespace {
}  // namespace
static const std::pair<uint32_t, mojo::internal::GenericValidationInfo> kVrpFlagsFactoryValidationInfo[] = {
    {std::to_underlying(messages::VrpFlagsFactory::kBindBrowserVrpFlags),
     { &internal::VrpFlagsFactory_BindBrowserVrpFlags_Params_Data::Validate,
      nullptr /* no response */}},
    {std::to_underlying(messages::VrpFlagsFactory::kBindNetworkVrpFlags),
     { &internal::VrpFlagsFactory_BindNetworkVrpFlags_Params_Data::Validate,
      nullptr /* no response */}},
    {std::to_underlying(messages::VrpFlagsFactory::kBindGpuVrpFlags),
     { &internal::VrpFlagsFactory_BindGpuVrpFlags_Params_Data::Validate,
      nullptr /* no response */}},
    {std::to_underlying(messages::VrpFlagsFactory::kStartRendererForVrpFlags),
     { &internal::VrpFlagsFactory_StartRendererForVrpFlags_Params_Data::Validate,
      &internal::VrpFlagsFactory_StartRendererForVrpFlags_ResponseParams_Data::Validate}},
};

bool VrpFlagsFactoryRequestValidator::Accept(mojo::Message* message) {
  return mojo::internal::ValidateRequestGeneric(
    message,
    ::vrp_flags::mojom::VrpFlagsFactory::Name_,
    kVrpFlagsFactoryValidationInfo);
}

bool VrpFlagsFactoryResponseValidator::Accept(mojo::Message* message) {
  return mojo::internal::ValidateResponseGeneric(
    message,
    ::vrp_flags::mojom::VrpFlagsFactory::Name_,
    kVrpFlagsFactoryValidationInfo);

}


}  // vrp_flags::mojom


namespace mojo {

}  // namespace mojo


// Symbols declared in the -test-utils.h header are defined here instead of a
// separate .cc file to save compile time.


namespace vrp_flags::mojom {


void VrpFlagsInterceptorForTesting::GetWriteLocations(GetWriteLocationsCallback callback) {
  GetForwardingInterface()->GetWriteLocations(std::move(callback));
}
void VrpFlagsInterceptorForTesting::WriteAttempted(uint64_t location, WriteAttemptedCallback callback) {
  GetForwardingInterface()->WriteAttempted(
    std::move(location)
    , std::move(callback));
}
void VrpFlagsInterceptorForTesting::GetReadPrefix(GetReadPrefixCallback callback) {
  GetForwardingInterface()->GetReadPrefix(std::move(callback));
}
void VrpFlagsInterceptorForTesting::ReadAttempted(const ::base::UnguessableToken& flag, ReadAttemptedCallback callback) {
  GetForwardingInterface()->ReadAttempted(
    std::move(flag)
    , std::move(callback));
}
VrpFlagsAsyncWaiter::VrpFlagsAsyncWaiter(
    VrpFlags* proxy) : proxy_(proxy) {}

VrpFlagsAsyncWaiter::~VrpFlagsAsyncWaiter() = default;


void VrpFlagsAsyncWaiter::GetWriteLocations(
    std::vector<uint64_t>* out_locations, uint64_t* out_value) {
  base::RunLoop loop;
  proxy_->GetWriteLocations(
      base::BindOnce(
          [](base::RunLoop* loop,
             std::vector<uint64_t>* out_locations
,
             uint64_t* out_value
,
             const std::vector<uint64_t>& locations,
             uint64_t value) {*out_locations = std::move(locations);*out_value = std::move(value);
            loop->Quit();
          },
          &loop,
          out_locations,
          out_value));
  loop.Run();
}



void VrpFlagsAsyncWaiter::WriteAttempted(
    uint64_t location, bool* out_success) {
  base::RunLoop loop;
  proxy_->WriteAttempted(
      std::move(location),
      base::BindOnce(
          [](base::RunLoop* loop,
             bool* out_success
,
             bool success) {*out_success = std::move(success);
            loop->Quit();
          },
          &loop,
          out_success));
  loop.Run();
}

bool VrpFlagsAsyncWaiter::WriteAttempted(
    uint64_t location) {
  bool async_wait_result;
  WriteAttempted(std::move(location),&async_wait_result);
  return async_wait_result;
}

void VrpFlagsAsyncWaiter::GetReadPrefix(
    ::base::UnguessableToken* out_prefix) {
  base::RunLoop loop;
  proxy_->GetReadPrefix(
      base::BindOnce(
          [](base::RunLoop* loop,
             ::base::UnguessableToken* out_prefix
,
             const ::base::UnguessableToken& prefix) {*out_prefix = std::move(prefix);
            loop->Quit();
          },
          &loop,
          out_prefix));
  loop.Run();
}

::base::UnguessableToken VrpFlagsAsyncWaiter::GetReadPrefix(
    ) {
  ::base::UnguessableToken async_wait_result;
  GetReadPrefix(&async_wait_result);
  return async_wait_result;
}

void VrpFlagsAsyncWaiter::ReadAttempted(
    const ::base::UnguessableToken& flag, bool* out_success) {
  base::RunLoop loop;
  proxy_->ReadAttempted(
      std::move(flag),
      base::BindOnce(
          [](base::RunLoop* loop,
             bool* out_success
,
             bool success) {*out_success = std::move(success);
            loop->Quit();
          },
          &loop,
          out_success));
  loop.Run();
}

bool VrpFlagsAsyncWaiter::ReadAttempted(
    const ::base::UnguessableToken& flag) {
  bool async_wait_result;
  ReadAttempted(std::move(flag),&async_wait_result);
  return async_wait_result;
}




void VrpFlagsFactoryInterceptorForTesting::BindBrowserVrpFlags(::mojo::PendingReceiver<VrpFlags> receiver) {
  GetForwardingInterface()->BindBrowserVrpFlags(
    std::move(receiver)
    );
}
void VrpFlagsFactoryInterceptorForTesting::BindNetworkVrpFlags(::mojo::PendingReceiver<VrpFlags> receiver) {
  GetForwardingInterface()->BindNetworkVrpFlags(
    std::move(receiver)
    );
}
void VrpFlagsFactoryInterceptorForTesting::BindGpuVrpFlags(::mojo::PendingReceiver<VrpFlags> receiver) {
  GetForwardingInterface()->BindGpuVrpFlags(
    std::move(receiver)
    );
}
void VrpFlagsFactoryInterceptorForTesting::StartRendererForVrpFlags(VictimDisposition disposition, ::mojo::PendingReceiver<VrpFlags> receiver, StartRendererForVrpFlagsCallback callback) {
  GetForwardingInterface()->StartRendererForVrpFlags(
    std::move(disposition)
    , 
    std::move(receiver)
    , std::move(callback));
}
VrpFlagsFactoryAsyncWaiter::VrpFlagsFactoryAsyncWaiter(
    VrpFlagsFactory* proxy) : proxy_(proxy) {}

VrpFlagsFactoryAsyncWaiter::~VrpFlagsFactoryAsyncWaiter() = default;


void VrpFlagsFactoryAsyncWaiter::StartRendererForVrpFlags(
    VictimDisposition disposition, ::mojo::PendingReceiver<VrpFlags> receiver, uint16_t* out_port) {
  base::RunLoop loop;
  proxy_->StartRendererForVrpFlags(
      std::move(disposition),
      std::move(receiver),
      base::BindOnce(
          [](base::RunLoop* loop,
             uint16_t* out_port
,
             uint16_t port) {*out_port = std::move(port);
            loop->Quit();
          },
          &loop,
          out_port));
  loop.Run();
}

uint16_t VrpFlagsFactoryAsyncWaiter::StartRendererForVrpFlags(
    VictimDisposition disposition, ::mojo::PendingReceiver<VrpFlags> receiver) {
  uint16_t async_wait_result;
  StartRendererForVrpFlags(std::move(disposition),std::move(receiver),&async_wait_result);
  return async_wait_result;
}






}  // vrp_flags::mojom


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