// services/viz/public/mojom/compositing/frame_sink_bundle.mojom-shared-internal.h is auto generated by mojom_bindings_generator.py, do not edit

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

#ifndef SERVICES_VIZ_PUBLIC_MOJOM_COMPOSITING_FRAME_SINK_BUNDLE_MOJOM_SHARED_INTERNAL_H_
#define SERVICES_VIZ_PUBLIC_MOJOM_COMPOSITING_FRAME_SINK_BUNDLE_MOJOM_SHARED_INTERNAL_H_
#include "mojo/public/cpp/bindings/lib/array_internal.h"
#include "mojo/public/cpp/bindings/lib/bindings_internal.h"
#include "mojo/public/cpp/bindings/lib/map_data_internal.h"
#include "mojo/public/cpp/bindings/lib/message_fragment.h"
#include "mojo/public/c/system/macros.h"
#include "mojo/public/mojom/base/shared_memory.mojom-shared-internal.h"
#include "services/viz/public/mojom/compositing/begin_frame_args.mojom-shared-internal.h"
#include "services/viz/public/mojom/compositing/compositor_frame.mojom-shared-internal.h"
#include "services/viz/public/mojom/compositing/compositor_frame_sink.mojom-shared-internal.h"
#include "services/viz/public/mojom/compositing/local_surface_id.mojom-shared-internal.h"
#include "services/viz/public/mojom/compositing/frame_timing_details.mojom-shared-internal.h"
#include "services/viz/public/mojom/compositing/returned_resource.mojom-shared-internal.h"
#include "services/viz/public/mojom/compositing/thread.mojom-shared-internal.h"
#include "services/viz/public/mojom/hit_test/hit_test_region_list.mojom-shared-internal.h"
#include "mojo/public/cpp/bindings/lib/native_enum_data.h"
#include "mojo/public/interfaces/bindings/native_struct.mojom-shared-internal.h"



namespace mojo {
namespace internal {
class ValidationContext;
}
}


namespace viz::mojom {
namespace internal {
class BundledFrameSubmission_Data;
class BundledCompositorFrame_Data;
class BundledReturnedResources_Data;
class BeginFrameInfo_Data;
class BundledFrameSubmissionData_Data;

#pragma pack(push, 1)


class  BundledFrameSubmissionData_Data {
 public:
  // Used to identify Mojom Union Data Classes.
  typedef void MojomUnionDataType;

  BundledFrameSubmissionData_Data() = default;
  // Do nothing in the destructor since it won't be called when it is a
  // non-inlined union.
  ~BundledFrameSubmissionData_Data() = default;

  static bool Validate(const void* data,
                       mojo::internal::ValidationContext* validation_context,
                       bool inlined);

  bool is_null() const { return size == 0; }

  void set_null() {
    size = 0U;
    tag = static_cast<BundledFrameSubmissionData_Tag>(0);
    data.unknown = 0U;
  }

  // TODO(crbug.com/40731316): SHOUTY_CASE values are being deprecated per C++ code style
  // guidelines (https://google.github.io/styleguide/cppguide.html#Enumerator_Names),
  // please use kCamelCase values instead.  Cleanup NULL_VALUE, BOOL_VALUE, INT_VALUE, etc.
  // generation once codebase is transitioned to kNullValue, kBoolValue, kIntValue, etc.
  enum class BundledFrameSubmissionData_Tag : uint32_t {

    
    kFrame,
    
    kDidNotProduceFrame,
  };

  // A note on layout:
  // "Each non-static data member is allocated as if it were the sole member of
  // a struct." - Section 9.5.2 ISO/IEC 14882:2011 (The C++ Spec)
  union MOJO_ALIGNAS(8) Union_ {
    Union_() : unknown(0) {}
    mojo::internal::Pointer<internal::BundledCompositorFrame_Data> f_frame;
    mojo::internal::Pointer<::viz::mojom::internal::BeginFrameAck_Data> f_did_not_produce_frame;
    uint64_t unknown;
  };

  uint32_t size;
  BundledFrameSubmissionData_Tag tag;
  Union_ data;
};
static_assert(sizeof(BundledFrameSubmissionData_Data) == mojo::internal::kUnionDataSize,
              "Bad sizeof(BundledFrameSubmissionData_Data)");
class  BundledFrameSubmission_Data {
 public:
  static bool Validate(const void* data,
                       mojo::internal::ValidationContext* validation_context);

  mojo::internal::StructHeader header_;
  uint32_t sink_id;
  uint8_t pad0_[4];
  internal::BundledFrameSubmissionData_Data data;

 private:
  friend class mojo::internal::MessageFragment<BundledFrameSubmission_Data>;

  BundledFrameSubmission_Data();
  ~BundledFrameSubmission_Data() = delete;
};
static_assert(sizeof(BundledFrameSubmission_Data) == 32,
              "Bad sizeof(BundledFrameSubmission_Data)");
// Used by BundledFrameSubmission::WrapAsMessage to lazily serialize the struct.
template <typename UserType, typename DataView>
struct BundledFrameSubmission_UnserializedMessageContext
    : public mojo::internal::UnserializedMessageContext {
 public:
  static const mojo::internal::UnserializedMessageContext::Tag kMessageTag;

  BundledFrameSubmission_UnserializedMessageContext(
    uint32_t message_name,
    uint32_t message_flags,
    UserType input)
      : mojo::internal::UnserializedMessageContext(&kMessageTag, message_name, message_flags)
      , user_data_(std::move(input)) {}
  ~BundledFrameSubmission_UnserializedMessageContext() override = default;

  UserType TakeData() {
    return std::move(user_data_);
  }

 private:
  // mojo::internal::UnserializedMessageContext:
  void Serialize(mojo::Message& message) override {
    mojo::internal::MessageFragment<BundledFrameSubmission_Data> fragment(message);
    mojo::internal::Serialize<DataView>(user_data_, fragment);
  }

  UserType user_data_;
};

template <typename UserType, typename DataView>
const mojo::internal::UnserializedMessageContext::Tag
    BundledFrameSubmission_UnserializedMessageContext<UserType, DataView>::kMessageTag = {};
class  BundledCompositorFrame_Data {
 public:
  static bool Validate(const void* data,
                       mojo::internal::ValidationContext* validation_context);

  mojo::internal::StructHeader header_;
  mojo::internal::Pointer<::viz::mojom::internal::LocalSurfaceId_Data> local_surface_id;
  mojo::internal::Pointer<::viz::mojom::internal::CompositorFrame_Data> frame;
  mojo::internal::Pointer<::viz::mojom::internal::HitTestRegionList_Data> hit_test_region_list;
  uint64_t submit_time;

 private:
  friend class mojo::internal::MessageFragment<BundledCompositorFrame_Data>;

  BundledCompositorFrame_Data();
  ~BundledCompositorFrame_Data() = delete;
};
static_assert(sizeof(BundledCompositorFrame_Data) == 40,
              "Bad sizeof(BundledCompositorFrame_Data)");
// Used by BundledCompositorFrame::WrapAsMessage to lazily serialize the struct.
template <typename UserType, typename DataView>
struct BundledCompositorFrame_UnserializedMessageContext
    : public mojo::internal::UnserializedMessageContext {
 public:
  static const mojo::internal::UnserializedMessageContext::Tag kMessageTag;

  BundledCompositorFrame_UnserializedMessageContext(
    uint32_t message_name,
    uint32_t message_flags,
    UserType input)
      : mojo::internal::UnserializedMessageContext(&kMessageTag, message_name, message_flags)
      , user_data_(std::move(input)) {}
  ~BundledCompositorFrame_UnserializedMessageContext() override = default;

  UserType TakeData() {
    return std::move(user_data_);
  }

 private:
  // mojo::internal::UnserializedMessageContext:
  void Serialize(mojo::Message& message) override {
    mojo::internal::MessageFragment<BundledCompositorFrame_Data> fragment(message);
    mojo::internal::Serialize<DataView>(user_data_, fragment);
  }

  UserType user_data_;
};

template <typename UserType, typename DataView>
const mojo::internal::UnserializedMessageContext::Tag
    BundledCompositorFrame_UnserializedMessageContext<UserType, DataView>::kMessageTag = {};
class  BundledReturnedResources_Data {
 public:
  static bool Validate(const void* data,
                       mojo::internal::ValidationContext* validation_context);

  mojo::internal::StructHeader header_;
  uint32_t sink_id;
  uint8_t pad0_[4];
  mojo::internal::Pointer<mojo::internal::Array_Data<mojo::internal::Pointer<::viz::mojom::internal::ReturnedResource_Data>>> resources;

 private:
  friend class mojo::internal::MessageFragment<BundledReturnedResources_Data>;

  BundledReturnedResources_Data();
  ~BundledReturnedResources_Data() = delete;
};
static_assert(sizeof(BundledReturnedResources_Data) == 24,
              "Bad sizeof(BundledReturnedResources_Data)");
// Used by BundledReturnedResources::WrapAsMessage to lazily serialize the struct.
template <typename UserType, typename DataView>
struct BundledReturnedResources_UnserializedMessageContext
    : public mojo::internal::UnserializedMessageContext {
 public:
  static const mojo::internal::UnserializedMessageContext::Tag kMessageTag;

  BundledReturnedResources_UnserializedMessageContext(
    uint32_t message_name,
    uint32_t message_flags,
    UserType input)
      : mojo::internal::UnserializedMessageContext(&kMessageTag, message_name, message_flags)
      , user_data_(std::move(input)) {}
  ~BundledReturnedResources_UnserializedMessageContext() override = default;

  UserType TakeData() {
    return std::move(user_data_);
  }

 private:
  // mojo::internal::UnserializedMessageContext:
  void Serialize(mojo::Message& message) override {
    mojo::internal::MessageFragment<BundledReturnedResources_Data> fragment(message);
    mojo::internal::Serialize<DataView>(user_data_, fragment);
  }

  UserType user_data_;
};

template <typename UserType, typename DataView>
const mojo::internal::UnserializedMessageContext::Tag
    BundledReturnedResources_UnserializedMessageContext<UserType, DataView>::kMessageTag = {};
class  BeginFrameInfo_Data {
 public:
  static bool Validate(const void* data,
                       mojo::internal::ValidationContext* validation_context);

  mojo::internal::StructHeader header_;
  uint32_t sink_id;
  uint8_t pad0_[4];
  mojo::internal::Pointer<::viz::mojom::internal::BeginFrameArgs_Data> args;
  mojo::internal::Pointer<mojo::internal::Map_Data<uint32_t, mojo::internal::Pointer<::viz::mojom::internal::FrameTimingDetails_Data>>> details;
  mojo::internal::Pointer<mojo::internal::Array_Data<mojo::internal::Pointer<::viz::mojom::internal::ReturnedResource_Data>>> resources;

 private:
  friend class mojo::internal::MessageFragment<BeginFrameInfo_Data>;

  BeginFrameInfo_Data();
  ~BeginFrameInfo_Data() = delete;
};
static_assert(sizeof(BeginFrameInfo_Data) == 40,
              "Bad sizeof(BeginFrameInfo_Data)");
// Used by BeginFrameInfo::WrapAsMessage to lazily serialize the struct.
template <typename UserType, typename DataView>
struct BeginFrameInfo_UnserializedMessageContext
    : public mojo::internal::UnserializedMessageContext {
 public:
  static const mojo::internal::UnserializedMessageContext::Tag kMessageTag;

  BeginFrameInfo_UnserializedMessageContext(
    uint32_t message_name,
    uint32_t message_flags,
    UserType input)
      : mojo::internal::UnserializedMessageContext(&kMessageTag, message_name, message_flags)
      , user_data_(std::move(input)) {}
  ~BeginFrameInfo_UnserializedMessageContext() override = default;

  UserType TakeData() {
    return std::move(user_data_);
  }

 private:
  // mojo::internal::UnserializedMessageContext:
  void Serialize(mojo::Message& message) override {
    mojo::internal::MessageFragment<BeginFrameInfo_Data> fragment(message);
    mojo::internal::Serialize<DataView>(user_data_, fragment);
  }

  UserType user_data_;
};

template <typename UserType, typename DataView>
const mojo::internal::UnserializedMessageContext::Tag
    BeginFrameInfo_UnserializedMessageContext<UserType, DataView>::kMessageTag = {};

#pragma pack(pop)

}  // namespace internal

}  // viz::mojom

#endif  // SERVICES_VIZ_PUBLIC_MOJOM_COMPOSITING_FRAME_SINK_BUNDLE_MOJOM_SHARED_INTERNAL_H_