| // services/network/public/mojom/address_list.mojom-shared.cc is auto generated by mojom_bindings_generator.py, do not edit |
| |
| // Copyright 2016 The Chromium Authors. All rights reserved. |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| |
| #include "services/network/public/mojom/address_list.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 "services/network/public/mojom/address_list.mojom-params-data.h" |
| namespace network { |
| namespace mojom { |
| |
| namespace internal { |
| |
| |
| // static |
| bool AddressList_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 AddressList_Data* object = |
| static_cast<const AddressList_Data*>(data); |
| |
| if (!mojo::internal::ValidatePointerNonNullable( |
| object->addresses, 1, validation_context)) { |
| return false; |
| } |
| const mojo::internal::ContainerValidateParams addresses_validate_params( |
| 0, false, nullptr); |
| if (!mojo::internal::ValidateContainer(object->addresses, validation_context, |
| &addresses_validate_params)) { |
| return false; |
| } |
| |
| if (!mojo::internal::ValidatePointerNonNullable( |
| object->dns_aliases, 2, validation_context)) { |
| return false; |
| } |
| const mojo::internal::ContainerValidateParams dns_aliases_validate_params( |
| 0, false, new mojo::internal::ContainerValidateParams(0, false, nullptr)); |
| if (!mojo::internal::ValidateContainer(object->dns_aliases, validation_context, |
| &dns_aliases_validate_params)) { |
| return false; |
| } |
| |
| return true; |
| } |
| |
| AddressList_Data::AddressList_Data() |
| : header_({sizeof(*this), 0}) {} |
| |
| } // namespace internal |
| } // namespace mojom |
| } // namespace network |