// third_party/blink/public/mojom/navigation/renderer_content_settings.mojom.cc is auto generated by mojom_bindings_generator.py, do not edit

// Copyright 2013 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#if defined(__clang__)
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wunused-private-field"
#endif

#include "third_party/blink/public/mojom/navigation/renderer_content_settings.mojom.h"
#include <stdint.h>
#include <utility>
#include "mojo/public/cpp/bindings/lib/default_construct_tag_internal.h"
#include "mojo/public/cpp/bindings/lib/serialization.h"
#include "mojo/public/cpp/bindings/lib/validate_params.h"
#include "mojo/public/cpp/bindings/lib/validation_errors.h"
#include "mojo/public/cpp/bindings/mojo_buildflags.h"
#include "third_party/perfetto/include/perfetto/tracing/traced_value.h"

#include "third_party/blink/public/mojom/navigation/renderer_content_settings.mojom-params-data.h"
#include "third_party/blink/public/mojom/navigation/renderer_content_settings.mojom-shared-message-ids.h"

#include "third_party/blink/public/mojom/navigation/renderer_content_settings.mojom-import-headers.h"
#include "third_party/blink/public/mojom/navigation/renderer_content_settings.mojom-test-utils.h"


namespace blink::mojom {
RendererContentSettings::RendererContentSettings()
    : allow_script(),
      allow_image(),
      allow_popup(),
      allow_mixed_content(),
      allow_controlled_frame() {}

RendererContentSettings::RendererContentSettings(
    bool allow_script_in,
    bool allow_image_in,
    bool allow_popup_in,
    bool allow_mixed_content_in,
    bool allow_controlled_frame_in)
    : allow_script(std::move(allow_script_in)),
      allow_image(std::move(allow_image_in)),
      allow_popup(std::move(allow_popup_in)),
      allow_mixed_content(std::move(allow_mixed_content_in)),
      allow_controlled_frame(std::move(allow_controlled_frame_in)) {}

RendererContentSettings::~RendererContentSettings() = default;
size_t RendererContentSettings::Hash(size_t seed) const {
  seed = mojo::internal::Hash(seed, this->allow_script);
  seed = mojo::internal::Hash(seed, this->allow_image);
  seed = mojo::internal::Hash(seed, this->allow_popup);
  seed = mojo::internal::Hash(seed, this->allow_mixed_content);
  seed = mojo::internal::Hash(seed, this->allow_controlled_frame);
  return seed;
}

void RendererContentSettings::WriteIntoTrace(
    perfetto::TracedValue traced_context) const {
  [[maybe_unused]] auto dict = std::move(traced_context).WriteDictionary();
  perfetto::WriteIntoTracedValueWithFallback(
    dict.AddItem(
      "allow_script"), this->allow_script,
#if BUILDFLAG(MOJO_TRACE_ENABLED)
      "<value of type bool>"
#else
      "<value>"
#endif  // BUILDFLAG(MOJO_TRACE_ENABLED)
    );
  perfetto::WriteIntoTracedValueWithFallback(
    dict.AddItem(
      "allow_image"), this->allow_image,
#if BUILDFLAG(MOJO_TRACE_ENABLED)
      "<value of type bool>"
#else
      "<value>"
#endif  // BUILDFLAG(MOJO_TRACE_ENABLED)
    );
  perfetto::WriteIntoTracedValueWithFallback(
    dict.AddItem(
      "allow_popup"), this->allow_popup,
#if BUILDFLAG(MOJO_TRACE_ENABLED)
      "<value of type bool>"
#else
      "<value>"
#endif  // BUILDFLAG(MOJO_TRACE_ENABLED)
    );
  perfetto::WriteIntoTracedValueWithFallback(
    dict.AddItem(
      "allow_mixed_content"), this->allow_mixed_content,
#if BUILDFLAG(MOJO_TRACE_ENABLED)
      "<value of type bool>"
#else
      "<value>"
#endif  // BUILDFLAG(MOJO_TRACE_ENABLED)
    );
  perfetto::WriteIntoTracedValueWithFallback(
    dict.AddItem(
      "allow_controlled_frame"), this->allow_controlled_frame,
#if BUILDFLAG(MOJO_TRACE_ENABLED)
      "<value of type bool>"
#else
      "<value>"
#endif  // BUILDFLAG(MOJO_TRACE_ENABLED)
    );
}

bool RendererContentSettings::Validate(
    const void* data,
    mojo::internal::ValidationContext* validation_context) {
  return Data_::Validate(data, validation_context);
}


}  // blink::mojom


namespace mojo {


// static
bool StructTraits<::blink::mojom::RendererContentSettings::DataView, ::blink::mojom::RendererContentSettingsPtr>::Read(
    ::blink::mojom::RendererContentSettings::DataView input,
    ::blink::mojom::RendererContentSettingsPtr* output) {
  bool success = true;
  ::blink::mojom::RendererContentSettingsPtr result(::blink::mojom::RendererContentSettings::New());
  
      if (success)
        result->allow_script = input.allow_script();
      if (success)
        result->allow_image = input.allow_image();
      if (success)
        result->allow_popup = input.allow_popup();
      if (success)
        result->allow_mixed_content = input.allow_mixed_content();
      if (success)
        result->allow_controlled_frame = input.allow_controlled_frame();
  *output = std::move(result);
  return success;
}

}  // namespace mojo


// Symbols declared in the -test-utils.h header are defined here instead of a
// separate .cc file to save compile time.


namespace blink::mojom {




}  // blink::mojom


#if defined(__clang__)
#pragma clang diagnostic pop
#endif