// chrome/common/renderer_configuration.mojom-shared.h 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.

#ifndef CHROME_COMMON_RENDERER_CONFIGURATION_MOJOM_SHARED_H_
#define CHROME_COMMON_RENDERER_CONFIGURATION_MOJOM_SHARED_H_

#include <stdint.h>

#include <functional>
#include <iosfwd>
#include <type_traits>
#include <utility>
#include "mojo/public/cpp/bindings/array_data_view.h"
#include "mojo/public/cpp/bindings/map_data_view.h"
#include "mojo/public/cpp/bindings/string_data_view.h"
#include "mojo/public/cpp/system/message_pipe.h"

#include "third_party/perfetto/include/perfetto/tracing/traced_value_forward.h"

#include "chrome/common/renderer_configuration.mojom-shared-internal.h"
#include "components/content_settings/common/content_settings_manager.mojom-shared.h"
#include "components/content_settings/core/common/content_settings.mojom-shared.h"
#include "mojo/public/mojom/base/time.mojom-shared.h"
#include "url/mojom/url.mojom-shared.h"
#include "mojo/public/cpp/bindings/lib/interface_serialization.h"
#include "mojo/public/cpp/system/data_pipe.h"



#include "chrome/common/renderer_configuration.mojom-data-view.h"  // IWYU pragma: export




namespace std {

}  // namespace std

namespace mojo {


namespace internal {

template <typename MaybeConstUserType>
struct Serializer<::chrome::mojom::DynamicParamsDataView, MaybeConstUserType> {
  using UserType = typename std::remove_const<MaybeConstUserType>::type;
  using Traits = StructTraits<::chrome::mojom::DynamicParamsDataView, UserType>;

  static void Serialize(
      MaybeConstUserType& input,
      mojo::internal::MessageFragment<::chrome::mojom::internal::DynamicParams_Data>& fragment) {
    if (CallIsNullIfExists<Traits>(input))
      return;
    fragment.Allocate();

    fragment->force_safe_search = Traits::force_safe_search(input);

    fragment->youtube_restrict = Traits::youtube_restrict(input);

    decltype(Traits::allowed_domains_for_apps(input)) in_allowed_domains_for_apps = Traits::allowed_domains_for_apps(input);
    mojo::internal::MessageFragment<
        typename decltype(fragment->allowed_domains_for_apps)::BaseType> allowed_domains_for_apps_fragment(
            fragment.message());
    
    mojo::internal::Serialize<mojo::StringDataView>(
      in_allowed_domains_for_apps,
      allowed_domains_for_apps_fragment);

    fragment->allowed_domains_for_apps.Set(
        allowed_domains_for_apps_fragment.is_null() ? nullptr : allowed_domains_for_apps_fragment.data());

    
    MOJO_INTERNAL_CHECK_SERIALIZATION(
      mojo::internal::SendValidation::kDefault,
      !(fragment->allowed_domains_for_apps.is_null()),
      mojo::internal::VALIDATION_ERROR_UNEXPECTED_NULL_POINTER,
      "null allowed_domains_for_apps in DynamicParams struct");
  }

  static bool Deserialize(::chrome::mojom::internal::DynamicParams_Data* input,
                          UserType* output,
                          Message* message) {
    if (!input)
      return CallSetToNullIfExists<Traits>(output);

    ::chrome::mojom::DynamicParamsDataView data_view(input, message);
    return CallTraitsRead<Traits>(data_view, output);
  }
};

}  // namespace internal

}  // namespace mojo


namespace chrome::mojom {

inline void DynamicParamsDataView::GetAllowedDomainsForAppsDataView(
    mojo::StringDataView* output) {
  auto pointer = data_->allowed_domains_for_apps.Get();
  *output = mojo::StringDataView(pointer, message_);
}



}  // chrome::mojom

// Declare TraceFormatTraits for enums, which should be defined in ::perfetto
// namespace.

#endif  // CHROME_COMMON_RENDERER_CONFIGURATION_MOJOM_SHARED_H_