blob: b28b44ba44f45a80db0ed2d0f36e833d4233155c [file] [log] [blame]
// third_party/blink/public/mojom/script_source_location.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 "third_party/blink/public/mojom/script_source_location.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 "base/strings/stringprintf.h"
#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 "third_party/blink/public/mojom/script_source_location.mojom-params-data.h"
namespace blink {
namespace mojom {
namespace internal {
// static
bool ScriptSourceLocation_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 ScriptSourceLocation_Data* object =
static_cast<const ScriptSourceLocation_Data*>(data);
if (!mojo::internal::ValidatePointerNonNullable(
object->url, 1, validation_context)) {
return false;
}
if (!mojo::internal::ValidateStruct(object->url, validation_context))
return false;
if (!mojo::internal::ValidatePointerNonNullable(
object->function_name, 2, validation_context)) {
return false;
}
constexpr const mojo::internal::ContainerValidateParams& function_name_validate_params =
mojo::internal::GetArrayValidator<0, false, nullptr>();
if (!mojo::internal::ValidateContainer(object->function_name, validation_context,
&function_name_validate_params)) {
return false;
}
return true;
}
ScriptSourceLocation_Data::ScriptSourceLocation_Data()
: header_({sizeof(*this), 0}) {}
} // namespace internal
} // namespace mojom
} // namespace blink