// components/policy/resources/webui/mojom/policy.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 "components/policy/resources/webui/mojom/policy.mojom.h"
#include <math.h>
#include <stdint.h>
#include <utility>
#include "base/debug/alias.h"
#include "base/notreached.h"
#include "base/run_loop.h"
#include "base/strings/string_number_conversions.h"
#include "base/task/thread_pool/thread_pool_instance.h"
#include "base/trace_event/trace_event.h"
#include "base/trace_event/typed_macros.h"
#include "mojo/public/cpp/bindings/lib/default_construct_tag_internal.h"
#include "mojo/public/cpp/bindings/lib/generated_code_util.h"
#include "mojo/public/cpp/bindings/lib/message_internal.h"
#include "mojo/public/cpp/bindings/lib/proxy_to_responder.h"
#include "mojo/public/cpp/bindings/lib/send_message_helper.h"
#include "mojo/public/cpp/bindings/lib/serialization.h"
#include "mojo/public/cpp/bindings/lib/unserialized_message_context.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 "mojo/public/cpp/bindings/urgent_message_scope.h"
#include "mojo/public/interfaces/bindings/interface_control_messages.mojom.h"
#include "third_party/perfetto/include/perfetto/tracing/traced_value.h"

#include "components/policy/resources/webui/mojom/policy.mojom-params-data.h"
#include "components/policy/resources/webui/mojom/policy.mojom-shared-message-ids.h"

#include "components/policy/resources/webui/mojom/policy.mojom-import-headers.h"
#include "components/policy/resources/webui/mojom/policy.mojom-test-utils.h"


namespace policy::mojom {
Log::Log()
    : message(),
      log_severity(),
      log_source(),
      file_and_line(),
      location(),
      timestamp() {}

Log::Log(
    const std::string& message_in,
    const std::string& log_severity_in,
    const std::string& log_source_in,
    const std::string& file_and_line_in,
    const std::string& location_in,
    const std::string& timestamp_in)
    : message(std::move(message_in)),
      log_severity(std::move(log_severity_in)),
      log_source(std::move(log_source_in)),
      file_and_line(std::move(file_and_line_in)),
      location(std::move(location_in)),
      timestamp(std::move(timestamp_in)) {}

Log::~Log() = default;
size_t Log::Hash(size_t seed) const {
  seed = mojo::internal::Hash(seed, this->message);
  seed = mojo::internal::Hash(seed, this->log_severity);
  seed = mojo::internal::Hash(seed, this->log_source);
  seed = mojo::internal::Hash(seed, this->file_and_line);
  seed = mojo::internal::Hash(seed, this->location);
  seed = mojo::internal::Hash(seed, this->timestamp);
  return seed;
}

void Log::WriteIntoTrace(
    perfetto::TracedValue traced_context) const {
  [[maybe_unused]] auto dict = std::move(traced_context).WriteDictionary();
  perfetto::WriteIntoTracedValueWithFallback(
    dict.AddItem(
      "message"), this->message,
#if BUILDFLAG(MOJO_TRACE_ENABLED)
      "<value of type const std::string&>"
#else
      "<value>"
#endif  // BUILDFLAG(MOJO_TRACE_ENABLED)
    );
  perfetto::WriteIntoTracedValueWithFallback(
    dict.AddItem(
      "log_severity"), this->log_severity,
#if BUILDFLAG(MOJO_TRACE_ENABLED)
      "<value of type const std::string&>"
#else
      "<value>"
#endif  // BUILDFLAG(MOJO_TRACE_ENABLED)
    );
  perfetto::WriteIntoTracedValueWithFallback(
    dict.AddItem(
      "log_source"), this->log_source,
#if BUILDFLAG(MOJO_TRACE_ENABLED)
      "<value of type const std::string&>"
#else
      "<value>"
#endif  // BUILDFLAG(MOJO_TRACE_ENABLED)
    );
  perfetto::WriteIntoTracedValueWithFallback(
    dict.AddItem(
      "file_and_line"), this->file_and_line,
#if BUILDFLAG(MOJO_TRACE_ENABLED)
      "<value of type const std::string&>"
#else
      "<value>"
#endif  // BUILDFLAG(MOJO_TRACE_ENABLED)
    );
  perfetto::WriteIntoTracedValueWithFallback(
    dict.AddItem(
      "location"), this->location,
#if BUILDFLAG(MOJO_TRACE_ENABLED)
      "<value of type const std::string&>"
#else
      "<value>"
#endif  // BUILDFLAG(MOJO_TRACE_ENABLED)
    );
  perfetto::WriteIntoTracedValueWithFallback(
    dict.AddItem(
      "timestamp"), this->timestamp,
#if BUILDFLAG(MOJO_TRACE_ENABLED)
      "<value of type const std::string&>"
#else
      "<value>"
#endif  // BUILDFLAG(MOJO_TRACE_ENABLED)
    );
}

bool Log::Validate(
    const void* data,
    mojo::internal::ValidationContext* validation_context) {
  return Data_::Validate(data, validation_context);
}
Status::Status()
    : policy_description_key(),
      flex_org_warning(),
      asset_id(),
      location(),
      directory_api_id(),
      client_id(),
      is_off_hours_active(),
      device_id(),
      enrollment_token(),
      domain(),
      machine(),
      version(),
      username(),
      gaia_id(),
      profile_id(),
      status(),
      extension_install_status(),
      refresh_interval(),
      time_since_last_refresh(),
      time_since_last_fetch_attempt(),
      extension_install_time_since_last_refresh(),
      extension_install_time_since_last_fetch_attempt(),
      last_cloud_report_sent_timestamp(),
      time_since_last_cloud_report_sent(),
      enterprise_domain_manager(),
      is_affiliated(),
      policies_push_available(),
      error(),
      extension_install_error() {}

Status::Status(
    const std::string& policy_description_key_in,
    bool flex_org_warning_in,
    const std::optional<std::string>& asset_id_in,
    const std::optional<std::string>& location_in,
    const std::optional<std::string>& directory_api_id_in,
    const std::string& client_id_in,
    std::optional<bool> is_off_hours_active_in,
    const std::string& device_id_in,
    const std::string& enrollment_token_in,
    const std::string& domain_in,
    const std::optional<std::string>& machine_in,
    const std::optional<std::string>& version_in,
    const std::optional<std::string>& username_in,
    const std::optional<std::string>& gaia_id_in,
    const std::optional<std::string>& profile_id_in,
    const std::string& status_in,
    const std::string& extension_install_status_in,
    const std::optional<std::string>& refresh_interval_in,
    const std::optional<std::string>& time_since_last_refresh_in,
    const std::optional<std::string>& time_since_last_fetch_attempt_in,
    const std::optional<std::string>& extension_install_time_since_last_refresh_in,
    const std::optional<std::string>& extension_install_time_since_last_fetch_attempt_in,
    const std::optional<std::string>& last_cloud_report_sent_timestamp_in,
    const std::optional<std::string>& time_since_last_cloud_report_sent_in,
    const std::optional<std::string>& enterprise_domain_manager_in,
    std::optional<bool> is_affiliated_in,
    bool policies_push_available_in,
    bool error_in,
    bool extension_install_error_in)
    : policy_description_key(std::move(policy_description_key_in)),
      flex_org_warning(std::move(flex_org_warning_in)),
      asset_id(std::move(asset_id_in)),
      location(std::move(location_in)),
      directory_api_id(std::move(directory_api_id_in)),
      client_id(std::move(client_id_in)),
      is_off_hours_active(std::move(is_off_hours_active_in)),
      device_id(std::move(device_id_in)),
      enrollment_token(std::move(enrollment_token_in)),
      domain(std::move(domain_in)),
      machine(std::move(machine_in)),
      version(std::move(version_in)),
      username(std::move(username_in)),
      gaia_id(std::move(gaia_id_in)),
      profile_id(std::move(profile_id_in)),
      status(std::move(status_in)),
      extension_install_status(std::move(extension_install_status_in)),
      refresh_interval(std::move(refresh_interval_in)),
      time_since_last_refresh(std::move(time_since_last_refresh_in)),
      time_since_last_fetch_attempt(std::move(time_since_last_fetch_attempt_in)),
      extension_install_time_since_last_refresh(std::move(extension_install_time_since_last_refresh_in)),
      extension_install_time_since_last_fetch_attempt(std::move(extension_install_time_since_last_fetch_attempt_in)),
      last_cloud_report_sent_timestamp(std::move(last_cloud_report_sent_timestamp_in)),
      time_since_last_cloud_report_sent(std::move(time_since_last_cloud_report_sent_in)),
      enterprise_domain_manager(std::move(enterprise_domain_manager_in)),
      is_affiliated(std::move(is_affiliated_in)),
      policies_push_available(std::move(policies_push_available_in)),
      error(std::move(error_in)),
      extension_install_error(std::move(extension_install_error_in)) {}

Status::~Status() = default;

void Status::WriteIntoTrace(
    perfetto::TracedValue traced_context) const {
  [[maybe_unused]] auto dict = std::move(traced_context).WriteDictionary();
  perfetto::WriteIntoTracedValueWithFallback(
    dict.AddItem(
      "policy_description_key"), this->policy_description_key,
#if BUILDFLAG(MOJO_TRACE_ENABLED)
      "<value of type const std::string&>"
#else
      "<value>"
#endif  // BUILDFLAG(MOJO_TRACE_ENABLED)
    );
  perfetto::WriteIntoTracedValueWithFallback(
    dict.AddItem(
      "flex_org_warning"), this->flex_org_warning,
#if BUILDFLAG(MOJO_TRACE_ENABLED)
      "<value of type bool>"
#else
      "<value>"
#endif  // BUILDFLAG(MOJO_TRACE_ENABLED)
    );
  perfetto::WriteIntoTracedValueWithFallback(
    dict.AddItem(
      "asset_id"), this->asset_id,
#if BUILDFLAG(MOJO_TRACE_ENABLED)
      "<value of type const std::optional<std::string>&>"
#else
      "<value>"
#endif  // BUILDFLAG(MOJO_TRACE_ENABLED)
    );
  perfetto::WriteIntoTracedValueWithFallback(
    dict.AddItem(
      "location"), this->location,
#if BUILDFLAG(MOJO_TRACE_ENABLED)
      "<value of type const std::optional<std::string>&>"
#else
      "<value>"
#endif  // BUILDFLAG(MOJO_TRACE_ENABLED)
    );
  perfetto::WriteIntoTracedValueWithFallback(
    dict.AddItem(
      "directory_api_id"), this->directory_api_id,
#if BUILDFLAG(MOJO_TRACE_ENABLED)
      "<value of type const std::optional<std::string>&>"
#else
      "<value>"
#endif  // BUILDFLAG(MOJO_TRACE_ENABLED)
    );
  perfetto::WriteIntoTracedValueWithFallback(
    dict.AddItem(
      "client_id"), this->client_id,
#if BUILDFLAG(MOJO_TRACE_ENABLED)
      "<value of type const std::string&>"
#else
      "<value>"
#endif  // BUILDFLAG(MOJO_TRACE_ENABLED)
    );
  perfetto::WriteIntoTracedValueWithFallback(
    dict.AddItem(
      "is_off_hours_active"), this->is_off_hours_active,
#if BUILDFLAG(MOJO_TRACE_ENABLED)
      "<value of type std::optional<bool>>"
#else
      "<value>"
#endif  // BUILDFLAG(MOJO_TRACE_ENABLED)
    );
  perfetto::WriteIntoTracedValueWithFallback(
    dict.AddItem(
      "device_id"), this->device_id,
#if BUILDFLAG(MOJO_TRACE_ENABLED)
      "<value of type const std::string&>"
#else
      "<value>"
#endif  // BUILDFLAG(MOJO_TRACE_ENABLED)
    );
  perfetto::WriteIntoTracedValueWithFallback(
    dict.AddItem(
      "enrollment_token"), this->enrollment_token,
#if BUILDFLAG(MOJO_TRACE_ENABLED)
      "<value of type const std::string&>"
#else
      "<value>"
#endif  // BUILDFLAG(MOJO_TRACE_ENABLED)
    );
  perfetto::WriteIntoTracedValueWithFallback(
    dict.AddItem(
      "domain"), this->domain,
#if BUILDFLAG(MOJO_TRACE_ENABLED)
      "<value of type const std::string&>"
#else
      "<value>"
#endif  // BUILDFLAG(MOJO_TRACE_ENABLED)
    );
  perfetto::WriteIntoTracedValueWithFallback(
    dict.AddItem(
      "machine"), this->machine,
#if BUILDFLAG(MOJO_TRACE_ENABLED)
      "<value of type const std::optional<std::string>&>"
#else
      "<value>"
#endif  // BUILDFLAG(MOJO_TRACE_ENABLED)
    );
  perfetto::WriteIntoTracedValueWithFallback(
    dict.AddItem(
      "version"), this->version,
#if BUILDFLAG(MOJO_TRACE_ENABLED)
      "<value of type const std::optional<std::string>&>"
#else
      "<value>"
#endif  // BUILDFLAG(MOJO_TRACE_ENABLED)
    );
  perfetto::WriteIntoTracedValueWithFallback(
    dict.AddItem(
      "username"), this->username,
#if BUILDFLAG(MOJO_TRACE_ENABLED)
      "<value of type const std::optional<std::string>&>"
#else
      "<value>"
#endif  // BUILDFLAG(MOJO_TRACE_ENABLED)
    );
  perfetto::WriteIntoTracedValueWithFallback(
    dict.AddItem(
      "gaia_id"), this->gaia_id,
#if BUILDFLAG(MOJO_TRACE_ENABLED)
      "<value of type const std::optional<std::string>&>"
#else
      "<value>"
#endif  // BUILDFLAG(MOJO_TRACE_ENABLED)
    );
  perfetto::WriteIntoTracedValueWithFallback(
    dict.AddItem(
      "profile_id"), this->profile_id,
#if BUILDFLAG(MOJO_TRACE_ENABLED)
      "<value of type const std::optional<std::string>&>"
#else
      "<value>"
#endif  // BUILDFLAG(MOJO_TRACE_ENABLED)
    );
  perfetto::WriteIntoTracedValueWithFallback(
    dict.AddItem(
      "status"), this->status,
#if BUILDFLAG(MOJO_TRACE_ENABLED)
      "<value of type const std::string&>"
#else
      "<value>"
#endif  // BUILDFLAG(MOJO_TRACE_ENABLED)
    );
  perfetto::WriteIntoTracedValueWithFallback(
    dict.AddItem(
      "extension_install_status"), this->extension_install_status,
#if BUILDFLAG(MOJO_TRACE_ENABLED)
      "<value of type const std::string&>"
#else
      "<value>"
#endif  // BUILDFLAG(MOJO_TRACE_ENABLED)
    );
  perfetto::WriteIntoTracedValueWithFallback(
    dict.AddItem(
      "refresh_interval"), this->refresh_interval,
#if BUILDFLAG(MOJO_TRACE_ENABLED)
      "<value of type const std::optional<std::string>&>"
#else
      "<value>"
#endif  // BUILDFLAG(MOJO_TRACE_ENABLED)
    );
  perfetto::WriteIntoTracedValueWithFallback(
    dict.AddItem(
      "time_since_last_refresh"), this->time_since_last_refresh,
#if BUILDFLAG(MOJO_TRACE_ENABLED)
      "<value of type const std::optional<std::string>&>"
#else
      "<value>"
#endif  // BUILDFLAG(MOJO_TRACE_ENABLED)
    );
  perfetto::WriteIntoTracedValueWithFallback(
    dict.AddItem(
      "time_since_last_fetch_attempt"), this->time_since_last_fetch_attempt,
#if BUILDFLAG(MOJO_TRACE_ENABLED)
      "<value of type const std::optional<std::string>&>"
#else
      "<value>"
#endif  // BUILDFLAG(MOJO_TRACE_ENABLED)
    );
  perfetto::WriteIntoTracedValueWithFallback(
    dict.AddItem(
      "extension_install_time_since_last_refresh"), this->extension_install_time_since_last_refresh,
#if BUILDFLAG(MOJO_TRACE_ENABLED)
      "<value of type const std::optional<std::string>&>"
#else
      "<value>"
#endif  // BUILDFLAG(MOJO_TRACE_ENABLED)
    );
  perfetto::WriteIntoTracedValueWithFallback(
    dict.AddItem(
      "extension_install_time_since_last_fetch_attempt"), this->extension_install_time_since_last_fetch_attempt,
#if BUILDFLAG(MOJO_TRACE_ENABLED)
      "<value of type const std::optional<std::string>&>"
#else
      "<value>"
#endif  // BUILDFLAG(MOJO_TRACE_ENABLED)
    );
  perfetto::WriteIntoTracedValueWithFallback(
    dict.AddItem(
      "last_cloud_report_sent_timestamp"), this->last_cloud_report_sent_timestamp,
#if BUILDFLAG(MOJO_TRACE_ENABLED)
      "<value of type const std::optional<std::string>&>"
#else
      "<value>"
#endif  // BUILDFLAG(MOJO_TRACE_ENABLED)
    );
  perfetto::WriteIntoTracedValueWithFallback(
    dict.AddItem(
      "time_since_last_cloud_report_sent"), this->time_since_last_cloud_report_sent,
#if BUILDFLAG(MOJO_TRACE_ENABLED)
      "<value of type const std::optional<std::string>&>"
#else
      "<value>"
#endif  // BUILDFLAG(MOJO_TRACE_ENABLED)
    );
  perfetto::WriteIntoTracedValueWithFallback(
    dict.AddItem(
      "enterprise_domain_manager"), this->enterprise_domain_manager,
#if BUILDFLAG(MOJO_TRACE_ENABLED)
      "<value of type const std::optional<std::string>&>"
#else
      "<value>"
#endif  // BUILDFLAG(MOJO_TRACE_ENABLED)
    );
  perfetto::WriteIntoTracedValueWithFallback(
    dict.AddItem(
      "is_affiliated"), this->is_affiliated,
#if BUILDFLAG(MOJO_TRACE_ENABLED)
      "<value of type std::optional<bool>>"
#else
      "<value>"
#endif  // BUILDFLAG(MOJO_TRACE_ENABLED)
    );
  perfetto::WriteIntoTracedValueWithFallback(
    dict.AddItem(
      "policies_push_available"), this->policies_push_available,
#if BUILDFLAG(MOJO_TRACE_ENABLED)
      "<value of type bool>"
#else
      "<value>"
#endif  // BUILDFLAG(MOJO_TRACE_ENABLED)
    );
  perfetto::WriteIntoTracedValueWithFallback(
    dict.AddItem(
      "error"), this->error,
#if BUILDFLAG(MOJO_TRACE_ENABLED)
      "<value of type bool>"
#else
      "<value>"
#endif  // BUILDFLAG(MOJO_TRACE_ENABLED)
    );
  perfetto::WriteIntoTracedValueWithFallback(
    dict.AddItem(
      "extension_install_error"), this->extension_install_error,
#if BUILDFLAG(MOJO_TRACE_ENABLED)
      "<value of type bool>"
#else
      "<value>"
#endif  // BUILDFLAG(MOJO_TRACE_ENABLED)
    );
}

bool Status::Validate(
    const void* data,
    mojo::internal::ValidationContext* validation_context) {
  return Data_::Validate(data, validation_context);
}
Conflict::Conflict()
    : level(),
      scope(),
      source(),
      value() {}

Conflict::Conflict(
    const std::string& level_in,
    const std::string& scope_in,
    const std::string& source_in,
    std::optional<::base::Value> value_in)
    : level(std::move(level_in)),
      scope(std::move(scope_in)),
      source(std::move(source_in)),
      value(std::move(value_in)) {}

Conflict::~Conflict() = default;

void Conflict::WriteIntoTrace(
    perfetto::TracedValue traced_context) const {
  [[maybe_unused]] auto dict = std::move(traced_context).WriteDictionary();
  perfetto::WriteIntoTracedValueWithFallback(
    dict.AddItem(
      "level"), this->level,
#if BUILDFLAG(MOJO_TRACE_ENABLED)
      "<value of type const std::string&>"
#else
      "<value>"
#endif  // BUILDFLAG(MOJO_TRACE_ENABLED)
    );
  perfetto::WriteIntoTracedValueWithFallback(
    dict.AddItem(
      "scope"), this->scope,
#if BUILDFLAG(MOJO_TRACE_ENABLED)
      "<value of type const std::string&>"
#else
      "<value>"
#endif  // BUILDFLAG(MOJO_TRACE_ENABLED)
    );
  perfetto::WriteIntoTracedValueWithFallback(
    dict.AddItem(
      "source"), this->source,
#if BUILDFLAG(MOJO_TRACE_ENABLED)
      "<value of type const std::string&>"
#else
      "<value>"
#endif  // BUILDFLAG(MOJO_TRACE_ENABLED)
    );
  perfetto::WriteIntoTracedValueWithFallback(
    dict.AddItem(
      "value"), this->value,
#if BUILDFLAG(MOJO_TRACE_ENABLED)
      "<value of type std::optional<::base::Value>>"
#else
      "<value>"
#endif  // BUILDFLAG(MOJO_TRACE_ENABLED)
    );
}

bool Conflict::Validate(
    const void* data,
    mojo::internal::ValidationContext* validation_context) {
  return Data_::Validate(data, validation_context);
}
Policy::Policy()
    : ignored(),
      name(),
      level(),
      scope(),
      source(),
      value(),
      restart_required(),
      deprecated(),
      future(),
      all_sources_merged(),
      conflicts(),
      superseded(),
      error(),
      warning(),
      info() {}

Policy::Policy(
    bool ignored_in,
    const std::string& name_in,
    const std::string& level_in,
    const std::string& scope_in,
    const std::string& source_in,
    ::base::Value value_in,
    bool restart_required_in,
    bool deprecated_in,
    bool future_in,
    std::optional<bool> all_sources_merged_in,
    std::vector<ConflictPtr> conflicts_in,
    std::vector<ConflictPtr> superseded_in,
    const std::string& error_in,
    const std::string& warning_in,
    const std::string& info_in)
    : ignored(std::move(ignored_in)),
      name(std::move(name_in)),
      level(std::move(level_in)),
      scope(std::move(scope_in)),
      source(std::move(source_in)),
      value(std::move(value_in)),
      restart_required(std::move(restart_required_in)),
      deprecated(std::move(deprecated_in)),
      future(std::move(future_in)),
      all_sources_merged(std::move(all_sources_merged_in)),
      conflicts(std::move(conflicts_in)),
      superseded(std::move(superseded_in)),
      error(std::move(error_in)),
      warning(std::move(warning_in)),
      info(std::move(info_in)) {}

Policy::~Policy() = default;

void Policy::WriteIntoTrace(
    perfetto::TracedValue traced_context) const {
  [[maybe_unused]] auto dict = std::move(traced_context).WriteDictionary();
  perfetto::WriteIntoTracedValueWithFallback(
    dict.AddItem(
      "ignored"), this->ignored,
#if BUILDFLAG(MOJO_TRACE_ENABLED)
      "<value of type bool>"
#else
      "<value>"
#endif  // BUILDFLAG(MOJO_TRACE_ENABLED)
    );
  perfetto::WriteIntoTracedValueWithFallback(
    dict.AddItem(
      "name"), this->name,
#if BUILDFLAG(MOJO_TRACE_ENABLED)
      "<value of type const std::string&>"
#else
      "<value>"
#endif  // BUILDFLAG(MOJO_TRACE_ENABLED)
    );
  perfetto::WriteIntoTracedValueWithFallback(
    dict.AddItem(
      "level"), this->level,
#if BUILDFLAG(MOJO_TRACE_ENABLED)
      "<value of type const std::string&>"
#else
      "<value>"
#endif  // BUILDFLAG(MOJO_TRACE_ENABLED)
    );
  perfetto::WriteIntoTracedValueWithFallback(
    dict.AddItem(
      "scope"), this->scope,
#if BUILDFLAG(MOJO_TRACE_ENABLED)
      "<value of type const std::string&>"
#else
      "<value>"
#endif  // BUILDFLAG(MOJO_TRACE_ENABLED)
    );
  perfetto::WriteIntoTracedValueWithFallback(
    dict.AddItem(
      "source"), this->source,
#if BUILDFLAG(MOJO_TRACE_ENABLED)
      "<value of type const std::string&>"
#else
      "<value>"
#endif  // BUILDFLAG(MOJO_TRACE_ENABLED)
    );
  perfetto::WriteIntoTracedValueWithFallback(
    dict.AddItem(
      "value"), this->value,
#if BUILDFLAG(MOJO_TRACE_ENABLED)
      "<value of type ::base::Value>"
#else
      "<value>"
#endif  // BUILDFLAG(MOJO_TRACE_ENABLED)
    );
  perfetto::WriteIntoTracedValueWithFallback(
    dict.AddItem(
      "restart_required"), this->restart_required,
#if BUILDFLAG(MOJO_TRACE_ENABLED)
      "<value of type bool>"
#else
      "<value>"
#endif  // BUILDFLAG(MOJO_TRACE_ENABLED)
    );
  perfetto::WriteIntoTracedValueWithFallback(
    dict.AddItem(
      "deprecated"), this->deprecated,
#if BUILDFLAG(MOJO_TRACE_ENABLED)
      "<value of type bool>"
#else
      "<value>"
#endif  // BUILDFLAG(MOJO_TRACE_ENABLED)
    );
  perfetto::WriteIntoTracedValueWithFallback(
    dict.AddItem(
      "future"), this->future,
#if BUILDFLAG(MOJO_TRACE_ENABLED)
      "<value of type bool>"
#else
      "<value>"
#endif  // BUILDFLAG(MOJO_TRACE_ENABLED)
    );
  perfetto::WriteIntoTracedValueWithFallback(
    dict.AddItem(
      "all_sources_merged"), this->all_sources_merged,
#if BUILDFLAG(MOJO_TRACE_ENABLED)
      "<value of type std::optional<bool>>"
#else
      "<value>"
#endif  // BUILDFLAG(MOJO_TRACE_ENABLED)
    );
  perfetto::WriteIntoTracedValueWithFallback(
    dict.AddItem(
      "conflicts"), this->conflicts,
#if BUILDFLAG(MOJO_TRACE_ENABLED)
      "<value of type std::vector<ConflictPtr>>"
#else
      "<value>"
#endif  // BUILDFLAG(MOJO_TRACE_ENABLED)
    );
  perfetto::WriteIntoTracedValueWithFallback(
    dict.AddItem(
      "superseded"), this->superseded,
#if BUILDFLAG(MOJO_TRACE_ENABLED)
      "<value of type std::vector<ConflictPtr>>"
#else
      "<value>"
#endif  // BUILDFLAG(MOJO_TRACE_ENABLED)
    );
  perfetto::WriteIntoTracedValueWithFallback(
    dict.AddItem(
      "error"), this->error,
#if BUILDFLAG(MOJO_TRACE_ENABLED)
      "<value of type const std::string&>"
#else
      "<value>"
#endif  // BUILDFLAG(MOJO_TRACE_ENABLED)
    );
  perfetto::WriteIntoTracedValueWithFallback(
    dict.AddItem(
      "warning"), this->warning,
#if BUILDFLAG(MOJO_TRACE_ENABLED)
      "<value of type const std::string&>"
#else
      "<value>"
#endif  // BUILDFLAG(MOJO_TRACE_ENABLED)
    );
  perfetto::WriteIntoTracedValueWithFallback(
    dict.AddItem(
      "info"), this->info,
#if BUILDFLAG(MOJO_TRACE_ENABLED)
      "<value of type const std::string&>"
#else
      "<value>"
#endif  // BUILDFLAG(MOJO_TRACE_ENABLED)
    );
}

bool Policy::Validate(
    const void* data,
    mojo::internal::ValidationContext* validation_context) {
  return Data_::Validate(data, validation_context);
}
PolicyGroup::PolicyGroup()
    : name(),
      policies(),
      precedence_order(),
      is_extension(),
      for_signin_screen() {}

PolicyGroup::PolicyGroup(
    const std::string& name_in,
    base::flat_map<std::string, PolicyPtr> policies_in,
    std::optional<std::vector<std::string>> precedence_order_in,
    bool is_extension_in,
    bool for_signin_screen_in)
    : name(std::move(name_in)),
      policies(std::move(policies_in)),
      precedence_order(std::move(precedence_order_in)),
      is_extension(std::move(is_extension_in)),
      for_signin_screen(std::move(for_signin_screen_in)) {}

PolicyGroup::~PolicyGroup() = default;

void PolicyGroup::WriteIntoTrace(
    perfetto::TracedValue traced_context) const {
  [[maybe_unused]] auto dict = std::move(traced_context).WriteDictionary();
  perfetto::WriteIntoTracedValueWithFallback(
    dict.AddItem(
      "name"), this->name,
#if BUILDFLAG(MOJO_TRACE_ENABLED)
      "<value of type const std::string&>"
#else
      "<value>"
#endif  // BUILDFLAG(MOJO_TRACE_ENABLED)
    );
  perfetto::WriteIntoTracedValueWithFallback(
    dict.AddItem(
      "policies"), this->policies,
#if BUILDFLAG(MOJO_TRACE_ENABLED)
      "<value of type base::flat_map<std::string, PolicyPtr>>"
#else
      "<value>"
#endif  // BUILDFLAG(MOJO_TRACE_ENABLED)
    );
  perfetto::WriteIntoTracedValueWithFallback(
    dict.AddItem(
      "precedence_order"), this->precedence_order,
#if BUILDFLAG(MOJO_TRACE_ENABLED)
      "<value of type const std::optional<std::vector<std::string>>&>"
#else
      "<value>"
#endif  // BUILDFLAG(MOJO_TRACE_ENABLED)
    );
  perfetto::WriteIntoTracedValueWithFallback(
    dict.AddItem(
      "is_extension"), this->is_extension,
#if BUILDFLAG(MOJO_TRACE_ENABLED)
      "<value of type bool>"
#else
      "<value>"
#endif  // BUILDFLAG(MOJO_TRACE_ENABLED)
    );
  perfetto::WriteIntoTracedValueWithFallback(
    dict.AddItem(
      "for_signin_screen"), this->for_signin_screen,
#if BUILDFLAG(MOJO_TRACE_ENABLED)
      "<value of type bool>"
#else
      "<value>"
#endif  // BUILDFLAG(MOJO_TRACE_ENABLED)
    );
}

bool PolicyGroup::Validate(
    const void* data,
    mojo::internal::ValidationContext* validation_context) {
  return Data_::Validate(data, validation_context);
}
PolicyGroupsResponse::PolicyGroupsResponse()
    : policy_ids_presentation_order(),
      policy_groups() {}

PolicyGroupsResponse::PolicyGroupsResponse(
    std::vector<std::string> policy_ids_presentation_order_in,
    base::flat_map<std::string, PolicyGroupPtr> policy_groups_in)
    : policy_ids_presentation_order(std::move(policy_ids_presentation_order_in)),
      policy_groups(std::move(policy_groups_in)) {}

PolicyGroupsResponse::~PolicyGroupsResponse() = default;

void PolicyGroupsResponse::WriteIntoTrace(
    perfetto::TracedValue traced_context) const {
  [[maybe_unused]] auto dict = std::move(traced_context).WriteDictionary();
  perfetto::WriteIntoTracedValueWithFallback(
    dict.AddItem(
      "policy_ids_presentation_order"), this->policy_ids_presentation_order,
#if BUILDFLAG(MOJO_TRACE_ENABLED)
      "<value of type const std::vector<std::string>&>"
#else
      "<value>"
#endif  // BUILDFLAG(MOJO_TRACE_ENABLED)
    );
  perfetto::WriteIntoTracedValueWithFallback(
    dict.AddItem(
      "policy_groups"), this->policy_groups,
#if BUILDFLAG(MOJO_TRACE_ENABLED)
      "<value of type base::flat_map<std::string, PolicyGroupPtr>>"
#else
      "<value>"
#endif  // BUILDFLAG(MOJO_TRACE_ENABLED)
    );
}

bool PolicyGroupsResponse::Validate(
    const void* data,
    mojo::internal::ValidationContext* validation_context) {
  return Data_::Validate(data, validation_context);
}
// The declaration includes the definition on other builds.

PolicyPageHandler::IPCStableHashFunction PolicyPageHandler::MessageToMethodInfo_(mojo::Message& message) {
#if !BUILDFLAG(IS_FUCHSIA)
  switch (static_cast<messages::PolicyPageHandler>(message.name())) {
    case messages::PolicyPageHandler::kGetDebugString: {
      return &PolicyPageHandler::GetDebugString_Sym::IPCStableHash;
    }
    case messages::PolicyPageHandler::kRestartBrowser: {
      return &PolicyPageHandler::RestartBrowser_Sym::IPCStableHash;
    }
    case messages::PolicyPageHandler::kSetUserAffiliated: {
      return &PolicyPageHandler::SetUserAffiliated_Sym::IPCStableHash;
    }
    case messages::PolicyPageHandler::kGetAppliedTestPolicies: {
      return &PolicyPageHandler::GetAppliedTestPolicies_Sym::IPCStableHash;
    }
    case messages::PolicyPageHandler::kRevertLocalTestPolicies: {
      return &PolicyPageHandler::RevertLocalTestPolicies_Sym::IPCStableHash;
    }
    case messages::PolicyPageHandler::kSetLocalTestPolicies: {
      return &PolicyPageHandler::SetLocalTestPolicies_Sym::IPCStableHash;
    }
    case messages::PolicyPageHandler::kGetPolicyLogs: {
      return &PolicyPageHandler::GetPolicyLogs_Sym::IPCStableHash;
    }
    case messages::PolicyPageHandler::kGetPoliciesJson: {
      return &PolicyPageHandler::GetPoliciesJson_Sym::IPCStableHash;
    }
  }
#endif  // !BUILDFLAG(IS_FUCHSIA)
  return nullptr;
}


const char* PolicyPageHandler::MessageToMethodName_(mojo::Message& message) {
#if BUILDFLAG(MOJO_TRACE_ENABLED)
  bool is_response = message.has_flag(mojo::Message::kFlagIsResponse);
  if (!is_response) {
    switch (static_cast<messages::PolicyPageHandler>(message.name())) {
      case messages::PolicyPageHandler::kGetDebugString:
            return "Receive policy::mojom::PolicyPageHandler::GetDebugString";
      case messages::PolicyPageHandler::kRestartBrowser:
            return "Receive policy::mojom::PolicyPageHandler::RestartBrowser";
      case messages::PolicyPageHandler::kSetUserAffiliated:
            return "Receive policy::mojom::PolicyPageHandler::SetUserAffiliated";
      case messages::PolicyPageHandler::kGetAppliedTestPolicies:
            return "Receive policy::mojom::PolicyPageHandler::GetAppliedTestPolicies";
      case messages::PolicyPageHandler::kRevertLocalTestPolicies:
            return "Receive policy::mojom::PolicyPageHandler::RevertLocalTestPolicies";
      case messages::PolicyPageHandler::kSetLocalTestPolicies:
            return "Receive policy::mojom::PolicyPageHandler::SetLocalTestPolicies";
      case messages::PolicyPageHandler::kGetPolicyLogs:
            return "Receive policy::mojom::PolicyPageHandler::GetPolicyLogs";
      case messages::PolicyPageHandler::kGetPoliciesJson:
            return "Receive policy::mojom::PolicyPageHandler::GetPoliciesJson";
    }
  } else {
    switch (static_cast<messages::PolicyPageHandler>(message.name())) {
      case messages::PolicyPageHandler::kGetDebugString:
            return "Receive reply policy::mojom::PolicyPageHandler::GetDebugString";
      case messages::PolicyPageHandler::kRestartBrowser:
            return "Receive reply policy::mojom::PolicyPageHandler::RestartBrowser";
      case messages::PolicyPageHandler::kSetUserAffiliated:
            return "Receive reply policy::mojom::PolicyPageHandler::SetUserAffiliated";
      case messages::PolicyPageHandler::kGetAppliedTestPolicies:
            return "Receive reply policy::mojom::PolicyPageHandler::GetAppliedTestPolicies";
      case messages::PolicyPageHandler::kRevertLocalTestPolicies:
            return "Receive reply policy::mojom::PolicyPageHandler::RevertLocalTestPolicies";
      case messages::PolicyPageHandler::kSetLocalTestPolicies:
            return "Receive reply policy::mojom::PolicyPageHandler::SetLocalTestPolicies";
      case messages::PolicyPageHandler::kGetPolicyLogs:
            return "Receive reply policy::mojom::PolicyPageHandler::GetPolicyLogs";
      case messages::PolicyPageHandler::kGetPoliciesJson:
            return "Receive reply policy::mojom::PolicyPageHandler::GetPoliciesJson";
    }
  }
  return "Receive unknown mojo message";
#else
  bool is_response = message.has_flag(mojo::Message::kFlagIsResponse);
  if (is_response) {
    return "Receive mojo reply";
  } else {
    return "Receive mojo message";
  }
#endif // BUILDFLAG(MOJO_TRACE_ENABLED)
}

#if !BUILDFLAG(IS_FUCHSIA)
uint32_t PolicyPageHandler::GetDebugString_Sym::IPCStableHash() {
  // This method's address is used for identifying the mojo method name after
  // symbolization. So each IPCStableHash should have a unique address.
  // We cannot use NO_CODE_FOLDING() here - it relies on the uniqueness of
  // __LINE__ value, which is not unique across different mojo modules.
  // The code below is very similar to NO_CODE_FOLDING, but it uses a unique
  // hash instead of __LINE__.
  static constexpr uint32_t kHash = 0x0c4de5c3;  // IPCStableHash for policy::mojom::PolicyPageHandler::GetDebugString
  const uint32_t hash = kHash;
  base::debug::Alias(&hash);
  return hash;
}
uint32_t PolicyPageHandler::RestartBrowser_Sym::IPCStableHash() {
  // This method's address is used for identifying the mojo method name after
  // symbolization. So each IPCStableHash should have a unique address.
  // We cannot use NO_CODE_FOLDING() here - it relies on the uniqueness of
  // __LINE__ value, which is not unique across different mojo modules.
  // The code below is very similar to NO_CODE_FOLDING, but it uses a unique
  // hash instead of __LINE__.
  static constexpr uint32_t kHash = 0x8b934e75;  // IPCStableHash for policy::mojom::PolicyPageHandler::RestartBrowser
  const uint32_t hash = kHash;
  base::debug::Alias(&hash);
  return hash;
}
uint32_t PolicyPageHandler::SetUserAffiliated_Sym::IPCStableHash() {
  // This method's address is used for identifying the mojo method name after
  // symbolization. So each IPCStableHash should have a unique address.
  // We cannot use NO_CODE_FOLDING() here - it relies on the uniqueness of
  // __LINE__ value, which is not unique across different mojo modules.
  // The code below is very similar to NO_CODE_FOLDING, but it uses a unique
  // hash instead of __LINE__.
  static constexpr uint32_t kHash = 0xd3b09b44;  // IPCStableHash for policy::mojom::PolicyPageHandler::SetUserAffiliated
  const uint32_t hash = kHash;
  base::debug::Alias(&hash);
  return hash;
}
uint32_t PolicyPageHandler::GetAppliedTestPolicies_Sym::IPCStableHash() {
  // This method's address is used for identifying the mojo method name after
  // symbolization. So each IPCStableHash should have a unique address.
  // We cannot use NO_CODE_FOLDING() here - it relies on the uniqueness of
  // __LINE__ value, which is not unique across different mojo modules.
  // The code below is very similar to NO_CODE_FOLDING, but it uses a unique
  // hash instead of __LINE__.
  static constexpr uint32_t kHash = 0x359598f3;  // IPCStableHash for policy::mojom::PolicyPageHandler::GetAppliedTestPolicies
  const uint32_t hash = kHash;
  base::debug::Alias(&hash);
  return hash;
}
uint32_t PolicyPageHandler::RevertLocalTestPolicies_Sym::IPCStableHash() {
  // This method's address is used for identifying the mojo method name after
  // symbolization. So each IPCStableHash should have a unique address.
  // We cannot use NO_CODE_FOLDING() here - it relies on the uniqueness of
  // __LINE__ value, which is not unique across different mojo modules.
  // The code below is very similar to NO_CODE_FOLDING, but it uses a unique
  // hash instead of __LINE__.
  static constexpr uint32_t kHash = 0xcdd01045;  // IPCStableHash for policy::mojom::PolicyPageHandler::RevertLocalTestPolicies
  const uint32_t hash = kHash;
  base::debug::Alias(&hash);
  return hash;
}
uint32_t PolicyPageHandler::SetLocalTestPolicies_Sym::IPCStableHash() {
  // This method's address is used for identifying the mojo method name after
  // symbolization. So each IPCStableHash should have a unique address.
  // We cannot use NO_CODE_FOLDING() here - it relies on the uniqueness of
  // __LINE__ value, which is not unique across different mojo modules.
  // The code below is very similar to NO_CODE_FOLDING, but it uses a unique
  // hash instead of __LINE__.
  static constexpr uint32_t kHash = 0x0a654f12;  // IPCStableHash for policy::mojom::PolicyPageHandler::SetLocalTestPolicies
  const uint32_t hash = kHash;
  base::debug::Alias(&hash);
  return hash;
}
uint32_t PolicyPageHandler::GetPolicyLogs_Sym::IPCStableHash() {
  // This method's address is used for identifying the mojo method name after
  // symbolization. So each IPCStableHash should have a unique address.
  // We cannot use NO_CODE_FOLDING() here - it relies on the uniqueness of
  // __LINE__ value, which is not unique across different mojo modules.
  // The code below is very similar to NO_CODE_FOLDING, but it uses a unique
  // hash instead of __LINE__.
  static constexpr uint32_t kHash = 0x6efb5658;  // IPCStableHash for policy::mojom::PolicyPageHandler::GetPolicyLogs
  const uint32_t hash = kHash;
  base::debug::Alias(&hash);
  return hash;
}
uint32_t PolicyPageHandler::GetPoliciesJson_Sym::IPCStableHash() {
  // This method's address is used for identifying the mojo method name after
  // symbolization. So each IPCStableHash should have a unique address.
  // We cannot use NO_CODE_FOLDING() here - it relies on the uniqueness of
  // __LINE__ value, which is not unique across different mojo modules.
  // The code below is very similar to NO_CODE_FOLDING, but it uses a unique
  // hash instead of __LINE__.
  static constexpr uint32_t kHash = 0xfa481ee8;  // IPCStableHash for policy::mojom::PolicyPageHandler::GetPoliciesJson
  const uint32_t hash = kHash;
  base::debug::Alias(&hash);
  return hash;
}
# endif // !BUILDFLAG(IS_FUCHSIA)

class PolicyPageHandler_GetDebugString_ForwardToCallback
    : public mojo::MessageReceiver {
 public:
  PolicyPageHandler_GetDebugString_ForwardToCallback(
      PolicyPageHandler::GetDebugStringCallback callback
      ) : callback_(std::move(callback)) {
  }

  PolicyPageHandler_GetDebugString_ForwardToCallback(const PolicyPageHandler_GetDebugString_ForwardToCallback&) = delete;
  PolicyPageHandler_GetDebugString_ForwardToCallback& operator=(const PolicyPageHandler_GetDebugString_ForwardToCallback&) = delete;

  bool Accept(mojo::Message* message) override;
 private:
  PolicyPageHandler::GetDebugStringCallback callback_;
};

class PolicyPageHandler_SetUserAffiliated_ForwardToCallback
    : public mojo::MessageReceiver {
 public:
  PolicyPageHandler_SetUserAffiliated_ForwardToCallback(
      PolicyPageHandler::SetUserAffiliatedCallback callback
      ) : callback_(std::move(callback)) {
  }

  PolicyPageHandler_SetUserAffiliated_ForwardToCallback(const PolicyPageHandler_SetUserAffiliated_ForwardToCallback&) = delete;
  PolicyPageHandler_SetUserAffiliated_ForwardToCallback& operator=(const PolicyPageHandler_SetUserAffiliated_ForwardToCallback&) = delete;

  bool Accept(mojo::Message* message) override;
 private:
  PolicyPageHandler::SetUserAffiliatedCallback callback_;
};

class PolicyPageHandler_GetAppliedTestPolicies_ForwardToCallback
    : public mojo::MessageReceiver {
 public:
  PolicyPageHandler_GetAppliedTestPolicies_ForwardToCallback(
      PolicyPageHandler::GetAppliedTestPoliciesCallback callback
      ) : callback_(std::move(callback)) {
  }

  PolicyPageHandler_GetAppliedTestPolicies_ForwardToCallback(const PolicyPageHandler_GetAppliedTestPolicies_ForwardToCallback&) = delete;
  PolicyPageHandler_GetAppliedTestPolicies_ForwardToCallback& operator=(const PolicyPageHandler_GetAppliedTestPolicies_ForwardToCallback&) = delete;

  bool Accept(mojo::Message* message) override;
 private:
  PolicyPageHandler::GetAppliedTestPoliciesCallback callback_;
};

class PolicyPageHandler_SetLocalTestPolicies_ForwardToCallback
    : public mojo::MessageReceiver {
 public:
  PolicyPageHandler_SetLocalTestPolicies_ForwardToCallback(
      PolicyPageHandler::SetLocalTestPoliciesCallback callback
      ) : callback_(std::move(callback)) {
  }

  PolicyPageHandler_SetLocalTestPolicies_ForwardToCallback(const PolicyPageHandler_SetLocalTestPolicies_ForwardToCallback&) = delete;
  PolicyPageHandler_SetLocalTestPolicies_ForwardToCallback& operator=(const PolicyPageHandler_SetLocalTestPolicies_ForwardToCallback&) = delete;

  bool Accept(mojo::Message* message) override;
 private:
  PolicyPageHandler::SetLocalTestPoliciesCallback callback_;
};

class PolicyPageHandler_GetPolicyLogs_ForwardToCallback
    : public mojo::MessageReceiver {
 public:
  PolicyPageHandler_GetPolicyLogs_ForwardToCallback(
      PolicyPageHandler::GetPolicyLogsCallback callback
      ) : callback_(std::move(callback)) {
  }

  PolicyPageHandler_GetPolicyLogs_ForwardToCallback(const PolicyPageHandler_GetPolicyLogs_ForwardToCallback&) = delete;
  PolicyPageHandler_GetPolicyLogs_ForwardToCallback& operator=(const PolicyPageHandler_GetPolicyLogs_ForwardToCallback&) = delete;

  bool Accept(mojo::Message* message) override;
 private:
  PolicyPageHandler::GetPolicyLogsCallback callback_;
};

class PolicyPageHandler_GetPoliciesJson_ForwardToCallback
    : public mojo::MessageReceiver {
 public:
  PolicyPageHandler_GetPoliciesJson_ForwardToCallback(
      PolicyPageHandler::GetPoliciesJsonCallback callback
      ) : callback_(std::move(callback)) {
  }

  PolicyPageHandler_GetPoliciesJson_ForwardToCallback(const PolicyPageHandler_GetPoliciesJson_ForwardToCallback&) = delete;
  PolicyPageHandler_GetPoliciesJson_ForwardToCallback& operator=(const PolicyPageHandler_GetPoliciesJson_ForwardToCallback&) = delete;

  bool Accept(mojo::Message* message) override;
 private:
  PolicyPageHandler::GetPoliciesJsonCallback callback_;
};

PolicyPageHandlerProxy::PolicyPageHandlerProxy(mojo::MessageReceiverWithResponder* receiver)
    : receiver_(receiver) {
}

void PolicyPageHandlerProxy::GetDebugString(
    GetDebugStringCallback callback) {
#if BUILDFLAG(MOJO_TRACE_ENABLED)
  TRACE_EVENT0("mojom", "Send policy::mojom::PolicyPageHandler::GetDebugString");
#endif

  const bool kExpectsResponse = true;
  const bool kIsSync = false;
  const bool kAllowInterrupt = true;
  const bool is_urgent = false;

  const uint32_t kFlags =
      ((kExpectsResponse) ? mojo::Message::kFlagExpectsResponse : 0) |
      ((kIsSync) ? mojo::Message::kFlagIsSync : 0) |
      ((kAllowInterrupt) ? 0 : mojo::Message::kFlagNoInterrupt) |
      ((is_urgent) ? mojo::Message::kFlagIsUrgent : 0);

  const size_t estimated_payload_size =
    0;
  mojo::Message message(
      std::to_underlying(messages::PolicyPageHandler::kGetDebugString), kFlags, estimated_payload_size);
  mojo::internal::MessageFragment<
      ::policy::mojom::internal::PolicyPageHandler_GetDebugString_Params_Data> params(
          message);
  params.Allocate();

#if defined(ENABLE_IPC_FUZZER)
  message.set_interface_name(PolicyPageHandler::Name_);
  message.set_method_name("GetDebugString");
#endif
  std::unique_ptr<mojo::MessageReceiver> responder(
      new PolicyPageHandler_GetDebugString_ForwardToCallback(
          std::move(callback)));
  ::mojo::internal::SendMojoMessage(*receiver_, message, std::move(responder));
}

void PolicyPageHandlerProxy::RestartBrowser(
    const std::string& in_policies) {
#if BUILDFLAG(MOJO_TRACE_ENABLED)
  TRACE_EVENT1(
    "mojom", "Send policy::mojom::PolicyPageHandler::RestartBrowser", "input_parameters",
    [&](perfetto::TracedValue context){
      auto dict = std::move(context).WriteDictionary();
      perfetto::WriteIntoTracedValueWithFallback(
           dict.AddItem("policies"), in_policies,
                        "<value of type const std::string&>");
   });
#endif

  const bool kExpectsResponse = false;
  const bool kIsSync = false;
  const bool kAllowInterrupt = true;
  const bool is_urgent = false;

  const uint32_t kFlags =
      ((kExpectsResponse) ? mojo::Message::kFlagExpectsResponse : 0) |
      ((kIsSync) ? mojo::Message::kFlagIsSync : 0) |
      ((kAllowInterrupt) ? 0 : mojo::Message::kFlagNoInterrupt) |
      ((is_urgent) ? mojo::Message::kFlagIsUrgent : 0);

  const size_t estimated_payload_size =
    0;
  mojo::Message message(
      std::to_underlying(messages::PolicyPageHandler::kRestartBrowser), kFlags, estimated_payload_size);
  mojo::internal::MessageFragment<
      ::policy::mojom::internal::PolicyPageHandler_RestartBrowser_Params_Data> params(
          message);
  params.Allocate();
  mojo::internal::MessageFragment<
      typename decltype(params->policies)::BaseType> policies_fragment(
          params.message());
  
  mojo::internal::Serialize<mojo::StringDataView>(
    in_policies,
    policies_fragment);

  params->policies.Set(
      policies_fragment.is_null() ? nullptr : policies_fragment.data());

  
  MOJO_INTERNAL_CHECK_SERIALIZATION(
    mojo::internal::SendValidation::kDefault,
    !(params->policies.is_null()),
    mojo::internal::VALIDATION_ERROR_UNEXPECTED_NULL_POINTER,
    "null policies in PolicyPageHandler.RestartBrowser request");

#if defined(ENABLE_IPC_FUZZER)
  message.set_interface_name(PolicyPageHandler::Name_);
  message.set_method_name("RestartBrowser");
#endif
  // This return value may be ignored as false implies the Connector has
  // encountered an error, which will be visible through other means.
  ::mojo::internal::SendMojoMessage(*receiver_, message);
}

void PolicyPageHandlerProxy::SetUserAffiliated(
    bool in_affiliated, SetUserAffiliatedCallback callback) {
#if BUILDFLAG(MOJO_TRACE_ENABLED)
  TRACE_EVENT1(
    "mojom", "Send policy::mojom::PolicyPageHandler::SetUserAffiliated", "input_parameters",
    [&](perfetto::TracedValue context){
      auto dict = std::move(context).WriteDictionary();
      perfetto::WriteIntoTracedValueWithFallback(
           dict.AddItem("affiliated"), in_affiliated,
                        "<value of type bool>");
   });
#endif

  const bool kExpectsResponse = true;
  const bool kIsSync = false;
  const bool kAllowInterrupt = true;
  const bool is_urgent = false;

  const uint32_t kFlags =
      ((kExpectsResponse) ? mojo::Message::kFlagExpectsResponse : 0) |
      ((kIsSync) ? mojo::Message::kFlagIsSync : 0) |
      ((kAllowInterrupt) ? 0 : mojo::Message::kFlagNoInterrupt) |
      ((is_urgent) ? mojo::Message::kFlagIsUrgent : 0);

  const size_t estimated_payload_size =
    0;
  mojo::Message message(
      std::to_underlying(messages::PolicyPageHandler::kSetUserAffiliated), kFlags, estimated_payload_size);
  mojo::internal::MessageFragment<
      ::policy::mojom::internal::PolicyPageHandler_SetUserAffiliated_Params_Data> params(
          message);
  params.Allocate();

  params->affiliated = in_affiliated;

#if defined(ENABLE_IPC_FUZZER)
  message.set_interface_name(PolicyPageHandler::Name_);
  message.set_method_name("SetUserAffiliated");
#endif
  std::unique_ptr<mojo::MessageReceiver> responder(
      new PolicyPageHandler_SetUserAffiliated_ForwardToCallback(
          std::move(callback)));
  ::mojo::internal::SendMojoMessage(*receiver_, message, std::move(responder));
}

void PolicyPageHandlerProxy::GetAppliedTestPolicies(
    GetAppliedTestPoliciesCallback callback) {
#if BUILDFLAG(MOJO_TRACE_ENABLED)
  TRACE_EVENT0("mojom", "Send policy::mojom::PolicyPageHandler::GetAppliedTestPolicies");
#endif

  const bool kExpectsResponse = true;
  const bool kIsSync = false;
  const bool kAllowInterrupt = true;
  const bool is_urgent = false;

  const uint32_t kFlags =
      ((kExpectsResponse) ? mojo::Message::kFlagExpectsResponse : 0) |
      ((kIsSync) ? mojo::Message::kFlagIsSync : 0) |
      ((kAllowInterrupt) ? 0 : mojo::Message::kFlagNoInterrupt) |
      ((is_urgent) ? mojo::Message::kFlagIsUrgent : 0);

  const size_t estimated_payload_size =
    0;
  mojo::Message message(
      std::to_underlying(messages::PolicyPageHandler::kGetAppliedTestPolicies), kFlags, estimated_payload_size);
  mojo::internal::MessageFragment<
      ::policy::mojom::internal::PolicyPageHandler_GetAppliedTestPolicies_Params_Data> params(
          message);
  params.Allocate();

#if defined(ENABLE_IPC_FUZZER)
  message.set_interface_name(PolicyPageHandler::Name_);
  message.set_method_name("GetAppliedTestPolicies");
#endif
  std::unique_ptr<mojo::MessageReceiver> responder(
      new PolicyPageHandler_GetAppliedTestPolicies_ForwardToCallback(
          std::move(callback)));
  ::mojo::internal::SendMojoMessage(*receiver_, message, std::move(responder));
}

void PolicyPageHandlerProxy::RevertLocalTestPolicies(
    ) {
#if BUILDFLAG(MOJO_TRACE_ENABLED)
  TRACE_EVENT0("mojom", "Send policy::mojom::PolicyPageHandler::RevertLocalTestPolicies");
#endif

  const bool kExpectsResponse = false;
  const bool kIsSync = false;
  const bool kAllowInterrupt = true;
  const bool is_urgent = false;

  const uint32_t kFlags =
      ((kExpectsResponse) ? mojo::Message::kFlagExpectsResponse : 0) |
      ((kIsSync) ? mojo::Message::kFlagIsSync : 0) |
      ((kAllowInterrupt) ? 0 : mojo::Message::kFlagNoInterrupt) |
      ((is_urgent) ? mojo::Message::kFlagIsUrgent : 0);

  const size_t estimated_payload_size =
    0;
  mojo::Message message(
      std::to_underlying(messages::PolicyPageHandler::kRevertLocalTestPolicies), kFlags, estimated_payload_size);
  mojo::internal::MessageFragment<
      ::policy::mojom::internal::PolicyPageHandler_RevertLocalTestPolicies_Params_Data> params(
          message);
  params.Allocate();

#if defined(ENABLE_IPC_FUZZER)
  message.set_interface_name(PolicyPageHandler::Name_);
  message.set_method_name("RevertLocalTestPolicies");
#endif
  // This return value may be ignored as false implies the Connector has
  // encountered an error, which will be visible through other means.
  ::mojo::internal::SendMojoMessage(*receiver_, message);
}

void PolicyPageHandlerProxy::SetLocalTestPolicies(
    const std::string& in_policies, const std::string& in_profile_separation_response, SetLocalTestPoliciesCallback callback) {
#if BUILDFLAG(MOJO_TRACE_ENABLED)
  TRACE_EVENT1(
    "mojom", "Send policy::mojom::PolicyPageHandler::SetLocalTestPolicies", "input_parameters",
    [&](perfetto::TracedValue context){
      auto dict = std::move(context).WriteDictionary();
      perfetto::WriteIntoTracedValueWithFallback(
           dict.AddItem("policies"), in_policies,
                        "<value of type const std::string&>");
      perfetto::WriteIntoTracedValueWithFallback(
           dict.AddItem("profile_separation_response"), in_profile_separation_response,
                        "<value of type const std::string&>");
   });
#endif

  const bool kExpectsResponse = true;
  const bool kIsSync = false;
  const bool kAllowInterrupt = true;
  const bool is_urgent = false;

  const uint32_t kFlags =
      ((kExpectsResponse) ? mojo::Message::kFlagExpectsResponse : 0) |
      ((kIsSync) ? mojo::Message::kFlagIsSync : 0) |
      ((kAllowInterrupt) ? 0 : mojo::Message::kFlagNoInterrupt) |
      ((is_urgent) ? mojo::Message::kFlagIsUrgent : 0);

  const size_t estimated_payload_size =
    0;
  mojo::Message message(
      std::to_underlying(messages::PolicyPageHandler::kSetLocalTestPolicies), kFlags, estimated_payload_size);
  mojo::internal::MessageFragment<
      ::policy::mojom::internal::PolicyPageHandler_SetLocalTestPolicies_Params_Data> params(
          message);
  params.Allocate();
  mojo::internal::MessageFragment<
      typename decltype(params->policies)::BaseType> policies_fragment(
          params.message());
  
  mojo::internal::Serialize<mojo::StringDataView>(
    in_policies,
    policies_fragment);

  params->policies.Set(
      policies_fragment.is_null() ? nullptr : policies_fragment.data());

  
  MOJO_INTERNAL_CHECK_SERIALIZATION(
    mojo::internal::SendValidation::kDefault,
    !(params->policies.is_null()),
    mojo::internal::VALIDATION_ERROR_UNEXPECTED_NULL_POINTER,
    "null policies in PolicyPageHandler.SetLocalTestPolicies request");
  mojo::internal::MessageFragment<
      typename decltype(params->profile_separation_response)::BaseType> profile_separation_response_fragment(
          params.message());
  
  mojo::internal::Serialize<mojo::StringDataView>(
    in_profile_separation_response,
    profile_separation_response_fragment);

  params->profile_separation_response.Set(
      profile_separation_response_fragment.is_null() ? nullptr : profile_separation_response_fragment.data());

  
  MOJO_INTERNAL_CHECK_SERIALIZATION(
    mojo::internal::SendValidation::kDefault,
    !(params->profile_separation_response.is_null()),
    mojo::internal::VALIDATION_ERROR_UNEXPECTED_NULL_POINTER,
    "null profile_separation_response in PolicyPageHandler.SetLocalTestPolicies request");

#if defined(ENABLE_IPC_FUZZER)
  message.set_interface_name(PolicyPageHandler::Name_);
  message.set_method_name("SetLocalTestPolicies");
#endif
  std::unique_ptr<mojo::MessageReceiver> responder(
      new PolicyPageHandler_SetLocalTestPolicies_ForwardToCallback(
          std::move(callback)));
  ::mojo::internal::SendMojoMessage(*receiver_, message, std::move(responder));
}

void PolicyPageHandlerProxy::GetPolicyLogs(
    GetPolicyLogsCallback callback) {
#if BUILDFLAG(MOJO_TRACE_ENABLED)
  TRACE_EVENT0("mojom", "Send policy::mojom::PolicyPageHandler::GetPolicyLogs");
#endif

  const bool kExpectsResponse = true;
  const bool kIsSync = false;
  const bool kAllowInterrupt = true;
  const bool is_urgent = false;

  const uint32_t kFlags =
      ((kExpectsResponse) ? mojo::Message::kFlagExpectsResponse : 0) |
      ((kIsSync) ? mojo::Message::kFlagIsSync : 0) |
      ((kAllowInterrupt) ? 0 : mojo::Message::kFlagNoInterrupt) |
      ((is_urgent) ? mojo::Message::kFlagIsUrgent : 0);

  const size_t estimated_payload_size =
    0;
  mojo::Message message(
      std::to_underlying(messages::PolicyPageHandler::kGetPolicyLogs), kFlags, estimated_payload_size);
  mojo::internal::MessageFragment<
      ::policy::mojom::internal::PolicyPageHandler_GetPolicyLogs_Params_Data> params(
          message);
  params.Allocate();

#if defined(ENABLE_IPC_FUZZER)
  message.set_interface_name(PolicyPageHandler::Name_);
  message.set_method_name("GetPolicyLogs");
#endif
  std::unique_ptr<mojo::MessageReceiver> responder(
      new PolicyPageHandler_GetPolicyLogs_ForwardToCallback(
          std::move(callback)));
  ::mojo::internal::SendMojoMessage(*receiver_, message, std::move(responder));
}

void PolicyPageHandlerProxy::GetPoliciesJson(
    GetPoliciesReason in_reason, GetPoliciesJsonCallback callback) {
#if BUILDFLAG(MOJO_TRACE_ENABLED)
  TRACE_EVENT1(
    "mojom", "Send policy::mojom::PolicyPageHandler::GetPoliciesJson", "input_parameters",
    [&](perfetto::TracedValue context){
      auto dict = std::move(context).WriteDictionary();
      perfetto::WriteIntoTracedValueWithFallback(
           dict.AddItem("reason"), in_reason,
                        "<value of type GetPoliciesReason>");
   });
#endif

  const bool kExpectsResponse = true;
  const bool kIsSync = false;
  const bool kAllowInterrupt = true;
  const bool is_urgent = false;

  const uint32_t kFlags =
      ((kExpectsResponse) ? mojo::Message::kFlagExpectsResponse : 0) |
      ((kIsSync) ? mojo::Message::kFlagIsSync : 0) |
      ((kAllowInterrupt) ? 0 : mojo::Message::kFlagNoInterrupt) |
      ((is_urgent) ? mojo::Message::kFlagIsUrgent : 0);

  const size_t estimated_payload_size =
    0;
  mojo::Message message(
      std::to_underlying(messages::PolicyPageHandler::kGetPoliciesJson), kFlags, estimated_payload_size);
  mojo::internal::MessageFragment<
      ::policy::mojom::internal::PolicyPageHandler_GetPoliciesJson_Params_Data> params(
          message);
  params.Allocate();

  
  mojo::internal::Serialize<::policy::mojom::GetPoliciesReason>(
    in_reason,
    &params->reason);

#if defined(ENABLE_IPC_FUZZER)
  message.set_interface_name(PolicyPageHandler::Name_);
  message.set_method_name("GetPoliciesJson");
#endif
  std::unique_ptr<mojo::MessageReceiver> responder(
      new PolicyPageHandler_GetPoliciesJson_ForwardToCallback(
          std::move(callback)));
  ::mojo::internal::SendMojoMessage(*receiver_, message, std::move(responder));
}
class PolicyPageHandler_GetDebugString_ProxyToResponder : public ::mojo::internal::ProxyToResponder {
 public:
  static PolicyPageHandler::GetDebugStringCallback CreateCallback(
      ::mojo::Message& message,
      std::unique_ptr<mojo::MessageReceiverWithStatus> responder) {
    std::unique_ptr<PolicyPageHandler_GetDebugString_ProxyToResponder> proxy(
        new PolicyPageHandler_GetDebugString_ProxyToResponder(
            message, std::move(responder)));
    return base::BindOnce(&PolicyPageHandler_GetDebugString_ProxyToResponder::Run,
                          std::move(proxy));
  }

  ~PolicyPageHandler_GetDebugString_ProxyToResponder() {
#if DCHECK_IS_ON()
    if (responder_) {
      // If we're being destroyed without being run, we want to ensure the
      // binding endpoint has been closed. This checks for that asynchronously.
      // We pass a bound generated callback to handle the response so that any
      // resulting DCHECK stack will have useful interface type information.
      // Instantiate a ScopedFizzleBlockShutdownTasks to allow this request to
      // fizzle if this happens after shutdown and the endpoint is bound to a
      // BLOCK_SHUTDOWN sequence.
      base::ThreadPoolInstance::ScopedFizzleBlockShutdownTasks fizzler;
      responder_->IsConnectedAsync(base::BindOnce(&OnIsConnectedComplete));
    }
#endif
  }

 private:
  PolicyPageHandler_GetDebugString_ProxyToResponder(
      ::mojo::Message& message,
      std::unique_ptr<mojo::MessageReceiverWithStatus> responder)
      : ::mojo::internal::ProxyToResponder(message, std::move(responder)) {
  }

#if DCHECK_IS_ON()
  static void OnIsConnectedComplete(bool connected) {
    DCHECK(!connected)
        << "PolicyPageHandler::GetDebugStringCallback was destroyed without "
        << "first either being run or its corresponding binding being closed. "
        << "It is an error to drop response callbacks which still correspond "
        << "to an open interface pipe.";
  }
#endif

  void Run(
      const std::string& in_message);
};

bool PolicyPageHandler_GetDebugString_ForwardToCallback::Accept(
    mojo::Message* message) {
  DCHECK(message->is_serialized());
  internal::PolicyPageHandler_GetDebugString_ResponseParams_Data* params =
      reinterpret_cast<
          internal::PolicyPageHandler_GetDebugString_ResponseParams_Data*>(
              message->mutable_payload());
  

  // Validation for PolicyPageHandler.0
  bool success = true;
  std::string p_message{};
  PolicyPageHandler_GetDebugString_ResponseParamsDataView input_data_view(params, message);
  
  if (success && !input_data_view.ReadMessage(&p_message))
    success = false;
  if (!success) {
    ReportValidationErrorForMessage(
        message,
        mojo::internal::VALIDATION_ERROR_DESERIALIZATION_FAILED,
        PolicyPageHandler::Name_, 0, true);
    return false;
  }
  if (!callback_.is_null()) {
    std::move(callback_).Run(
std::move(p_message));
  }
  return true;
}

void PolicyPageHandler_GetDebugString_ProxyToResponder::Run(
    const std::string& in_message) {
#if BUILDFLAG(MOJO_TRACE_ENABLED)
  TRACE_EVENT1(
    "mojom", "Send reply policy::mojom::PolicyPageHandler::GetDebugString", "async_response_parameters",
    [&](perfetto::TracedValue context){
      auto dict = std::move(context).WriteDictionary();
      perfetto::WriteIntoTracedValueWithFallback(
           dict.AddItem("message"), in_message,
                        "<value of type const std::string&>");
   });
#endif

  const uint32_t kFlags = mojo::Message::kFlagIsResponse |
      ((is_sync_) ? mojo::Message::kFlagIsSync : 0) |
      ((true) ? 0 : mojo::Message::kFlagNoInterrupt) |
      ((false) ? mojo::Message::kFlagIsUrgent : 0);

  const size_t estimated_payload_size =
    0;
  mojo::Message message(
      std::to_underlying(messages::PolicyPageHandler::kGetDebugString), kFlags, estimated_payload_size);
  mojo::internal::MessageFragment<
      ::policy::mojom::internal::PolicyPageHandler_GetDebugString_ResponseParams_Data> params(
          message);
  params.Allocate();
  mojo::internal::MessageFragment<
      typename decltype(params->message)::BaseType> message_fragment(
          params.message());
  
  mojo::internal::Serialize<mojo::StringDataView>(
    in_message,
    message_fragment);

  params->message.Set(
      message_fragment.is_null() ? nullptr : message_fragment.data());

  
  MOJO_INTERNAL_CHECK_SERIALIZATION(
    mojo::internal::SendValidation::kDefault,
    !(params->message.is_null()),
    mojo::internal::VALIDATION_ERROR_UNEXPECTED_NULL_POINTER,
    "null message in ");

#if defined(ENABLE_IPC_FUZZER)
  message.set_interface_name(PolicyPageHandler::Name_);
  message.set_method_name("GetDebugString");
#endif

  message.set_request_id(request_id_);
  message.set_trace_nonce(trace_nonce_);
  ::mojo::internal::SendMojoMessage(*responder_, message);
  // SendMojoMessage() fails silently if the responder connection is closed,
  // or if the message is malformed.
  //
  // TODO(darin): If Accept() returns false due to a malformed message, that
  // may be good reason to close the connection. However, we don't have a
  // way to do that from here. We should add a way.
  responder_ = nullptr;
}
class PolicyPageHandler_SetUserAffiliated_ProxyToResponder : public ::mojo::internal::ProxyToResponder {
 public:
  static PolicyPageHandler::SetUserAffiliatedCallback CreateCallback(
      ::mojo::Message& message,
      std::unique_ptr<mojo::MessageReceiverWithStatus> responder) {
    std::unique_ptr<PolicyPageHandler_SetUserAffiliated_ProxyToResponder> proxy(
        new PolicyPageHandler_SetUserAffiliated_ProxyToResponder(
            message, std::move(responder)));
    return base::BindOnce(&PolicyPageHandler_SetUserAffiliated_ProxyToResponder::Run,
                          std::move(proxy));
  }

  ~PolicyPageHandler_SetUserAffiliated_ProxyToResponder() {
#if DCHECK_IS_ON()
    if (responder_) {
      // If we're being destroyed without being run, we want to ensure the
      // binding endpoint has been closed. This checks for that asynchronously.
      // We pass a bound generated callback to handle the response so that any
      // resulting DCHECK stack will have useful interface type information.
      // Instantiate a ScopedFizzleBlockShutdownTasks to allow this request to
      // fizzle if this happens after shutdown and the endpoint is bound to a
      // BLOCK_SHUTDOWN sequence.
      base::ThreadPoolInstance::ScopedFizzleBlockShutdownTasks fizzler;
      responder_->IsConnectedAsync(base::BindOnce(&OnIsConnectedComplete));
    }
#endif
  }

 private:
  PolicyPageHandler_SetUserAffiliated_ProxyToResponder(
      ::mojo::Message& message,
      std::unique_ptr<mojo::MessageReceiverWithStatus> responder)
      : ::mojo::internal::ProxyToResponder(message, std::move(responder)) {
  }

#if DCHECK_IS_ON()
  static void OnIsConnectedComplete(bool connected) {
    DCHECK(!connected)
        << "PolicyPageHandler::SetUserAffiliatedCallback was destroyed without "
        << "first either being run or its corresponding binding being closed. "
        << "It is an error to drop response callbacks which still correspond "
        << "to an open interface pipe.";
  }
#endif

  void Run(
      );
};

bool PolicyPageHandler_SetUserAffiliated_ForwardToCallback::Accept(
    mojo::Message* message) {
  DCHECK(message->is_serialized());
  internal::PolicyPageHandler_SetUserAffiliated_ResponseParams_Data* params =
      reinterpret_cast<
          internal::PolicyPageHandler_SetUserAffiliated_ResponseParams_Data*>(
              message->mutable_payload());
  

  // Validation for PolicyPageHandler.2
  bool success = true;
  PolicyPageHandler_SetUserAffiliated_ResponseParamsDataView input_data_view(params, message);
  
  if (!success) {
    ReportValidationErrorForMessage(
        message,
        mojo::internal::VALIDATION_ERROR_DESERIALIZATION_FAILED,
        PolicyPageHandler::Name_, 2, true);
    return false;
  }
  if (!callback_.is_null()) {
    std::move(callback_).Run();
  }
  return true;
}

void PolicyPageHandler_SetUserAffiliated_ProxyToResponder::Run(
    ) {
#if BUILDFLAG(MOJO_TRACE_ENABLED)
  TRACE_EVENT0("mojom", "Send reply policy::mojom::PolicyPageHandler::SetUserAffiliated");
#endif

  const uint32_t kFlags = mojo::Message::kFlagIsResponse |
      ((is_sync_) ? mojo::Message::kFlagIsSync : 0) |
      ((true) ? 0 : mojo::Message::kFlagNoInterrupt) |
      ((false) ? mojo::Message::kFlagIsUrgent : 0);

  const size_t estimated_payload_size =
    0;
  mojo::Message message(
      std::to_underlying(messages::PolicyPageHandler::kSetUserAffiliated), kFlags, estimated_payload_size);
  mojo::internal::MessageFragment<
      ::policy::mojom::internal::PolicyPageHandler_SetUserAffiliated_ResponseParams_Data> params(
          message);
  params.Allocate();

#if defined(ENABLE_IPC_FUZZER)
  message.set_interface_name(PolicyPageHandler::Name_);
  message.set_method_name("SetUserAffiliated");
#endif

  message.set_request_id(request_id_);
  message.set_trace_nonce(trace_nonce_);
  ::mojo::internal::SendMojoMessage(*responder_, message);
  // SendMojoMessage() fails silently if the responder connection is closed,
  // or if the message is malformed.
  //
  // TODO(darin): If Accept() returns false due to a malformed message, that
  // may be good reason to close the connection. However, we don't have a
  // way to do that from here. We should add a way.
  responder_ = nullptr;
}
class PolicyPageHandler_GetAppliedTestPolicies_ProxyToResponder : public ::mojo::internal::ProxyToResponder {
 public:
  static PolicyPageHandler::GetAppliedTestPoliciesCallback CreateCallback(
      ::mojo::Message& message,
      std::unique_ptr<mojo::MessageReceiverWithStatus> responder) {
    std::unique_ptr<PolicyPageHandler_GetAppliedTestPolicies_ProxyToResponder> proxy(
        new PolicyPageHandler_GetAppliedTestPolicies_ProxyToResponder(
            message, std::move(responder)));
    return base::BindOnce(&PolicyPageHandler_GetAppliedTestPolicies_ProxyToResponder::Run,
                          std::move(proxy));
  }

  ~PolicyPageHandler_GetAppliedTestPolicies_ProxyToResponder() {
#if DCHECK_IS_ON()
    if (responder_) {
      // If we're being destroyed without being run, we want to ensure the
      // binding endpoint has been closed. This checks for that asynchronously.
      // We pass a bound generated callback to handle the response so that any
      // resulting DCHECK stack will have useful interface type information.
      // Instantiate a ScopedFizzleBlockShutdownTasks to allow this request to
      // fizzle if this happens after shutdown and the endpoint is bound to a
      // BLOCK_SHUTDOWN sequence.
      base::ThreadPoolInstance::ScopedFizzleBlockShutdownTasks fizzler;
      responder_->IsConnectedAsync(base::BindOnce(&OnIsConnectedComplete));
    }
#endif
  }

 private:
  PolicyPageHandler_GetAppliedTestPolicies_ProxyToResponder(
      ::mojo::Message& message,
      std::unique_ptr<mojo::MessageReceiverWithStatus> responder)
      : ::mojo::internal::ProxyToResponder(message, std::move(responder)) {
  }

#if DCHECK_IS_ON()
  static void OnIsConnectedComplete(bool connected) {
    DCHECK(!connected)
        << "PolicyPageHandler::GetAppliedTestPoliciesCallback was destroyed without "
        << "first either being run or its corresponding binding being closed. "
        << "It is an error to drop response callbacks which still correspond "
        << "to an open interface pipe.";
  }
#endif

  void Run(
      const std::string& in_policies);
};

bool PolicyPageHandler_GetAppliedTestPolicies_ForwardToCallback::Accept(
    mojo::Message* message) {
  DCHECK(message->is_serialized());
  internal::PolicyPageHandler_GetAppliedTestPolicies_ResponseParams_Data* params =
      reinterpret_cast<
          internal::PolicyPageHandler_GetAppliedTestPolicies_ResponseParams_Data*>(
              message->mutable_payload());
  

  // Validation for PolicyPageHandler.3
  bool success = true;
  std::string p_policies{};
  PolicyPageHandler_GetAppliedTestPolicies_ResponseParamsDataView input_data_view(params, message);
  
  if (success && !input_data_view.ReadPolicies(&p_policies))
    success = false;
  if (!success) {
    ReportValidationErrorForMessage(
        message,
        mojo::internal::VALIDATION_ERROR_DESERIALIZATION_FAILED,
        PolicyPageHandler::Name_, 3, true);
    return false;
  }
  if (!callback_.is_null()) {
    std::move(callback_).Run(
std::move(p_policies));
  }
  return true;
}

void PolicyPageHandler_GetAppliedTestPolicies_ProxyToResponder::Run(
    const std::string& in_policies) {
#if BUILDFLAG(MOJO_TRACE_ENABLED)
  TRACE_EVENT1(
    "mojom", "Send reply policy::mojom::PolicyPageHandler::GetAppliedTestPolicies", "async_response_parameters",
    [&](perfetto::TracedValue context){
      auto dict = std::move(context).WriteDictionary();
      perfetto::WriteIntoTracedValueWithFallback(
           dict.AddItem("policies"), in_policies,
                        "<value of type const std::string&>");
   });
#endif

  const uint32_t kFlags = mojo::Message::kFlagIsResponse |
      ((is_sync_) ? mojo::Message::kFlagIsSync : 0) |
      ((true) ? 0 : mojo::Message::kFlagNoInterrupt) |
      ((false) ? mojo::Message::kFlagIsUrgent : 0);

  const size_t estimated_payload_size =
    0;
  mojo::Message message(
      std::to_underlying(messages::PolicyPageHandler::kGetAppliedTestPolicies), kFlags, estimated_payload_size);
  mojo::internal::MessageFragment<
      ::policy::mojom::internal::PolicyPageHandler_GetAppliedTestPolicies_ResponseParams_Data> params(
          message);
  params.Allocate();
  mojo::internal::MessageFragment<
      typename decltype(params->policies)::BaseType> policies_fragment(
          params.message());
  
  mojo::internal::Serialize<mojo::StringDataView>(
    in_policies,
    policies_fragment);

  params->policies.Set(
      policies_fragment.is_null() ? nullptr : policies_fragment.data());

  
  MOJO_INTERNAL_CHECK_SERIALIZATION(
    mojo::internal::SendValidation::kDefault,
    !(params->policies.is_null()),
    mojo::internal::VALIDATION_ERROR_UNEXPECTED_NULL_POINTER,
    "null policies in ");

#if defined(ENABLE_IPC_FUZZER)
  message.set_interface_name(PolicyPageHandler::Name_);
  message.set_method_name("GetAppliedTestPolicies");
#endif

  message.set_request_id(request_id_);
  message.set_trace_nonce(trace_nonce_);
  ::mojo::internal::SendMojoMessage(*responder_, message);
  // SendMojoMessage() fails silently if the responder connection is closed,
  // or if the message is malformed.
  //
  // TODO(darin): If Accept() returns false due to a malformed message, that
  // may be good reason to close the connection. However, we don't have a
  // way to do that from here. We should add a way.
  responder_ = nullptr;
}
class PolicyPageHandler_SetLocalTestPolicies_ProxyToResponder : public ::mojo::internal::ProxyToResponder {
 public:
  static PolicyPageHandler::SetLocalTestPoliciesCallback CreateCallback(
      ::mojo::Message& message,
      std::unique_ptr<mojo::MessageReceiverWithStatus> responder) {
    std::unique_ptr<PolicyPageHandler_SetLocalTestPolicies_ProxyToResponder> proxy(
        new PolicyPageHandler_SetLocalTestPolicies_ProxyToResponder(
            message, std::move(responder)));
    return base::BindOnce(&PolicyPageHandler_SetLocalTestPolicies_ProxyToResponder::Run,
                          std::move(proxy));
  }

  ~PolicyPageHandler_SetLocalTestPolicies_ProxyToResponder() {
#if DCHECK_IS_ON()
    if (responder_) {
      // If we're being destroyed without being run, we want to ensure the
      // binding endpoint has been closed. This checks for that asynchronously.
      // We pass a bound generated callback to handle the response so that any
      // resulting DCHECK stack will have useful interface type information.
      // Instantiate a ScopedFizzleBlockShutdownTasks to allow this request to
      // fizzle if this happens after shutdown and the endpoint is bound to a
      // BLOCK_SHUTDOWN sequence.
      base::ThreadPoolInstance::ScopedFizzleBlockShutdownTasks fizzler;
      responder_->IsConnectedAsync(base::BindOnce(&OnIsConnectedComplete));
    }
#endif
  }

 private:
  PolicyPageHandler_SetLocalTestPolicies_ProxyToResponder(
      ::mojo::Message& message,
      std::unique_ptr<mojo::MessageReceiverWithStatus> responder)
      : ::mojo::internal::ProxyToResponder(message, std::move(responder)) {
  }

#if DCHECK_IS_ON()
  static void OnIsConnectedComplete(bool connected) {
    DCHECK(!connected)
        << "PolicyPageHandler::SetLocalTestPoliciesCallback was destroyed without "
        << "first either being run or its corresponding binding being closed. "
        << "It is an error to drop response callbacks which still correspond "
        << "to an open interface pipe.";
  }
#endif

  void Run(
      );
};

bool PolicyPageHandler_SetLocalTestPolicies_ForwardToCallback::Accept(
    mojo::Message* message) {
  DCHECK(message->is_serialized());
  internal::PolicyPageHandler_SetLocalTestPolicies_ResponseParams_Data* params =
      reinterpret_cast<
          internal::PolicyPageHandler_SetLocalTestPolicies_ResponseParams_Data*>(
              message->mutable_payload());
  

  // Validation for PolicyPageHandler.5
  bool success = true;
  PolicyPageHandler_SetLocalTestPolicies_ResponseParamsDataView input_data_view(params, message);
  
  if (!success) {
    ReportValidationErrorForMessage(
        message,
        mojo::internal::VALIDATION_ERROR_DESERIALIZATION_FAILED,
        PolicyPageHandler::Name_, 5, true);
    return false;
  }
  if (!callback_.is_null()) {
    std::move(callback_).Run();
  }
  return true;
}

void PolicyPageHandler_SetLocalTestPolicies_ProxyToResponder::Run(
    ) {
#if BUILDFLAG(MOJO_TRACE_ENABLED)
  TRACE_EVENT0("mojom", "Send reply policy::mojom::PolicyPageHandler::SetLocalTestPolicies");
#endif

  const uint32_t kFlags = mojo::Message::kFlagIsResponse |
      ((is_sync_) ? mojo::Message::kFlagIsSync : 0) |
      ((true) ? 0 : mojo::Message::kFlagNoInterrupt) |
      ((false) ? mojo::Message::kFlagIsUrgent : 0);

  const size_t estimated_payload_size =
    0;
  mojo::Message message(
      std::to_underlying(messages::PolicyPageHandler::kSetLocalTestPolicies), kFlags, estimated_payload_size);
  mojo::internal::MessageFragment<
      ::policy::mojom::internal::PolicyPageHandler_SetLocalTestPolicies_ResponseParams_Data> params(
          message);
  params.Allocate();

#if defined(ENABLE_IPC_FUZZER)
  message.set_interface_name(PolicyPageHandler::Name_);
  message.set_method_name("SetLocalTestPolicies");
#endif

  message.set_request_id(request_id_);
  message.set_trace_nonce(trace_nonce_);
  ::mojo::internal::SendMojoMessage(*responder_, message);
  // SendMojoMessage() fails silently if the responder connection is closed,
  // or if the message is malformed.
  //
  // TODO(darin): If Accept() returns false due to a malformed message, that
  // may be good reason to close the connection. However, we don't have a
  // way to do that from here. We should add a way.
  responder_ = nullptr;
}
class PolicyPageHandler_GetPolicyLogs_ProxyToResponder : public ::mojo::internal::ProxyToResponder {
 public:
  static PolicyPageHandler::GetPolicyLogsCallback CreateCallback(
      ::mojo::Message& message,
      std::unique_ptr<mojo::MessageReceiverWithStatus> responder) {
    std::unique_ptr<PolicyPageHandler_GetPolicyLogs_ProxyToResponder> proxy(
        new PolicyPageHandler_GetPolicyLogs_ProxyToResponder(
            message, std::move(responder)));
    return base::BindOnce(&PolicyPageHandler_GetPolicyLogs_ProxyToResponder::Run,
                          std::move(proxy));
  }

  ~PolicyPageHandler_GetPolicyLogs_ProxyToResponder() {
#if DCHECK_IS_ON()
    if (responder_) {
      // If we're being destroyed without being run, we want to ensure the
      // binding endpoint has been closed. This checks for that asynchronously.
      // We pass a bound generated callback to handle the response so that any
      // resulting DCHECK stack will have useful interface type information.
      // Instantiate a ScopedFizzleBlockShutdownTasks to allow this request to
      // fizzle if this happens after shutdown and the endpoint is bound to a
      // BLOCK_SHUTDOWN sequence.
      base::ThreadPoolInstance::ScopedFizzleBlockShutdownTasks fizzler;
      responder_->IsConnectedAsync(base::BindOnce(&OnIsConnectedComplete));
    }
#endif
  }

 private:
  PolicyPageHandler_GetPolicyLogs_ProxyToResponder(
      ::mojo::Message& message,
      std::unique_ptr<mojo::MessageReceiverWithStatus> responder)
      : ::mojo::internal::ProxyToResponder(message, std::move(responder)) {
  }

#if DCHECK_IS_ON()
  static void OnIsConnectedComplete(bool connected) {
    DCHECK(!connected)
        << "PolicyPageHandler::GetPolicyLogsCallback was destroyed without "
        << "first either being run or its corresponding binding being closed. "
        << "It is an error to drop response callbacks which still correspond "
        << "to an open interface pipe.";
  }
#endif

  void Run(
      std::vector<LogPtr> in_policy_logs);
};

bool PolicyPageHandler_GetPolicyLogs_ForwardToCallback::Accept(
    mojo::Message* message) {
  DCHECK(message->is_serialized());
  internal::PolicyPageHandler_GetPolicyLogs_ResponseParams_Data* params =
      reinterpret_cast<
          internal::PolicyPageHandler_GetPolicyLogs_ResponseParams_Data*>(
              message->mutable_payload());
  

  // Validation for PolicyPageHandler.6
  bool success = true;
  std::vector<LogPtr> p_policy_logs{};
  PolicyPageHandler_GetPolicyLogs_ResponseParamsDataView input_data_view(params, message);
  
  if (success && !input_data_view.ReadPolicyLogs(&p_policy_logs))
    success = false;
  if (!success) {
    ReportValidationErrorForMessage(
        message,
        mojo::internal::VALIDATION_ERROR_DESERIALIZATION_FAILED,
        PolicyPageHandler::Name_, 6, true);
    return false;
  }
  if (!callback_.is_null()) {
    std::move(callback_).Run(
std::move(p_policy_logs));
  }
  return true;
}

void PolicyPageHandler_GetPolicyLogs_ProxyToResponder::Run(
    std::vector<LogPtr> in_policy_logs) {
#if BUILDFLAG(MOJO_TRACE_ENABLED)
  TRACE_EVENT1(
    "mojom", "Send reply policy::mojom::PolicyPageHandler::GetPolicyLogs", "async_response_parameters",
    [&](perfetto::TracedValue context){
      auto dict = std::move(context).WriteDictionary();
      perfetto::WriteIntoTracedValueWithFallback(
           dict.AddItem("policy_logs"), in_policy_logs,
                        "<value of type std::vector<LogPtr>>");
   });
#endif

  const uint32_t kFlags = mojo::Message::kFlagIsResponse |
      ((is_sync_) ? mojo::Message::kFlagIsSync : 0) |
      ((true) ? 0 : mojo::Message::kFlagNoInterrupt) |
      ((false) ? mojo::Message::kFlagIsUrgent : 0);

  const size_t estimated_payload_size =
    0;
  mojo::Message message(
      std::to_underlying(messages::PolicyPageHandler::kGetPolicyLogs), kFlags, estimated_payload_size);
  mojo::internal::MessageFragment<
      ::policy::mojom::internal::PolicyPageHandler_GetPolicyLogs_ResponseParams_Data> params(
          message);
  params.Allocate();
  mojo::internal::MessageFragment<
      typename decltype(params->policy_logs)::BaseType>
      policy_logs_fragment(params.message());
  constexpr const mojo::internal::ContainerValidateParams& policy_logs_validate_params =
      mojo::internal::GetArrayValidator<0, false, nullptr>();
  
  mojo::internal::Serialize<mojo::ArrayDataView<::policy::mojom::LogDataView>>(
    in_policy_logs,
    policy_logs_fragment,
    &policy_logs_validate_params);

  params->policy_logs.Set(
      policy_logs_fragment.is_null() ? nullptr : policy_logs_fragment.data());

  
  MOJO_INTERNAL_CHECK_SERIALIZATION(
    mojo::internal::SendValidation::kDefault,
    !(params->policy_logs.is_null()),
    mojo::internal::VALIDATION_ERROR_UNEXPECTED_NULL_POINTER,
    "null policy_logs in ");

#if defined(ENABLE_IPC_FUZZER)
  message.set_interface_name(PolicyPageHandler::Name_);
  message.set_method_name("GetPolicyLogs");
#endif

  message.set_request_id(request_id_);
  message.set_trace_nonce(trace_nonce_);
  ::mojo::internal::SendMojoMessage(*responder_, message);
  // SendMojoMessage() fails silently if the responder connection is closed,
  // or if the message is malformed.
  //
  // TODO(darin): If Accept() returns false due to a malformed message, that
  // may be good reason to close the connection. However, we don't have a
  // way to do that from here. We should add a way.
  responder_ = nullptr;
}
class PolicyPageHandler_GetPoliciesJson_ProxyToResponder : public ::mojo::internal::ProxyToResponder {
 public:
  static PolicyPageHandler::GetPoliciesJsonCallback CreateCallback(
      ::mojo::Message& message,
      std::unique_ptr<mojo::MessageReceiverWithStatus> responder) {
    std::unique_ptr<PolicyPageHandler_GetPoliciesJson_ProxyToResponder> proxy(
        new PolicyPageHandler_GetPoliciesJson_ProxyToResponder(
            message, std::move(responder)));
    return base::BindOnce(&PolicyPageHandler_GetPoliciesJson_ProxyToResponder::Run,
                          std::move(proxy));
  }

  ~PolicyPageHandler_GetPoliciesJson_ProxyToResponder() {
#if DCHECK_IS_ON()
    if (responder_) {
      // If we're being destroyed without being run, we want to ensure the
      // binding endpoint has been closed. This checks for that asynchronously.
      // We pass a bound generated callback to handle the response so that any
      // resulting DCHECK stack will have useful interface type information.
      // Instantiate a ScopedFizzleBlockShutdownTasks to allow this request to
      // fizzle if this happens after shutdown and the endpoint is bound to a
      // BLOCK_SHUTDOWN sequence.
      base::ThreadPoolInstance::ScopedFizzleBlockShutdownTasks fizzler;
      responder_->IsConnectedAsync(base::BindOnce(&OnIsConnectedComplete));
    }
#endif
  }

 private:
  PolicyPageHandler_GetPoliciesJson_ProxyToResponder(
      ::mojo::Message& message,
      std::unique_ptr<mojo::MessageReceiverWithStatus> responder)
      : ::mojo::internal::ProxyToResponder(message, std::move(responder)) {
  }

#if DCHECK_IS_ON()
  static void OnIsConnectedComplete(bool connected) {
    DCHECK(!connected)
        << "PolicyPageHandler::GetPoliciesJsonCallback was destroyed without "
        << "first either being run or its corresponding binding being closed. "
        << "It is an error to drop response callbacks which still correspond "
        << "to an open interface pipe.";
  }
#endif

  void Run(
      const std::string& in_policies_json);
};

bool PolicyPageHandler_GetPoliciesJson_ForwardToCallback::Accept(
    mojo::Message* message) {
  DCHECK(message->is_serialized());
  internal::PolicyPageHandler_GetPoliciesJson_ResponseParams_Data* params =
      reinterpret_cast<
          internal::PolicyPageHandler_GetPoliciesJson_ResponseParams_Data*>(
              message->mutable_payload());
  

  // Validation for PolicyPageHandler.7
  bool success = true;
  std::string p_policies_json{};
  PolicyPageHandler_GetPoliciesJson_ResponseParamsDataView input_data_view(params, message);
  
  if (success && !input_data_view.ReadPoliciesJson(&p_policies_json))
    success = false;
  if (!success) {
    ReportValidationErrorForMessage(
        message,
        mojo::internal::VALIDATION_ERROR_DESERIALIZATION_FAILED,
        PolicyPageHandler::Name_, 7, true);
    return false;
  }
  if (!callback_.is_null()) {
    std::move(callback_).Run(
std::move(p_policies_json));
  }
  return true;
}

void PolicyPageHandler_GetPoliciesJson_ProxyToResponder::Run(
    const std::string& in_policies_json) {
#if BUILDFLAG(MOJO_TRACE_ENABLED)
  TRACE_EVENT1(
    "mojom", "Send reply policy::mojom::PolicyPageHandler::GetPoliciesJson", "async_response_parameters",
    [&](perfetto::TracedValue context){
      auto dict = std::move(context).WriteDictionary();
      perfetto::WriteIntoTracedValueWithFallback(
           dict.AddItem("policies_json"), in_policies_json,
                        "<value of type const std::string&>");
   });
#endif

  const uint32_t kFlags = mojo::Message::kFlagIsResponse |
      ((is_sync_) ? mojo::Message::kFlagIsSync : 0) |
      ((true) ? 0 : mojo::Message::kFlagNoInterrupt) |
      ((false) ? mojo::Message::kFlagIsUrgent : 0);

  const size_t estimated_payload_size =
    0;
  mojo::Message message(
      std::to_underlying(messages::PolicyPageHandler::kGetPoliciesJson), kFlags, estimated_payload_size);
  mojo::internal::MessageFragment<
      ::policy::mojom::internal::PolicyPageHandler_GetPoliciesJson_ResponseParams_Data> params(
          message);
  params.Allocate();
  mojo::internal::MessageFragment<
      typename decltype(params->policies_json)::BaseType> policies_json_fragment(
          params.message());
  
  mojo::internal::Serialize<mojo::StringDataView>(
    in_policies_json,
    policies_json_fragment);

  params->policies_json.Set(
      policies_json_fragment.is_null() ? nullptr : policies_json_fragment.data());

  
  MOJO_INTERNAL_CHECK_SERIALIZATION(
    mojo::internal::SendValidation::kDefault,
    !(params->policies_json.is_null()),
    mojo::internal::VALIDATION_ERROR_UNEXPECTED_NULL_POINTER,
    "null policies_json in ");

#if defined(ENABLE_IPC_FUZZER)
  message.set_interface_name(PolicyPageHandler::Name_);
  message.set_method_name("GetPoliciesJson");
#endif

  message.set_request_id(request_id_);
  message.set_trace_nonce(trace_nonce_);
  ::mojo::internal::SendMojoMessage(*responder_, message);
  // SendMojoMessage() fails silently if the responder connection is closed,
  // or if the message is malformed.
  //
  // TODO(darin): If Accept() returns false due to a malformed message, that
  // may be good reason to close the connection. However, we don't have a
  // way to do that from here. We should add a way.
  responder_ = nullptr;
}

// static
bool PolicyPageHandlerStubDispatch::Accept(
    PolicyPageHandler* impl,
    mojo::Message* message) {
  switch (static_cast<messages::PolicyPageHandler>(message->header()->name)) {
    case messages::PolicyPageHandler::kGetDebugString: {
      break;
    }
    case messages::PolicyPageHandler::kRestartBrowser: {
      DCHECK(message->is_serialized());
      internal::PolicyPageHandler_RestartBrowser_Params_Data* params =
          reinterpret_cast<internal::PolicyPageHandler_RestartBrowser_Params_Data*>(
              message->mutable_payload());
      

      // Validation for PolicyPageHandler.1
      bool success = true;
      std::string p_policies{};
      PolicyPageHandler_RestartBrowser_ParamsDataView input_data_view(params, message);
      
      if (success && !input_data_view.ReadPolicies(&p_policies))
        success = false;
      if (!success) {
        ReportValidationErrorForMessage(
            message,
            mojo::internal::VALIDATION_ERROR_DESERIALIZATION_FAILED,
            PolicyPageHandler::Name_, 1, false);
        return false;
      }
      // A null |impl| means no implementation was bound.
      DCHECK(impl);
      impl->RestartBrowser(        
        std::move(p_policies));
      return true;
    }
    case messages::PolicyPageHandler::kSetUserAffiliated: {
      break;
    }
    case messages::PolicyPageHandler::kGetAppliedTestPolicies: {
      break;
    }
    case messages::PolicyPageHandler::kRevertLocalTestPolicies: {
      DCHECK(message->is_serialized());
      internal::PolicyPageHandler_RevertLocalTestPolicies_Params_Data* params =
          reinterpret_cast<internal::PolicyPageHandler_RevertLocalTestPolicies_Params_Data*>(
              message->mutable_payload());
      

      // Validation for PolicyPageHandler.4
      bool success = true;
      PolicyPageHandler_RevertLocalTestPolicies_ParamsDataView input_data_view(params, message);
      
      if (!success) {
        ReportValidationErrorForMessage(
            message,
            mojo::internal::VALIDATION_ERROR_DESERIALIZATION_FAILED,
            PolicyPageHandler::Name_, 4, false);
        return false;
      }
      // A null |impl| means no implementation was bound.
      DCHECK(impl);
      impl->RevertLocalTestPolicies(        );
      return true;
    }
    case messages::PolicyPageHandler::kSetLocalTestPolicies: {
      break;
    }
    case messages::PolicyPageHandler::kGetPolicyLogs: {
      break;
    }
    case messages::PolicyPageHandler::kGetPoliciesJson: {
      break;
    }
  }
  return false;
}

// static
bool PolicyPageHandlerStubDispatch::AcceptWithResponder(
    PolicyPageHandler* impl,
    mojo::Message* message,
    std::unique_ptr<mojo::MessageReceiverWithStatus> responder) {
  [[maybe_unused]] const bool message_is_sync =
      message->has_flag(mojo::Message::kFlagIsSync);
  [[maybe_unused]] const uint64_t request_id = message->request_id();
  switch (static_cast<messages::PolicyPageHandler>(message->header()->name)) {
    case messages::PolicyPageHandler::kGetDebugString: {
      internal::PolicyPageHandler_GetDebugString_Params_Data* params =
          reinterpret_cast<
              internal::PolicyPageHandler_GetDebugString_Params_Data*>(
                  message->mutable_payload());
      

      // Validation for PolicyPageHandler.0
      bool success = true;
      PolicyPageHandler_GetDebugString_ParamsDataView input_data_view(params, message);
      
      if (!success) {
        ReportValidationErrorForMessage(
            message,
            mojo::internal::VALIDATION_ERROR_DESERIALIZATION_FAILED,
            PolicyPageHandler::Name_, 0, false);
        return false;
      }
      auto callback =
          PolicyPageHandler_GetDebugString_ProxyToResponder::CreateCallback(
              *message, std::move(responder));
      // A null |impl| means no implementation was bound.
      DCHECK(impl);
      impl->GetDebugString(std::move(callback));
      return true;
    }
    case messages::PolicyPageHandler::kRestartBrowser: {
      break;
    }
    case messages::PolicyPageHandler::kSetUserAffiliated: {
      internal::PolicyPageHandler_SetUserAffiliated_Params_Data* params =
          reinterpret_cast<
              internal::PolicyPageHandler_SetUserAffiliated_Params_Data*>(
                  message->mutable_payload());
      

      // Validation for PolicyPageHandler.2
      bool success = true;
      bool p_affiliated{};
      PolicyPageHandler_SetUserAffiliated_ParamsDataView input_data_view(params, message);
      
      if (success)
        p_affiliated = input_data_view.affiliated();
      if (!success) {
        ReportValidationErrorForMessage(
            message,
            mojo::internal::VALIDATION_ERROR_DESERIALIZATION_FAILED,
            PolicyPageHandler::Name_, 2, false);
        return false;
      }
      auto callback =
          PolicyPageHandler_SetUserAffiliated_ProxyToResponder::CreateCallback(
              *message, std::move(responder));
      // A null |impl| means no implementation was bound.
      DCHECK(impl);
      impl->SetUserAffiliated(        
        std::move(p_affiliated), std::move(callback));
      return true;
    }
    case messages::PolicyPageHandler::kGetAppliedTestPolicies: {
      internal::PolicyPageHandler_GetAppliedTestPolicies_Params_Data* params =
          reinterpret_cast<
              internal::PolicyPageHandler_GetAppliedTestPolicies_Params_Data*>(
                  message->mutable_payload());
      

      // Validation for PolicyPageHandler.3
      bool success = true;
      PolicyPageHandler_GetAppliedTestPolicies_ParamsDataView input_data_view(params, message);
      
      if (!success) {
        ReportValidationErrorForMessage(
            message,
            mojo::internal::VALIDATION_ERROR_DESERIALIZATION_FAILED,
            PolicyPageHandler::Name_, 3, false);
        return false;
      }
      auto callback =
          PolicyPageHandler_GetAppliedTestPolicies_ProxyToResponder::CreateCallback(
              *message, std::move(responder));
      // A null |impl| means no implementation was bound.
      DCHECK(impl);
      impl->GetAppliedTestPolicies(std::move(callback));
      return true;
    }
    case messages::PolicyPageHandler::kRevertLocalTestPolicies: {
      break;
    }
    case messages::PolicyPageHandler::kSetLocalTestPolicies: {
      internal::PolicyPageHandler_SetLocalTestPolicies_Params_Data* params =
          reinterpret_cast<
              internal::PolicyPageHandler_SetLocalTestPolicies_Params_Data*>(
                  message->mutable_payload());
      

      // Validation for PolicyPageHandler.5
      bool success = true;
      std::string p_policies{};
      std::string p_profile_separation_response{};
      PolicyPageHandler_SetLocalTestPolicies_ParamsDataView input_data_view(params, message);
      
      if (success && !input_data_view.ReadPolicies(&p_policies))
        success = false;
      if (success && !input_data_view.ReadProfileSeparationResponse(&p_profile_separation_response))
        success = false;
      if (!success) {
        ReportValidationErrorForMessage(
            message,
            mojo::internal::VALIDATION_ERROR_DESERIALIZATION_FAILED,
            PolicyPageHandler::Name_, 5, false);
        return false;
      }
      auto callback =
          PolicyPageHandler_SetLocalTestPolicies_ProxyToResponder::CreateCallback(
              *message, std::move(responder));
      // A null |impl| means no implementation was bound.
      DCHECK(impl);
      impl->SetLocalTestPolicies(        
        std::move(p_policies), 
        std::move(p_profile_separation_response), std::move(callback));
      return true;
    }
    case messages::PolicyPageHandler::kGetPolicyLogs: {
      internal::PolicyPageHandler_GetPolicyLogs_Params_Data* params =
          reinterpret_cast<
              internal::PolicyPageHandler_GetPolicyLogs_Params_Data*>(
                  message->mutable_payload());
      

      // Validation for PolicyPageHandler.6
      bool success = true;
      PolicyPageHandler_GetPolicyLogs_ParamsDataView input_data_view(params, message);
      
      if (!success) {
        ReportValidationErrorForMessage(
            message,
            mojo::internal::VALIDATION_ERROR_DESERIALIZATION_FAILED,
            PolicyPageHandler::Name_, 6, false);
        return false;
      }
      auto callback =
          PolicyPageHandler_GetPolicyLogs_ProxyToResponder::CreateCallback(
              *message, std::move(responder));
      // A null |impl| means no implementation was bound.
      DCHECK(impl);
      impl->GetPolicyLogs(std::move(callback));
      return true;
    }
    case messages::PolicyPageHandler::kGetPoliciesJson: {
      internal::PolicyPageHandler_GetPoliciesJson_Params_Data* params =
          reinterpret_cast<
              internal::PolicyPageHandler_GetPoliciesJson_Params_Data*>(
                  message->mutable_payload());
      

      // Validation for PolicyPageHandler.7
      bool success = true;
      GetPoliciesReason p_reason{};
      PolicyPageHandler_GetPoliciesJson_ParamsDataView input_data_view(params, message);
      
      if (success && !input_data_view.ReadReason(&p_reason))
        success = false;
      if (!success) {
        ReportValidationErrorForMessage(
            message,
            mojo::internal::VALIDATION_ERROR_DESERIALIZATION_FAILED,
            PolicyPageHandler::Name_, 7, false);
        return false;
      }
      auto callback =
          PolicyPageHandler_GetPoliciesJson_ProxyToResponder::CreateCallback(
              *message, std::move(responder));
      // A null |impl| means no implementation was bound.
      DCHECK(impl);
      impl->GetPoliciesJson(        
        std::move(p_reason), std::move(callback));
      return true;
    }
  }
  return false;
}
namespace {
}  // namespace
static const mojo::internal::GenericValidationInfo kPolicyPageHandlerValidationInfo[] = {
    { &internal::PolicyPageHandler_GetDebugString_Params_Data::Validate,
     &internal::PolicyPageHandler_GetDebugString_ResponseParams_Data::Validate},
    { &internal::PolicyPageHandler_RestartBrowser_Params_Data::Validate,
     nullptr /* no response */},
    { &internal::PolicyPageHandler_SetUserAffiliated_Params_Data::Validate,
     &internal::PolicyPageHandler_SetUserAffiliated_ResponseParams_Data::Validate},
    { &internal::PolicyPageHandler_GetAppliedTestPolicies_Params_Data::Validate,
     &internal::PolicyPageHandler_GetAppliedTestPolicies_ResponseParams_Data::Validate},
    { &internal::PolicyPageHandler_RevertLocalTestPolicies_Params_Data::Validate,
     nullptr /* no response */},
    { &internal::PolicyPageHandler_SetLocalTestPolicies_Params_Data::Validate,
     &internal::PolicyPageHandler_SetLocalTestPolicies_ResponseParams_Data::Validate},
    { &internal::PolicyPageHandler_GetPolicyLogs_Params_Data::Validate,
     &internal::PolicyPageHandler_GetPolicyLogs_ResponseParams_Data::Validate},
    { &internal::PolicyPageHandler_GetPoliciesJson_Params_Data::Validate,
     &internal::PolicyPageHandler_GetPoliciesJson_ResponseParams_Data::Validate},
};

bool PolicyPageHandlerRequestValidator::Accept(mojo::Message* message) {
  return mojo::internal::ValidateRequestGenericPacked(
    message,
    ::policy::mojom::PolicyPageHandler::Name_,
    kPolicyPageHandlerValidationInfo);
}

bool PolicyPageHandlerResponseValidator::Accept(mojo::Message* message) {
  return mojo::internal::ValidateResponseGenericPacked(
    message,
    ::policy::mojom::PolicyPageHandler::Name_,
    kPolicyPageHandlerValidationInfo);
}
// The declaration includes the definition on other builds.

PolicyPageClient::IPCStableHashFunction PolicyPageClient::MessageToMethodInfo_(mojo::Message& message) {
#if !BUILDFLAG(IS_FUCHSIA)
  switch (static_cast<messages::PolicyPageClient>(message.name())) {
    case messages::PolicyPageClient::kStatusUpdated: {
      return &PolicyPageClient::StatusUpdated_Sym::IPCStableHash;
    }
  }
#endif  // !BUILDFLAG(IS_FUCHSIA)
  return nullptr;
}


const char* PolicyPageClient::MessageToMethodName_(mojo::Message& message) {
#if BUILDFLAG(MOJO_TRACE_ENABLED)
  bool is_response = message.has_flag(mojo::Message::kFlagIsResponse);
  if (!is_response) {
    switch (static_cast<messages::PolicyPageClient>(message.name())) {
      case messages::PolicyPageClient::kStatusUpdated:
            return "Receive policy::mojom::PolicyPageClient::StatusUpdated";
    }
  } else {
    switch (static_cast<messages::PolicyPageClient>(message.name())) {
      case messages::PolicyPageClient::kStatusUpdated:
            return "Receive reply policy::mojom::PolicyPageClient::StatusUpdated";
    }
  }
  return "Receive unknown mojo message";
#else
  bool is_response = message.has_flag(mojo::Message::kFlagIsResponse);
  if (is_response) {
    return "Receive mojo reply";
  } else {
    return "Receive mojo message";
  }
#endif // BUILDFLAG(MOJO_TRACE_ENABLED)
}

#if !BUILDFLAG(IS_FUCHSIA)
uint32_t PolicyPageClient::StatusUpdated_Sym::IPCStableHash() {
  // This method's address is used for identifying the mojo method name after
  // symbolization. So each IPCStableHash should have a unique address.
  // We cannot use NO_CODE_FOLDING() here - it relies on the uniqueness of
  // __LINE__ value, which is not unique across different mojo modules.
  // The code below is very similar to NO_CODE_FOLDING, but it uses a unique
  // hash instead of __LINE__.
  static constexpr uint32_t kHash = 0x2cb0217f;  // IPCStableHash for policy::mojom::PolicyPageClient::StatusUpdated
  const uint32_t hash = kHash;
  base::debug::Alias(&hash);
  return hash;
}
# endif // !BUILDFLAG(IS_FUCHSIA)

PolicyPageClientProxy::PolicyPageClientProxy(mojo::MessageReceiverWithResponder* receiver)
    : receiver_(receiver) {
}

void PolicyPageClientProxy::StatusUpdated(
    base::flat_map<std::string, StatusPtr> in_status) {
#if BUILDFLAG(MOJO_TRACE_ENABLED)
  TRACE_EVENT1(
    "mojom", "Send policy::mojom::PolicyPageClient::StatusUpdated", "input_parameters",
    [&](perfetto::TracedValue context){
      auto dict = std::move(context).WriteDictionary();
      perfetto::WriteIntoTracedValueWithFallback(
           dict.AddItem("status"), in_status,
                        "<value of type base::flat_map<std::string, StatusPtr>>");
   });
#endif

  const bool kExpectsResponse = false;
  const bool kIsSync = false;
  const bool kAllowInterrupt = true;
  const bool is_urgent = false;

  const uint32_t kFlags =
      ((kExpectsResponse) ? mojo::Message::kFlagExpectsResponse : 0) |
      ((kIsSync) ? mojo::Message::kFlagIsSync : 0) |
      ((kAllowInterrupt) ? 0 : mojo::Message::kFlagNoInterrupt) |
      ((is_urgent) ? mojo::Message::kFlagIsUrgent : 0);

  const size_t estimated_payload_size =
    0;
  mojo::Message message(
      std::to_underlying(messages::PolicyPageClient::kStatusUpdated), kFlags, estimated_payload_size);
  mojo::internal::MessageFragment<
      ::policy::mojom::internal::PolicyPageClient_StatusUpdated_Params_Data> params(
          message);
  params.Allocate();
  mojo::internal::MessageFragment<
      typename decltype(params->status)::BaseType>
      status_fragment(params.message());
  constexpr const mojo::internal::ContainerValidateParams& status_validate_params =
      mojo::internal::GetMapValidator<*&mojo::internal::GetArrayValidator<0, false, &mojo::internal::GetArrayValidator<0, false, nullptr>()>(), *&mojo::internal::GetArrayValidator<0, false, nullptr>()>();
  
  mojo::internal::Serialize<mojo::MapDataView<mojo::StringDataView, ::policy::mojom::StatusDataView>>(
    in_status,
    status_fragment,
    &status_validate_params);

  params->status.Set(
      status_fragment.is_null() ? nullptr : status_fragment.data());

  
  MOJO_INTERNAL_CHECK_SERIALIZATION(
    mojo::internal::SendValidation::kDefault,
    !(params->status.is_null()),
    mojo::internal::VALIDATION_ERROR_UNEXPECTED_NULL_POINTER,
    "null status in PolicyPageClient.StatusUpdated request");

#if defined(ENABLE_IPC_FUZZER)
  message.set_interface_name(PolicyPageClient::Name_);
  message.set_method_name("StatusUpdated");
#endif
  // This return value may be ignored as false implies the Connector has
  // encountered an error, which will be visible through other means.
  ::mojo::internal::SendMojoMessage(*receiver_, message);
}

// static
bool PolicyPageClientStubDispatch::Accept(
    PolicyPageClient* impl,
    mojo::Message* message) {
  switch (static_cast<messages::PolicyPageClient>(message->header()->name)) {
    case messages::PolicyPageClient::kStatusUpdated: {
      DCHECK(message->is_serialized());
      internal::PolicyPageClient_StatusUpdated_Params_Data* params =
          reinterpret_cast<internal::PolicyPageClient_StatusUpdated_Params_Data*>(
              message->mutable_payload());
      

      // Validation for PolicyPageClient.0
      bool success = true;
      base::flat_map<std::string, StatusPtr> p_status{};
      PolicyPageClient_StatusUpdated_ParamsDataView input_data_view(params, message);
      
      if (success && !input_data_view.ReadStatus(&p_status))
        success = false;
      if (!success) {
        ReportValidationErrorForMessage(
            message,
            mojo::internal::VALIDATION_ERROR_DESERIALIZATION_FAILED,
            PolicyPageClient::Name_, 0, false);
        return false;
      }
      // A null |impl| means no implementation was bound.
      DCHECK(impl);
      impl->StatusUpdated(        
        std::move(p_status));
      return true;
    }
  }
  return false;
}

// static
bool PolicyPageClientStubDispatch::AcceptWithResponder(
    PolicyPageClient* impl,
    mojo::Message* message,
    std::unique_ptr<mojo::MessageReceiverWithStatus> responder) {
  [[maybe_unused]] const bool message_is_sync =
      message->has_flag(mojo::Message::kFlagIsSync);
  [[maybe_unused]] const uint64_t request_id = message->request_id();
  switch (static_cast<messages::PolicyPageClient>(message->header()->name)) {
    case messages::PolicyPageClient::kStatusUpdated: {
      break;
    }
  }
  return false;
}
namespace {
}  // namespace
static const mojo::internal::GenericValidationInfo kPolicyPageClientValidationInfo[] = {
    { &internal::PolicyPageClient_StatusUpdated_Params_Data::Validate,
     nullptr /* no response */},
};

bool PolicyPageClientRequestValidator::Accept(mojo::Message* message) {
  return mojo::internal::ValidateRequestGenericPacked(
    message,
    ::policy::mojom::PolicyPageClient::Name_,
    kPolicyPageClientValidationInfo);
}

// The declaration includes the definition on other builds.

PolicyPageHandlerFactory::IPCStableHashFunction PolicyPageHandlerFactory::MessageToMethodInfo_(mojo::Message& message) {
#if !BUILDFLAG(IS_FUCHSIA)
  switch (static_cast<messages::PolicyPageHandlerFactory>(message.name())) {
    case messages::PolicyPageHandlerFactory::kCreateHandler: {
      return &PolicyPageHandlerFactory::CreateHandler_Sym::IPCStableHash;
    }
  }
#endif  // !BUILDFLAG(IS_FUCHSIA)
  return nullptr;
}


const char* PolicyPageHandlerFactory::MessageToMethodName_(mojo::Message& message) {
#if BUILDFLAG(MOJO_TRACE_ENABLED)
  bool is_response = message.has_flag(mojo::Message::kFlagIsResponse);
  if (!is_response) {
    switch (static_cast<messages::PolicyPageHandlerFactory>(message.name())) {
      case messages::PolicyPageHandlerFactory::kCreateHandler:
            return "Receive policy::mojom::PolicyPageHandlerFactory::CreateHandler";
    }
  } else {
    switch (static_cast<messages::PolicyPageHandlerFactory>(message.name())) {
      case messages::PolicyPageHandlerFactory::kCreateHandler:
            return "Receive reply policy::mojom::PolicyPageHandlerFactory::CreateHandler";
    }
  }
  return "Receive unknown mojo message";
#else
  bool is_response = message.has_flag(mojo::Message::kFlagIsResponse);
  if (is_response) {
    return "Receive mojo reply";
  } else {
    return "Receive mojo message";
  }
#endif // BUILDFLAG(MOJO_TRACE_ENABLED)
}

#if !BUILDFLAG(IS_FUCHSIA)
uint32_t PolicyPageHandlerFactory::CreateHandler_Sym::IPCStableHash() {
  // This method's address is used for identifying the mojo method name after
  // symbolization. So each IPCStableHash should have a unique address.
  // We cannot use NO_CODE_FOLDING() here - it relies on the uniqueness of
  // __LINE__ value, which is not unique across different mojo modules.
  // The code below is very similar to NO_CODE_FOLDING, but it uses a unique
  // hash instead of __LINE__.
  static constexpr uint32_t kHash = 0x585716ac;  // IPCStableHash for policy::mojom::PolicyPageHandlerFactory::CreateHandler
  const uint32_t hash = kHash;
  base::debug::Alias(&hash);
  return hash;
}
# endif // !BUILDFLAG(IS_FUCHSIA)

PolicyPageHandlerFactoryProxy::PolicyPageHandlerFactoryProxy(mojo::MessageReceiverWithResponder* receiver)
    : receiver_(receiver) {
}

void PolicyPageHandlerFactoryProxy::CreateHandler(
    ::mojo::PendingReceiver<PolicyPageHandler> in_handler, ::mojo::PendingRemote<PolicyPageClient> in_client) {
#if BUILDFLAG(MOJO_TRACE_ENABLED)
  TRACE_EVENT1(
    "mojom", "Send policy::mojom::PolicyPageHandlerFactory::CreateHandler", "input_parameters",
    [&](perfetto::TracedValue context){
      auto dict = std::move(context).WriteDictionary();
      perfetto::WriteIntoTracedValueWithFallback(
           dict.AddItem("handler"), in_handler,
                        "<value of type ::mojo::PendingReceiver<PolicyPageHandler>>");
      perfetto::WriteIntoTracedValueWithFallback(
           dict.AddItem("client"), in_client,
                        "<value of type ::mojo::PendingRemote<PolicyPageClient>>");
   });
#endif

  const bool kExpectsResponse = false;
  const bool kIsSync = false;
  const bool kAllowInterrupt = true;
  const bool is_urgent = false;

  const uint32_t kFlags =
      ((kExpectsResponse) ? mojo::Message::kFlagExpectsResponse : 0) |
      ((kIsSync) ? mojo::Message::kFlagIsSync : 0) |
      ((kAllowInterrupt) ? 0 : mojo::Message::kFlagNoInterrupt) |
      ((is_urgent) ? mojo::Message::kFlagIsUrgent : 0);

  const size_t estimated_payload_size =
    0;
  mojo::Message message(
      std::to_underlying(messages::PolicyPageHandlerFactory::kCreateHandler), kFlags, estimated_payload_size);
  mojo::internal::MessageFragment<
      ::policy::mojom::internal::PolicyPageHandlerFactory_CreateHandler_Params_Data> params(
          message);
  params.Allocate();

  
  mojo::internal::Serialize<mojo::InterfaceRequestDataView<::policy::mojom::PolicyPageHandlerInterfaceBase>>(
    in_handler,
    &params->handler,
    &params.message());

  
  MOJO_INTERNAL_CHECK_SERIALIZATION(
    mojo::internal::SendValidation::kDefault,
    !(!mojo::internal::IsHandleOrInterfaceValid(params->handler)),
    mojo::internal::VALIDATION_ERROR_UNEXPECTED_INVALID_HANDLE,
    "invalid handler in PolicyPageHandlerFactory.CreateHandler request");

  
  mojo::internal::Serialize<mojo::InterfacePtrDataView<::policy::mojom::PolicyPageClientInterfaceBase>>(
    in_client,
    &params->client,
    &params.message());

  
  MOJO_INTERNAL_CHECK_SERIALIZATION(
    mojo::internal::SendValidation::kDefault,
    !(!mojo::internal::IsHandleOrInterfaceValid(params->client)),
    mojo::internal::VALIDATION_ERROR_UNEXPECTED_INVALID_HANDLE,
    "invalid client in PolicyPageHandlerFactory.CreateHandler request");

#if defined(ENABLE_IPC_FUZZER)
  message.set_interface_name(PolicyPageHandlerFactory::Name_);
  message.set_method_name("CreateHandler");
#endif
  // This return value may be ignored as false implies the Connector has
  // encountered an error, which will be visible through other means.
  ::mojo::internal::SendMojoMessage(*receiver_, message);
}

// static
bool PolicyPageHandlerFactoryStubDispatch::Accept(
    PolicyPageHandlerFactory* impl,
    mojo::Message* message) {
  switch (static_cast<messages::PolicyPageHandlerFactory>(message->header()->name)) {
    case messages::PolicyPageHandlerFactory::kCreateHandler: {
      DCHECK(message->is_serialized());
      internal::PolicyPageHandlerFactory_CreateHandler_Params_Data* params =
          reinterpret_cast<internal::PolicyPageHandlerFactory_CreateHandler_Params_Data*>(
              message->mutable_payload());
      

      // Validation for PolicyPageHandlerFactory.0
      bool success = true;
      ::mojo::PendingReceiver<PolicyPageHandler> p_handler{};
      ::mojo::PendingRemote<PolicyPageClient> p_client{};
      PolicyPageHandlerFactory_CreateHandler_ParamsDataView input_data_view(params, message);
      
      if (success) {
        p_handler =
            input_data_view.TakeHandler<decltype(p_handler)>();
      }
      if (success) {
        p_client =
            input_data_view.TakeClient<decltype(p_client)>();
      }
      if (!success) {
        ReportValidationErrorForMessage(
            message,
            mojo::internal::VALIDATION_ERROR_DESERIALIZATION_FAILED,
            PolicyPageHandlerFactory::Name_, 0, false);
        return false;
      }
      // A null |impl| means no implementation was bound.
      DCHECK(impl);
      impl->CreateHandler(        
        std::move(p_handler), 
        std::move(p_client));
      return true;
    }
  }
  return false;
}

// static
bool PolicyPageHandlerFactoryStubDispatch::AcceptWithResponder(
    PolicyPageHandlerFactory* impl,
    mojo::Message* message,
    std::unique_ptr<mojo::MessageReceiverWithStatus> responder) {
  [[maybe_unused]] const bool message_is_sync =
      message->has_flag(mojo::Message::kFlagIsSync);
  [[maybe_unused]] const uint64_t request_id = message->request_id();
  switch (static_cast<messages::PolicyPageHandlerFactory>(message->header()->name)) {
    case messages::PolicyPageHandlerFactory::kCreateHandler: {
      break;
    }
  }
  return false;
}
namespace {
}  // namespace
static const mojo::internal::GenericValidationInfo kPolicyPageHandlerFactoryValidationInfo[] = {
    { &internal::PolicyPageHandlerFactory_CreateHandler_Params_Data::Validate,
     nullptr /* no response */},
};

bool PolicyPageHandlerFactoryRequestValidator::Accept(mojo::Message* message) {
  return mojo::internal::ValidateRequestGenericPacked(
    message,
    ::policy::mojom::PolicyPageHandlerFactory::Name_,
    kPolicyPageHandlerFactoryValidationInfo);
}



}  // policy::mojom


namespace mojo {


// static
bool StructTraits<::policy::mojom::Log::DataView, ::policy::mojom::LogPtr>::Read(
    ::policy::mojom::Log::DataView input,
    ::policy::mojom::LogPtr* output) {
  bool success = true;
  ::policy::mojom::LogPtr result(::policy::mojom::Log::New());
  
      if (success && !input.ReadMessage(&result->message))
        success = false;
      if (success && !input.ReadLogSeverity(&result->log_severity))
        success = false;
      if (success && !input.ReadLogSource(&result->log_source))
        success = false;
      if (success && !input.ReadFileAndLine(&result->file_and_line))
        success = false;
      if (success && !input.ReadLocation(&result->location))
        success = false;
      if (success && !input.ReadTimestamp(&result->timestamp))
        success = false;
  *output = std::move(result);
  return success;
}


// static
bool StructTraits<::policy::mojom::Status::DataView, ::policy::mojom::StatusPtr>::Read(
    ::policy::mojom::Status::DataView input,
    ::policy::mojom::StatusPtr* output) {
  bool success = true;
  ::policy::mojom::StatusPtr result(::policy::mojom::Status::New());
  
      if (success && !input.ReadPolicyDescriptionKey(&result->policy_description_key))
        success = false;
      if (success)
        result->flex_org_warning = input.flex_org_warning();
      if (success && !input.ReadAssetId(&result->asset_id))
        success = false;
      if (success && !input.ReadLocation(&result->location))
        success = false;
      if (success && !input.ReadDirectoryApiId(&result->directory_api_id))
        success = false;
      if (success && !input.ReadClientId(&result->client_id))
        success = false;
      if (success) {
        result->is_off_hours_active = input.is_off_hours_active();
      }
      if (success && !input.ReadDeviceId(&result->device_id))
        success = false;
      if (success && !input.ReadEnrollmentToken(&result->enrollment_token))
        success = false;
      if (success && !input.ReadDomain(&result->domain))
        success = false;
      if (success && !input.ReadMachine(&result->machine))
        success = false;
      if (success && !input.ReadVersion(&result->version))
        success = false;
      if (success && !input.ReadUsername(&result->username))
        success = false;
      if (success && !input.ReadGaiaId(&result->gaia_id))
        success = false;
      if (success && !input.ReadProfileId(&result->profile_id))
        success = false;
      if (success && !input.ReadStatus(&result->status))
        success = false;
      if (success && !input.ReadExtensionInstallStatus(&result->extension_install_status))
        success = false;
      if (success && !input.ReadRefreshInterval(&result->refresh_interval))
        success = false;
      if (success && !input.ReadTimeSinceLastRefresh(&result->time_since_last_refresh))
        success = false;
      if (success && !input.ReadTimeSinceLastFetchAttempt(&result->time_since_last_fetch_attempt))
        success = false;
      if (success && !input.ReadExtensionInstallTimeSinceLastRefresh(&result->extension_install_time_since_last_refresh))
        success = false;
      if (success && !input.ReadExtensionInstallTimeSinceLastFetchAttempt(&result->extension_install_time_since_last_fetch_attempt))
        success = false;
      if (success && !input.ReadLastCloudReportSentTimestamp(&result->last_cloud_report_sent_timestamp))
        success = false;
      if (success && !input.ReadTimeSinceLastCloudReportSent(&result->time_since_last_cloud_report_sent))
        success = false;
      if (success && !input.ReadEnterpriseDomainManager(&result->enterprise_domain_manager))
        success = false;
      if (success) {
        result->is_affiliated = input.is_affiliated();
      }
      if (success)
        result->policies_push_available = input.policies_push_available();
      if (success)
        result->error = input.error();
      if (success)
        result->extension_install_error = input.extension_install_error();
  *output = std::move(result);
  return success;
}


// static
bool StructTraits<::policy::mojom::Conflict::DataView, ::policy::mojom::ConflictPtr>::Read(
    ::policy::mojom::Conflict::DataView input,
    ::policy::mojom::ConflictPtr* output) {
  bool success = true;
  ::policy::mojom::ConflictPtr result(::policy::mojom::Conflict::New());
  
      if (success && !input.ReadLevel(&result->level))
        success = false;
      if (success && !input.ReadScope(&result->scope))
        success = false;
      if (success && !input.ReadSource(&result->source))
        success = false;
      if (success && !input.ReadValue(&result->value))
        success = false;
  *output = std::move(result);
  return success;
}


// static
bool StructTraits<::policy::mojom::Policy::DataView, ::policy::mojom::PolicyPtr>::Read(
    ::policy::mojom::Policy::DataView input,
    ::policy::mojom::PolicyPtr* output) {
  bool success = true;
  ::policy::mojom::PolicyPtr result(::policy::mojom::Policy::New());
  
      if (success)
        result->ignored = input.ignored();
      if (success && !input.ReadName(&result->name))
        success = false;
      if (success && !input.ReadLevel(&result->level))
        success = false;
      if (success && !input.ReadScope(&result->scope))
        success = false;
      if (success && !input.ReadSource(&result->source))
        success = false;
      if (success && !input.ReadValue(&result->value))
        success = false;
      if (success)
        result->restart_required = input.restart_required();
      if (success)
        result->deprecated = input.deprecated();
      if (success)
        result->future = input.future();
      if (success) {
        result->all_sources_merged = input.all_sources_merged();
      }
      if (success && !input.ReadConflicts(&result->conflicts))
        success = false;
      if (success && !input.ReadSuperseded(&result->superseded))
        success = false;
      if (success && !input.ReadError(&result->error))
        success = false;
      if (success && !input.ReadWarning(&result->warning))
        success = false;
      if (success && !input.ReadInfo(&result->info))
        success = false;
  *output = std::move(result);
  return success;
}


// static
bool StructTraits<::policy::mojom::PolicyGroup::DataView, ::policy::mojom::PolicyGroupPtr>::Read(
    ::policy::mojom::PolicyGroup::DataView input,
    ::policy::mojom::PolicyGroupPtr* output) {
  bool success = true;
  ::policy::mojom::PolicyGroupPtr result(::policy::mojom::PolicyGroup::New());
  
      if (success && !input.ReadName(&result->name))
        success = false;
      if (success && !input.ReadPolicies(&result->policies))
        success = false;
      if (success && !input.ReadPrecedenceOrder(&result->precedence_order))
        success = false;
      if (success)
        result->is_extension = input.is_extension();
      if (success)
        result->for_signin_screen = input.for_signin_screen();
  *output = std::move(result);
  return success;
}


// static
bool StructTraits<::policy::mojom::PolicyGroupsResponse::DataView, ::policy::mojom::PolicyGroupsResponsePtr>::Read(
    ::policy::mojom::PolicyGroupsResponse::DataView input,
    ::policy::mojom::PolicyGroupsResponsePtr* output) {
  bool success = true;
  ::policy::mojom::PolicyGroupsResponsePtr result(::policy::mojom::PolicyGroupsResponse::New());
  
      if (success && !input.ReadPolicyIdsPresentationOrder(&result->policy_ids_presentation_order))
        success = false;
      if (success && !input.ReadPolicyGroups(&result->policy_groups))
        success = false;
  *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 policy::mojom {


void PolicyPageHandlerInterceptorForTesting::GetDebugString(GetDebugStringCallback callback) {
  GetForwardingInterface()->GetDebugString(std::move(callback));
}
void PolicyPageHandlerInterceptorForTesting::RestartBrowser(const std::string& policies) {
  GetForwardingInterface()->RestartBrowser(
    std::move(policies)
    );
}
void PolicyPageHandlerInterceptorForTesting::SetUserAffiliated(bool affiliated, SetUserAffiliatedCallback callback) {
  GetForwardingInterface()->SetUserAffiliated(
    std::move(affiliated)
    , std::move(callback));
}
void PolicyPageHandlerInterceptorForTesting::GetAppliedTestPolicies(GetAppliedTestPoliciesCallback callback) {
  GetForwardingInterface()->GetAppliedTestPolicies(std::move(callback));
}
void PolicyPageHandlerInterceptorForTesting::RevertLocalTestPolicies() {
  GetForwardingInterface()->RevertLocalTestPolicies();
}
void PolicyPageHandlerInterceptorForTesting::SetLocalTestPolicies(const std::string& policies, const std::string& profile_separation_response, SetLocalTestPoliciesCallback callback) {
  GetForwardingInterface()->SetLocalTestPolicies(
    std::move(policies)
    , 
    std::move(profile_separation_response)
    , std::move(callback));
}
void PolicyPageHandlerInterceptorForTesting::GetPolicyLogs(GetPolicyLogsCallback callback) {
  GetForwardingInterface()->GetPolicyLogs(std::move(callback));
}
void PolicyPageHandlerInterceptorForTesting::GetPoliciesJson(GetPoliciesReason reason, GetPoliciesJsonCallback callback) {
  GetForwardingInterface()->GetPoliciesJson(
    std::move(reason)
    , std::move(callback));
}
PolicyPageHandlerAsyncWaiter::PolicyPageHandlerAsyncWaiter(
    PolicyPageHandler* proxy) : proxy_(proxy) {}

PolicyPageHandlerAsyncWaiter::~PolicyPageHandlerAsyncWaiter() = default;


void PolicyPageHandlerAsyncWaiter::GetDebugString(
    std::string* out_message) {
  base::RunLoop loop;
  proxy_->GetDebugString(
      base::BindOnce(
          [](base::RunLoop* loop,
             std::string* out_message
,
             const std::string& message) {*out_message = std::move(message);
            loop->Quit();
          },
          &loop,
          out_message));
  loop.Run();
}

std::string PolicyPageHandlerAsyncWaiter::GetDebugString(
    ) {
  std::string async_wait_result;
  GetDebugString(&async_wait_result);
  return async_wait_result;
}

void PolicyPageHandlerAsyncWaiter::SetUserAffiliated(
    bool affiliated) {
  base::RunLoop loop;
  proxy_->SetUserAffiliated(
      std::move(affiliated),
      base::BindOnce(
          [](base::RunLoop* loop) {
            loop->Quit();
          },
          &loop));
  loop.Run();
}



void PolicyPageHandlerAsyncWaiter::GetAppliedTestPolicies(
    std::string* out_policies) {
  base::RunLoop loop;
  proxy_->GetAppliedTestPolicies(
      base::BindOnce(
          [](base::RunLoop* loop,
             std::string* out_policies
,
             const std::string& policies) {*out_policies = std::move(policies);
            loop->Quit();
          },
          &loop,
          out_policies));
  loop.Run();
}

std::string PolicyPageHandlerAsyncWaiter::GetAppliedTestPolicies(
    ) {
  std::string async_wait_result;
  GetAppliedTestPolicies(&async_wait_result);
  return async_wait_result;
}

void PolicyPageHandlerAsyncWaiter::SetLocalTestPolicies(
    const std::string& policies, const std::string& profile_separation_response) {
  base::RunLoop loop;
  proxy_->SetLocalTestPolicies(
      std::move(policies),
      std::move(profile_separation_response),
      base::BindOnce(
          [](base::RunLoop* loop) {
            loop->Quit();
          },
          &loop));
  loop.Run();
}



void PolicyPageHandlerAsyncWaiter::GetPolicyLogs(
    std::vector<LogPtr>* out_policy_logs) {
  base::RunLoop loop;
  proxy_->GetPolicyLogs(
      base::BindOnce(
          [](base::RunLoop* loop,
             std::vector<LogPtr>* out_policy_logs
,
             std::vector<LogPtr> policy_logs) {*out_policy_logs = std::move(policy_logs);
            loop->Quit();
          },
          &loop,
          out_policy_logs));
  loop.Run();
}

std::vector<LogPtr> PolicyPageHandlerAsyncWaiter::GetPolicyLogs(
    ) {
  std::vector<LogPtr> async_wait_result;
  GetPolicyLogs(&async_wait_result);
  return async_wait_result;
}

void PolicyPageHandlerAsyncWaiter::GetPoliciesJson(
    GetPoliciesReason reason, std::string* out_policies_json) {
  base::RunLoop loop;
  proxy_->GetPoliciesJson(
      std::move(reason),
      base::BindOnce(
          [](base::RunLoop* loop,
             std::string* out_policies_json
,
             const std::string& policies_json) {*out_policies_json = std::move(policies_json);
            loop->Quit();
          },
          &loop,
          out_policies_json));
  loop.Run();
}

std::string PolicyPageHandlerAsyncWaiter::GetPoliciesJson(
    GetPoliciesReason reason) {
  std::string async_wait_result;
  GetPoliciesJson(std::move(reason),&async_wait_result);
  return async_wait_result;
}




void PolicyPageClientInterceptorForTesting::StatusUpdated(base::flat_map<std::string, StatusPtr> status) {
  GetForwardingInterface()->StatusUpdated(
    std::move(status)
    );
}
PolicyPageClientAsyncWaiter::PolicyPageClientAsyncWaiter(
    PolicyPageClient* proxy) : proxy_(proxy) {}

PolicyPageClientAsyncWaiter::~PolicyPageClientAsyncWaiter() = default;





void PolicyPageHandlerFactoryInterceptorForTesting::CreateHandler(::mojo::PendingReceiver<PolicyPageHandler> handler, ::mojo::PendingRemote<PolicyPageClient> client) {
  GetForwardingInterface()->CreateHandler(
    std::move(handler)
    , 
    std::move(client)
    );
}
PolicyPageHandlerFactoryAsyncWaiter::PolicyPageHandlerFactoryAsyncWaiter(
    PolicyPageHandlerFactory* proxy) : proxy_(proxy) {}

PolicyPageHandlerFactoryAsyncWaiter::~PolicyPageHandlerFactoryAsyncWaiter() = default;







}  // policy::mojom


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