// components/dom_distiller/content/common/mojom/distiller_javascript_service.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/dom_distiller/content/common/mojom/distiller_javascript_service.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/dom_distiller/content/common/mojom/distiller_javascript_service.mojom-params-data.h"
namespace dom_distiller {
namespace mojom {

namespace internal {


// static
bool DistillerJavaScriptService_HandleDistillerOpenSettingsCall_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 DistillerJavaScriptService_HandleDistillerOpenSettingsCall_Params_Data* object =
      static_cast<const DistillerJavaScriptService_HandleDistillerOpenSettingsCall_Params_Data*>(data);

  return true;
}

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


// static
bool DistillerJavaScriptService_HandleStoreThemePref_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 DistillerJavaScriptService_HandleStoreThemePref_Params_Data* object =
      static_cast<const DistillerJavaScriptService_HandleStoreThemePref_Params_Data*>(data);


  if (!::dom_distiller::mojom::internal::Theme_Data
        ::Validate(object->theme, validation_context))
    return false;

  return true;
}

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


// static
bool DistillerJavaScriptService_HandleStoreFontFamilyPref_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 DistillerJavaScriptService_HandleStoreFontFamilyPref_Params_Data* object =
      static_cast<const DistillerJavaScriptService_HandleStoreFontFamilyPref_Params_Data*>(data);


  if (!::dom_distiller::mojom::internal::FontFamily_Data
        ::Validate(object->font_family, validation_context))
    return false;

  return true;
}

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


// static
bool DistillerJavaScriptService_HandleStoreFontScalingPref_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 DistillerJavaScriptService_HandleStoreFontScalingPref_Params_Data* object =
      static_cast<const DistillerJavaScriptService_HandleStoreFontScalingPref_Params_Data*>(data);

  return true;
}

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

}  // namespace internal
}  // namespace mojom
}  // namespace dom_distiller