blob: d96bafc9c5e4ff627f92485575cc836128e7d291 [file] [log] [blame]
// content/shell/common/shell_controller.test-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/shell/common/shell_controller.test-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/shell/common/shell_controller.test-mojom-params-data.h"
namespace content {
namespace mojom {
namespace internal {
// static
bool ShellController_GetSwitchValue_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 ShellController_GetSwitchValue_Params_Data* object =
static_cast<const ShellController_GetSwitchValue_Params_Data*>(data);
if (!mojo::internal::ValidatePointerNonNullable(
object->name, 1, validation_context)) {
return false;
}
constexpr const mojo::internal::ContainerValidateParams& name_validate_params =
mojo::internal::GetArrayValidator<0, false, nullptr>();
if (!mojo::internal::ValidateContainer(object->name, validation_context,
&name_validate_params)) {
return false;
}
return true;
}
ShellController_GetSwitchValue_Params_Data::ShellController_GetSwitchValue_Params_Data()
: header_({sizeof(*this), 0}) {}
// static
bool ShellController_GetSwitchValue_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 ShellController_GetSwitchValue_ResponseParams_Data* object =
static_cast<const ShellController_GetSwitchValue_ResponseParams_Data*>(data);
constexpr const mojo::internal::ContainerValidateParams& value_validate_params =
mojo::internal::GetArrayValidator<0, false, nullptr>();
if (!mojo::internal::ValidateContainer(object->value, validation_context,
&value_validate_params)) {
return false;
}
return true;
}
ShellController_GetSwitchValue_ResponseParams_Data::ShellController_GetSwitchValue_ResponseParams_Data()
: header_({sizeof(*this), 0}) {}
// static
bool ShellController_ExecuteJavaScript_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 ShellController_ExecuteJavaScript_Params_Data* object =
static_cast<const ShellController_ExecuteJavaScript_Params_Data*>(data);
if (!mojo::internal::ValidatePointerNonNullable(
object->script, 1, validation_context)) {
return false;
}
if (!mojo::internal::ValidateStruct(object->script, validation_context))
return false;
return true;
}
ShellController_ExecuteJavaScript_Params_Data::ShellController_ExecuteJavaScript_Params_Data()
: header_({sizeof(*this), 0}) {}
// static
bool ShellController_ExecuteJavaScript_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 ShellController_ExecuteJavaScript_ResponseParams_Data* object =
static_cast<const ShellController_ExecuteJavaScript_ResponseParams_Data*>(data);
if (!mojo::internal::ValidateInlinedUnionNonNullable(
object->value, 1, validation_context)) {
return false;
}
if (!mojo::internal::ValidateInlinedUnion(object->value, validation_context))
return false;
return true;
}
ShellController_ExecuteJavaScript_ResponseParams_Data::ShellController_ExecuteJavaScript_ResponseParams_Data()
: header_({sizeof(*this), 0}) {}
// static
bool ShellController_ShutDown_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 ShellController_ShutDown_Params_Data* object =
static_cast<const ShellController_ShutDown_Params_Data*>(data);
return true;
}
ShellController_ShutDown_Params_Data::ShellController_ShutDown_Params_Data()
: header_({sizeof(*this), 0}) {}
} // namespace internal
} // namespace mojom
} // namespace content