// third_party/blink/public/mojom/manifest/manifest_launch_handler.mojom-send-validation.h is auto generated by mojom_bindings_generator.py, do not edit

// Copyright 2025 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef THIRD_PARTY_BLINK_PUBLIC_MOJOM_MANIFEST_MANIFEST_LAUNCH_HANDLER_MOJOM_SEND_VALIDATION_H_
#define THIRD_PARTY_BLINK_PUBLIC_MOJOM_MANIFEST_MANIFEST_LAUNCH_HANDLER_MOJOM_SEND_VALIDATION_H_

#include "third_party/blink/public/mojom/manifest/manifest_launch_handler.mojom-shared-internal.h"

#include "third_party/blink/public/mojom/manifest/manifest_launch_handler.mojom-data-view.h"

#include "mojo/public/cpp/bindings/lib/send_validation_type.h"
#include "mojo/public/cpp/bindings/lib/send_validation.h"

namespace mojo::internal {

template <typename MaybeConstUserType, mojo::internal::SendValidation send_validation>
struct SendValidationSerializer<::blink::mojom::ManifestLaunchHandlerDataView, MaybeConstUserType, send_validation> {
  using UserType = typename std::remove_const<MaybeConstUserType>::type;
  using Traits = StructTraits<::blink::mojom::ManifestLaunchHandlerDataView, UserType>;
  static void Serialize(
      MaybeConstUserType& input,
      mojo::internal::MessageFragment<::blink::mojom::internal::ManifestLaunchHandler_Data>& fragment) {
    if (CallIsNullIfExists<Traits>(input))
      return;
    fragment.Allocate();
      fragment->client_mode_$flag = Traits::client_mode(input).has_value();
      if (Traits::client_mode(input).has_value()) {
        
        mojo::internal::Serialize<::blink::mojom::ManifestLaunchHandler_ClientMode>(
          Traits::client_mode(input).value(),
          &fragment->client_mode_$value);
      } else {
        fragment->client_mode_$value =
            static_cast<int32_t>(::blink::mojom::ManifestLaunchHandler_ClientMode::kMinValue);
      }
  }
};

}  // namespace mojo::internal

#endif  // THIRD_PARTY_BLINK_PUBLIC_MOJOM_MANIFEST_MANIFEST_LAUNCH_HANDLER_MOJOM_SEND_VALIDATION_H_