// components/services/storage/privileged/mojom/indexed_db_control.mojom-shared.cc 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.

#include "components/services/storage/privileged/mojom/indexed_db_control.mojom-shared.h"
#include <utility>
#include "mojo/public/cpp/bindings/lib/validate_params.h"
#include "mojo/public/cpp/bindings/lib/validation_errors.h"
#include "mojo/public/cpp/bindings/lib/validation_util.h"
#include "third_party/perfetto/include/perfetto/tracing/traced_value.h"

#include "components/services/storage/privileged/mojom/indexed_db_control.mojom-params-data.h"
namespace storage {
namespace mojom {

namespace internal {


// static
bool IndexedDBObserver_OnIndexedDBListChanged_Params_Data::Validate(
    const void* data,
    mojo::internal::ValidationContext* validation_context) {
  if (!data)
    return true;
  if (!ValidateUnversionedStructHeaderAndSizeAndClaimMemory(
          data, 16, validation_context)) {
    return false;
  }

  // NOTE: The memory backing |object| may be smaller than |sizeof(*object)| if
  // the message comes from an older version.
  [[maybe_unused]] const IndexedDBObserver_OnIndexedDBListChanged_Params_Data* object =
      static_cast<const IndexedDBObserver_OnIndexedDBListChanged_Params_Data*>(data);

  if (!mojo::internal::ValidatePointerNonNullable(
          object->bucket_locator, 1, validation_context)) {
    return false;
  }
  if (!mojo::internal::ValidateStruct(object->bucket_locator, validation_context))
    return false;

  return true;
}

IndexedDBObserver_OnIndexedDBListChanged_Params_Data::IndexedDBObserver_OnIndexedDBListChanged_Params_Data()
    : header_({sizeof(*this), 0}) {}


// static
bool IndexedDBObserver_OnIndexedDBContentChanged_Params_Data::Validate(
    const void* data,
    mojo::internal::ValidationContext* validation_context) {
  if (!data)
    return true;
  if (!ValidateUnversionedStructHeaderAndSizeAndClaimMemory(
          data, 32, validation_context)) {
    return false;
  }

  // NOTE: The memory backing |object| may be smaller than |sizeof(*object)| if
  // the message comes from an older version.
  [[maybe_unused]] const IndexedDBObserver_OnIndexedDBContentChanged_Params_Data* object =
      static_cast<const IndexedDBObserver_OnIndexedDBContentChanged_Params_Data*>(data);

  if (!mojo::internal::ValidatePointerNonNullable(
          object->bucket_locator, 1, validation_context)) {
    return false;
  }
  if (!mojo::internal::ValidateStruct(object->bucket_locator, validation_context))
    return false;

  if (!mojo::internal::ValidatePointerNonNullable(
          object->database_name, 2, validation_context)) {
    return false;
  }
  if (!mojo::internal::ValidateStruct(object->database_name, validation_context))
    return false;

  if (!mojo::internal::ValidatePointerNonNullable(
          object->object_store_name, 3, validation_context)) {
    return false;
  }
  if (!mojo::internal::ValidateStruct(object->object_store_name, validation_context))
    return false;

  return true;
}

IndexedDBObserver_OnIndexedDBContentChanged_Params_Data::IndexedDBObserver_OnIndexedDBContentChanged_Params_Data()
    : header_({sizeof(*this), 0}) {}


// static
bool IndexedDBControl_BindIndexedDB_Params_Data::Validate(
    const void* data,
    mojo::internal::ValidationContext* validation_context) {
  if (!data)
    return true;
  if (!ValidateUnversionedStructHeaderAndSizeAndClaimMemory(
          data, 40, validation_context)) {
    return false;
  }

  // NOTE: The memory backing |object| may be smaller than |sizeof(*object)| if
  // the message comes from an older version.
  [[maybe_unused]] const IndexedDBControl_BindIndexedDB_Params_Data* object =
      static_cast<const IndexedDBControl_BindIndexedDB_Params_Data*>(data);

  if (!mojo::internal::ValidatePointerNonNullable(
          object->bucket_locator, 1, validation_context)) {
    return false;
  }
  if (!mojo::internal::ValidateStruct(object->bucket_locator, validation_context))
    return false;

  if (!mojo::internal::ValidatePointerNonNullable(
          object->client_info, 2, validation_context)) {
    return false;
  }
  if (!mojo::internal::ValidateStruct(object->client_info, validation_context))
    return false;

  if (!mojo::internal::ValidateHandleOrInterfaceNonNullable(
          object->client_state_checker_remote, 3, validation_context)) {
    return false;
  }
  if (!mojo::internal::ValidateHandleOrInterface(object->client_state_checker_remote,
                                                 validation_context)) {
    return false;
  }

  if (!mojo::internal::ValidateHandleOrInterfaceNonNullable(
          object->receiver, 4, validation_context)) {
    return false;
  }
  if (!mojo::internal::ValidateHandleOrInterface(object->receiver,
                                                 validation_context)) {
    return false;
  }

  return true;
}

IndexedDBControl_BindIndexedDB_Params_Data::IndexedDBControl_BindIndexedDB_Params_Data()
    : header_({sizeof(*this), 0}) {}


// static
bool IndexedDBControl_ForceClose_Params_Data::Validate(
    const void* data,
    mojo::internal::ValidationContext* validation_context) {
  if (!data)
    return true;
  if (!ValidateUnversionedStructHeaderAndSizeAndClaimMemory(
          data, 16, validation_context)) {
    return false;
  }

  // NOTE: The memory backing |object| may be smaller than |sizeof(*object)| if
  // the message comes from an older version.
  [[maybe_unused]] const IndexedDBControl_ForceClose_Params_Data* object =
      static_cast<const IndexedDBControl_ForceClose_Params_Data*>(data);

  if (!mojo::internal::ValidatePointerNonNullable(
          object->bucket_id, 1, validation_context)) {
    return false;
  }
  if (!mojo::internal::ValidateStruct(object->bucket_id, validation_context))
    return false;

  return true;
}

IndexedDBControl_ForceClose_Params_Data::IndexedDBControl_ForceClose_Params_Data()
    : header_({sizeof(*this), 0}) {}


// static
bool IndexedDBControl_ForceClose_ResponseParams_Data::Validate(
    const void* data,
    mojo::internal::ValidationContext* validation_context) {
  if (!data)
    return true;
  if (!ValidateUnversionedStructHeaderAndSizeAndClaimMemory(
          data, 8, validation_context)) {
    return false;
  }

  // NOTE: The memory backing |object| may be smaller than |sizeof(*object)| if
  // the message comes from an older version.
  [[maybe_unused]] const IndexedDBControl_ForceClose_ResponseParams_Data* object =
      static_cast<const IndexedDBControl_ForceClose_ResponseParams_Data*>(data);

  return true;
}

IndexedDBControl_ForceClose_ResponseParams_Data::IndexedDBControl_ForceClose_ResponseParams_Data()
    : header_({sizeof(*this), 0}) {}


// static
bool IndexedDBControl_DownloadBucketData_Params_Data::Validate(
    const void* data,
    mojo::internal::ValidationContext* validation_context) {
  if (!data)
    return true;
  if (!ValidateUnversionedStructHeaderAndSizeAndClaimMemory(
          data, 16, validation_context)) {
    return false;
  }

  // NOTE: The memory backing |object| may be smaller than |sizeof(*object)| if
  // the message comes from an older version.
  [[maybe_unused]] const IndexedDBControl_DownloadBucketData_Params_Data* object =
      static_cast<const IndexedDBControl_DownloadBucketData_Params_Data*>(data);

  if (!mojo::internal::ValidatePointerNonNullable(
          object->bucket_id, 1, validation_context)) {
    return false;
  }
  if (!mojo::internal::ValidateStruct(object->bucket_id, validation_context))
    return false;

  return true;
}

IndexedDBControl_DownloadBucketData_Params_Data::IndexedDBControl_DownloadBucketData_Params_Data()
    : header_({sizeof(*this), 0}) {}


// static
bool IndexedDBControl_DownloadBucketData_ResponseParams_Data::Validate(
    const void* data,
    mojo::internal::ValidationContext* validation_context) {
  if (!data)
    return true;
  if (!ValidateUnversionedStructHeaderAndSizeAndClaimMemory(
          data, 32, validation_context)) {
    return false;
  }

  // NOTE: The memory backing |object| may be smaller than |sizeof(*object)| if
  // the message comes from an older version.
  [[maybe_unused]] const IndexedDBControl_DownloadBucketData_ResponseParams_Data* object =
      static_cast<const IndexedDBControl_DownloadBucketData_ResponseParams_Data*>(data);

  if (!mojo::internal::ValidatePointerNonNullable(
          object->temp_path, 2, validation_context)) {
    return false;
  }
  if (!mojo::internal::ValidateStruct(object->temp_path, validation_context))
    return false;

  if (!mojo::internal::ValidatePointerNonNullable(
          object->zip_path, 3, validation_context)) {
    return false;
  }
  if (!mojo::internal::ValidateStruct(object->zip_path, validation_context))
    return false;

  return true;
}

IndexedDBControl_DownloadBucketData_ResponseParams_Data::IndexedDBControl_DownloadBucketData_ResponseParams_Data()
    : header_({sizeof(*this), 0}) {}


// static
bool IndexedDBControl_GetAllBucketsDetails_Params_Data::Validate(
    const void* data,
    mojo::internal::ValidationContext* validation_context) {
  if (!data)
    return true;
  if (!ValidateUnversionedStructHeaderAndSizeAndClaimMemory(
          data, 8, validation_context)) {
    return false;
  }

  // NOTE: The memory backing |object| may be smaller than |sizeof(*object)| if
  // the message comes from an older version.
  [[maybe_unused]] const IndexedDBControl_GetAllBucketsDetails_Params_Data* object =
      static_cast<const IndexedDBControl_GetAllBucketsDetails_Params_Data*>(data);

  return true;
}

IndexedDBControl_GetAllBucketsDetails_Params_Data::IndexedDBControl_GetAllBucketsDetails_Params_Data()
    : header_({sizeof(*this), 0}) {}


// static
bool IndexedDBControl_GetAllBucketsDetails_ResponseParams_Data::Validate(
    const void* data,
    mojo::internal::ValidationContext* validation_context) {
  if (!data)
    return true;
  if (!ValidateUnversionedStructHeaderAndSizeAndClaimMemory(
          data, 24, validation_context)) {
    return false;
  }

  // NOTE: The memory backing |object| may be smaller than |sizeof(*object)| if
  // the message comes from an older version.
  [[maybe_unused]] const IndexedDBControl_GetAllBucketsDetails_ResponseParams_Data* object =
      static_cast<const IndexedDBControl_GetAllBucketsDetails_ResponseParams_Data*>(data);

  if (!mojo::internal::ValidatePointerNonNullable(
          object->details, 2, validation_context)) {
    return false;
  }
  constexpr const mojo::internal::ContainerValidateParams& details_validate_params =
      mojo::internal::GetArrayValidator<0, false, nullptr>();
  if (!mojo::internal::ValidateContainer(object->details, validation_context,
                                         &details_validate_params)) {
    return false;
  }

  return true;
}

IndexedDBControl_GetAllBucketsDetails_ResponseParams_Data::IndexedDBControl_GetAllBucketsDetails_ResponseParams_Data()
    : header_({sizeof(*this), 0}) {}


// static
bool IndexedDBControl_StartMetadataRecording_Params_Data::Validate(
    const void* data,
    mojo::internal::ValidationContext* validation_context) {
  if (!data)
    return true;
  if (!ValidateUnversionedStructHeaderAndSizeAndClaimMemory(
          data, 16, validation_context)) {
    return false;
  }

  // NOTE: The memory backing |object| may be smaller than |sizeof(*object)| if
  // the message comes from an older version.
  [[maybe_unused]] const IndexedDBControl_StartMetadataRecording_Params_Data* object =
      static_cast<const IndexedDBControl_StartMetadataRecording_Params_Data*>(data);

  if (!mojo::internal::ValidatePointerNonNullable(
          object->bucket_id, 1, validation_context)) {
    return false;
  }
  if (!mojo::internal::ValidateStruct(object->bucket_id, validation_context))
    return false;

  return true;
}

IndexedDBControl_StartMetadataRecording_Params_Data::IndexedDBControl_StartMetadataRecording_Params_Data()
    : header_({sizeof(*this), 0}) {}


// static
bool IndexedDBControl_StartMetadataRecording_ResponseParams_Data::Validate(
    const void* data,
    mojo::internal::ValidationContext* validation_context) {
  if (!data)
    return true;
  if (!ValidateUnversionedStructHeaderAndSizeAndClaimMemory(
          data, 8, validation_context)) {
    return false;
  }

  // NOTE: The memory backing |object| may be smaller than |sizeof(*object)| if
  // the message comes from an older version.
  [[maybe_unused]] const IndexedDBControl_StartMetadataRecording_ResponseParams_Data* object =
      static_cast<const IndexedDBControl_StartMetadataRecording_ResponseParams_Data*>(data);

  return true;
}

IndexedDBControl_StartMetadataRecording_ResponseParams_Data::IndexedDBControl_StartMetadataRecording_ResponseParams_Data()
    : header_({sizeof(*this), 0}) {}


// static
bool IndexedDBControl_StopMetadataRecording_Params_Data::Validate(
    const void* data,
    mojo::internal::ValidationContext* validation_context) {
  if (!data)
    return true;
  if (!ValidateUnversionedStructHeaderAndSizeAndClaimMemory(
          data, 16, validation_context)) {
    return false;
  }

  // NOTE: The memory backing |object| may be smaller than |sizeof(*object)| if
  // the message comes from an older version.
  [[maybe_unused]] const IndexedDBControl_StopMetadataRecording_Params_Data* object =
      static_cast<const IndexedDBControl_StopMetadataRecording_Params_Data*>(data);

  if (!mojo::internal::ValidatePointerNonNullable(
          object->bucket_id, 1, validation_context)) {
    return false;
  }
  if (!mojo::internal::ValidateStruct(object->bucket_id, validation_context))
    return false;

  return true;
}

IndexedDBControl_StopMetadataRecording_Params_Data::IndexedDBControl_StopMetadataRecording_Params_Data()
    : header_({sizeof(*this), 0}) {}


// static
bool IndexedDBControl_StopMetadataRecording_ResponseParams_Data::Validate(
    const void* data,
    mojo::internal::ValidationContext* validation_context) {
  if (!data)
    return true;
  if (!ValidateUnversionedStructHeaderAndSizeAndClaimMemory(
          data, 16, validation_context)) {
    return false;
  }

  // NOTE: The memory backing |object| may be smaller than |sizeof(*object)| if
  // the message comes from an older version.
  [[maybe_unused]] const IndexedDBControl_StopMetadataRecording_ResponseParams_Data* object =
      static_cast<const IndexedDBControl_StopMetadataRecording_ResponseParams_Data*>(data);

  if (!mojo::internal::ValidatePointerNonNullable(
          object->metadata, 1, validation_context)) {
    return false;
  }
  constexpr const mojo::internal::ContainerValidateParams& metadata_validate_params =
      mojo::internal::GetArrayValidator<0, false, nullptr>();
  if (!mojo::internal::ValidateContainer(object->metadata, validation_context,
                                         &metadata_validate_params)) {
    return false;
  }

  return true;
}

IndexedDBControl_StopMetadataRecording_ResponseParams_Data::IndexedDBControl_StopMetadataRecording_ResponseParams_Data()
    : header_({sizeof(*this), 0}) {}


// static
bool IndexedDBControl_SetForceKeepSessionState_Params_Data::Validate(
    const void* data,
    mojo::internal::ValidationContext* validation_context) {
  if (!data)
    return true;
  if (!ValidateUnversionedStructHeaderAndSizeAndClaimMemory(
          data, 8, validation_context)) {
    return false;
  }

  // NOTE: The memory backing |object| may be smaller than |sizeof(*object)| if
  // the message comes from an older version.
  [[maybe_unused]] const IndexedDBControl_SetForceKeepSessionState_Params_Data* object =
      static_cast<const IndexedDBControl_SetForceKeepSessionState_Params_Data*>(data);

  return true;
}

IndexedDBControl_SetForceKeepSessionState_Params_Data::IndexedDBControl_SetForceKeepSessionState_Params_Data()
    : header_({sizeof(*this), 0}) {}


// static
bool IndexedDBControl_AddObserver_Params_Data::Validate(
    const void* data,
    mojo::internal::ValidationContext* validation_context) {
  if (!data)
    return true;
  if (!ValidateUnversionedStructHeaderAndSizeAndClaimMemory(
          data, 16, validation_context)) {
    return false;
  }

  // NOTE: The memory backing |object| may be smaller than |sizeof(*object)| if
  // the message comes from an older version.
  [[maybe_unused]] const IndexedDBControl_AddObserver_Params_Data* object =
      static_cast<const IndexedDBControl_AddObserver_Params_Data*>(data);

  if (!mojo::internal::ValidateHandleOrInterfaceNonNullable(
          object->observer, 1, validation_context)) {
    return false;
  }
  if (!mojo::internal::ValidateHandleOrInterface(object->observer,
                                                 validation_context)) {
    return false;
  }

  return true;
}

IndexedDBControl_AddObserver_Params_Data::IndexedDBControl_AddObserver_Params_Data()
    : header_({sizeof(*this), 0}) {}


// static
bool IndexedDBControl_ApplyPolicyUpdates_Params_Data::Validate(
    const void* data,
    mojo::internal::ValidationContext* validation_context) {
  if (!data)
    return true;
  if (!ValidateUnversionedStructHeaderAndSizeAndClaimMemory(
          data, 16, validation_context)) {
    return false;
  }

  // NOTE: The memory backing |object| may be smaller than |sizeof(*object)| if
  // the message comes from an older version.
  [[maybe_unused]] const IndexedDBControl_ApplyPolicyUpdates_Params_Data* object =
      static_cast<const IndexedDBControl_ApplyPolicyUpdates_Params_Data*>(data);

  if (!mojo::internal::ValidatePointerNonNullable(
          object->policy_updates, 1, validation_context)) {
    return false;
  }
  constexpr const mojo::internal::ContainerValidateParams& policy_updates_validate_params =
      mojo::internal::GetArrayValidator<0, false, nullptr>();
  if (!mojo::internal::ValidateContainer(object->policy_updates, validation_context,
                                         &policy_updates_validate_params)) {
    return false;
  }

  return true;
}

IndexedDBControl_ApplyPolicyUpdates_Params_Data::IndexedDBControl_ApplyPolicyUpdates_Params_Data()
    : header_({sizeof(*this), 0}) {}


// static
bool IndexedDBControl_BindTestInterfaceForTesting_Params_Data::Validate(
    const void* data,
    mojo::internal::ValidationContext* validation_context) {
  if (!data)
    return true;
  if (!ValidateUnversionedStructHeaderAndSizeAndClaimMemory(
          data, 16, validation_context)) {
    return false;
  }

  // NOTE: The memory backing |object| may be smaller than |sizeof(*object)| if
  // the message comes from an older version.
  [[maybe_unused]] const IndexedDBControl_BindTestInterfaceForTesting_Params_Data* object =
      static_cast<const IndexedDBControl_BindTestInterfaceForTesting_Params_Data*>(data);

  if (!mojo::internal::ValidateHandleOrInterfaceNonNullable(
          object->receiver, 1, validation_context)) {
    return false;
  }
  if (!mojo::internal::ValidateHandleOrInterface(object->receiver,
                                                 validation_context)) {
    return false;
  }

  return true;
}

IndexedDBControl_BindTestInterfaceForTesting_Params_Data::IndexedDBControl_BindTestInterfaceForTesting_Params_Data()
    : header_({sizeof(*this), 0}) {}

}  // namespace internal
}  // namespace mojom
}  // namespace storage