blob: 277efc69a9e3a0defc4d7826169251ee7b288fa8 [file] [log] [blame]
// content/common/web_ui.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 "content/common/web_ui.mojom-shared.h"
// Used to support stream output operator for enums.
// TODO(dcheng): Consider omitting this somehow if not needed.
#include <ostream>
#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 "content/common/web_ui.mojom-params-data.h"
namespace content {
namespace mojom {
namespace internal {
// static
bool WebUIHost_Send_Params_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 WebUIHost_Send_Params_Data* object =
static_cast<const WebUIHost_Send_Params_Data*>(data);
if (!mojo::internal::ValidatePointerNonNullable(
object->message, 1, validation_context)) {
return false;
}
constexpr const mojo::internal::ContainerValidateParams& message_validate_params =
mojo::internal::GetArrayValidator<0, false, nullptr>();
if (!mojo::internal::ValidateContainer(object->message, validation_context,
&message_validate_params)) {
return false;
}
if (!mojo::internal::ValidatePointerNonNullable(
object->args, 2, validation_context)) {
return false;
}
if (!mojo::internal::ValidateStruct(object->args, validation_context))
return false;
return true;
}
WebUIHost_Send_Params_Data::WebUIHost_Send_Params_Data()
: header_({sizeof(*this), 0}) {}
// static
bool WebUI_SetProperty_Params_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 WebUI_SetProperty_Params_Data* object =
static_cast<const WebUI_SetProperty_Params_Data*>(data);
if (!mojo::internal::ValidatePointerNonNullable(
object->property_name, 1, validation_context)) {
return false;
}
constexpr const mojo::internal::ContainerValidateParams& property_name_validate_params =
mojo::internal::GetArrayValidator<0, false, nullptr>();
if (!mojo::internal::ValidateContainer(object->property_name, validation_context,
&property_name_validate_params)) {
return false;
}
if (!mojo::internal::ValidatePointerNonNullable(
object->property_value_json, 2, validation_context)) {
return false;
}
constexpr const mojo::internal::ContainerValidateParams& property_value_json_validate_params =
mojo::internal::GetArrayValidator<0, false, nullptr>();
if (!mojo::internal::ValidateContainer(object->property_value_json, validation_context,
&property_value_json_validate_params)) {
return false;
}
return true;
}
WebUI_SetProperty_Params_Data::WebUI_SetProperty_Params_Data()
: header_({sizeof(*this), 0}) {}
} // namespace internal
} // namespace mojom
} // namespace content