// third_party/blink/public/mojom/remote_objects/remote_objects.mojom-shared.cc is auto generated by mojom_bindings_generator.py, do not edit

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

#include "third_party/blink/public/mojom/remote_objects/remote_objects.mojom-shared.h"
#include <ostream>
#include <utility>
#include "base/strings/stringprintf.h"
#include "mojo/public/cpp/bindings/lib/validate_params.h"
#include "mojo/public/cpp/bindings/lib/validation_errors.h"
#include "mojo/public/cpp/bindings/lib/validation_util.h"
#include "third_party/perfetto/include/perfetto/tracing/traced_value.h"

#include "third_party/blink/public/mojom/remote_objects/remote_objects.mojom-params-data.h"
namespace blink {
namespace mojom {

NOINLINE static const char* SingletonJavaScriptValueToStringHelper(SingletonJavaScriptValue value) {
  // Defined in a helper function to ensure that Clang generates a lookup table.
  switch(value) {
    case SingletonJavaScriptValue::kNull:
      return "kNull";
    case SingletonJavaScriptValue::kUndefined:
      return "kUndefined";
    default:
      return nullptr;
  }
}

std::string SingletonJavaScriptValueToString(SingletonJavaScriptValue value) {
  const char *str = SingletonJavaScriptValueToStringHelper(value);
  if (!str) {
    return base::StringPrintf("Unknown SingletonJavaScriptValue value: %i", static_cast<int32_t>(value));
  }
  return str;
}

std::ostream& operator<<(std::ostream& os, SingletonJavaScriptValue value) {
  return os << SingletonJavaScriptValueToString(value);
}

NOINLINE static const char* RemoteArrayTypeToStringHelper(RemoteArrayType value) {
  // Defined in a helper function to ensure that Clang generates a lookup table.
  switch(value) {
    case RemoteArrayType::kInt8Array:
      return "kInt8Array";
    case RemoteArrayType::kUint8Array:
      return "kUint8Array";
    case RemoteArrayType::kInt16Array:
      return "kInt16Array";
    case RemoteArrayType::kUint16Array:
      return "kUint16Array";
    case RemoteArrayType::kInt32Array:
      return "kInt32Array";
    case RemoteArrayType::kUint32Array:
      return "kUint32Array";
    case RemoteArrayType::kFloat32Array:
      return "kFloat32Array";
    case RemoteArrayType::kFloat64Array:
      return "kFloat64Array";
    default:
      return nullptr;
  }
}

std::string RemoteArrayTypeToString(RemoteArrayType value) {
  const char *str = RemoteArrayTypeToStringHelper(value);
  if (!str) {
    return base::StringPrintf("Unknown RemoteArrayType value: %i", static_cast<int32_t>(value));
  }
  return str;
}

std::ostream& operator<<(std::ostream& os, RemoteArrayType value) {
  return os << RemoteArrayTypeToString(value);
}

NOINLINE static const char* RemoteInvocationErrorToStringHelper(RemoteInvocationError value) {
  // Defined in a helper function to ensure that Clang generates a lookup table.
  switch(value) {
    case RemoteInvocationError::OK:
      return "OK";
    case RemoteInvocationError::METHOD_NOT_FOUND:
      return "METHOD_NOT_FOUND";
    case RemoteInvocationError::OBJECT_GET_CLASS_BLOCKED:
      return "OBJECT_GET_CLASS_BLOCKED";
    case RemoteInvocationError::EXCEPTION_THROWN:
      return "EXCEPTION_THROWN";
    case RemoteInvocationError::NON_ASSIGNABLE_TYPES:
      return "NON_ASSIGNABLE_TYPES";
    default:
      return nullptr;
  }
}

std::string RemoteInvocationErrorToString(RemoteInvocationError value) {
  const char *str = RemoteInvocationErrorToStringHelper(value);
  if (!str) {
    return base::StringPrintf("Unknown RemoteInvocationError value: %i", static_cast<int32_t>(value));
  }
  return str;
}

std::ostream& operator<<(std::ostream& os, RemoteInvocationError value) {
  return os << RemoteInvocationErrorToString(value);
}

namespace internal {
// static
bool RemoteInvocationArgument_Data::Validate(
    const void* data,
    mojo::internal::ValidationContext* validation_context,
    bool inlined) {
  if (!data) {
    DCHECK(!inlined);
    return true;
  }

  // If it is inlined, the alignment is already enforced by its enclosing
  // object. We don't have to validate that.
  DCHECK(!inlined || mojo::internal::IsAligned(data));

  if (!inlined &&
      !mojo::internal::ValidateNonInlinedUnionHeaderAndClaimMemory(
          data, validation_context)) {
    return false;
  }

  const RemoteInvocationArgument_Data* object = static_cast<const RemoteInvocationArgument_Data*>(data);

  if (inlined && object->is_null())
    return true;

  switch (object->tag) {

    case RemoteInvocationArgument_Tag::kNumberValue: {

      return true;
    }
    case RemoteInvocationArgument_Tag::kBooleanValue: {

      return true;
    }
    case RemoteInvocationArgument_Tag::kStringValue: {

      if (!mojo::internal::ValidatePointerNonNullable(
              object->data.f_string_value, 3, validation_context)) {
        return false;
      }
      if (!mojo::internal::ValidateStruct(object->data.f_string_value, validation_context))
        return false;
      return true;
    }
    case RemoteInvocationArgument_Tag::kSingletonValue: {


      if (!::blink::mojom::internal::SingletonJavaScriptValue_Data
            ::Validate(object->data.f_singleton_value, validation_context))
        return false;
      return true;
    }
    case RemoteInvocationArgument_Tag::kArrayValue: {

      if (!mojo::internal::ValidatePointerNonNullable(
              object->data.f_array_value, 5, validation_context)) {
        return false;
      }
      constexpr const mojo::internal::ContainerValidateParams& array_value_validate_params =
          mojo::internal::GetArrayValidator<0, false, nullptr>();
      if (!mojo::internal::ValidateContainer(object->data.f_array_value, validation_context,
                                             &array_value_validate_params)) {
        return false;
      }
      return true;
    }
    case RemoteInvocationArgument_Tag::kTypedArrayValue: {

      if (!mojo::internal::ValidatePointerNonNullable(
              object->data.f_typed_array_value, 6, validation_context)) {
        return false;
      }
      if (!mojo::internal::ValidateStruct(object->data.f_typed_array_value, validation_context))
        return false;
      return true;
    }
    case RemoteInvocationArgument_Tag::kObjectIdValue: {

      return true;
    }
    default: {

      ReportValidationError(
          validation_context,
          mojo::internal::VALIDATION_ERROR_UNKNOWN_UNION_TAG,
          "unknown tag in RemoteInvocationArgument");
      return false;
    }
  }
}
// static
bool RemoteInvocationResultValue_Data::Validate(
    const void* data,
    mojo::internal::ValidationContext* validation_context,
    bool inlined) {
  if (!data) {
    DCHECK(!inlined);
    return true;
  }

  // If it is inlined, the alignment is already enforced by its enclosing
  // object. We don't have to validate that.
  DCHECK(!inlined || mojo::internal::IsAligned(data));

  if (!inlined &&
      !mojo::internal::ValidateNonInlinedUnionHeaderAndClaimMemory(
          data, validation_context)) {
    return false;
  }

  const RemoteInvocationResultValue_Data* object = static_cast<const RemoteInvocationResultValue_Data*>(data);

  if (inlined && object->is_null())
    return true;

  switch (object->tag) {

    case RemoteInvocationResultValue_Tag::kNumberValue: {

      return true;
    }
    case RemoteInvocationResultValue_Tag::kBooleanValue: {

      return true;
    }
    case RemoteInvocationResultValue_Tag::kStringValue: {

      if (!mojo::internal::ValidatePointerNonNullable(
              object->data.f_string_value, 3, validation_context)) {
        return false;
      }
      if (!mojo::internal::ValidateStruct(object->data.f_string_value, validation_context))
        return false;
      return true;
    }
    case RemoteInvocationResultValue_Tag::kSingletonValue: {


      if (!::blink::mojom::internal::SingletonJavaScriptValue_Data
            ::Validate(object->data.f_singleton_value, validation_context))
        return false;
      return true;
    }
    case RemoteInvocationResultValue_Tag::kObjectId: {

      return true;
    }
    default: {

      ReportValidationError(
          validation_context,
          mojo::internal::VALIDATION_ERROR_UNKNOWN_UNION_TAG,
          "unknown tag in RemoteInvocationResultValue");
      return false;
    }
  }
}


// static
bool RemoteTypedArray_Data::Validate(
    const void* data,
    mojo::internal::ValidationContext* validation_context) {
  if (!data)
    return true;
  if (!ValidateUnversionedStructHeaderAndSizeAndClaimMemory(
          data, 32, validation_context)) {
    return false;
  }

  // NOTE: The memory backing |object| may be smaller than |sizeof(*object)| if
  // the message comes from an older version.
  [[maybe_unused]] const RemoteTypedArray_Data* object =
      static_cast<const RemoteTypedArray_Data*>(data);


  if (!::blink::mojom::internal::RemoteArrayType_Data
        ::Validate(object->type, validation_context))
    return false;

  if (!mojo::internal::ValidateInlinedUnionNonNullable(
          object->buffer, 2, validation_context)) {
    return false;
  }
  if (!mojo::internal::ValidateInlinedUnion(object->buffer, validation_context))
    return false;

  return true;
}

RemoteTypedArray_Data::RemoteTypedArray_Data()
    : header_({sizeof(*this), 0}) {}


// static
bool RemoteInvocationResult_Data::Validate(
    const void* data,
    mojo::internal::ValidationContext* validation_context) {
  if (!data)
    return true;
  if (!ValidateUnversionedStructHeaderAndSizeAndClaimMemory(
          data, 32, validation_context)) {
    return false;
  }

  // NOTE: The memory backing |object| may be smaller than |sizeof(*object)| if
  // the message comes from an older version.
  [[maybe_unused]] const RemoteInvocationResult_Data* object =
      static_cast<const RemoteInvocationResult_Data*>(data);


  if (!::blink::mojom::internal::RemoteInvocationError_Data
        ::Validate(object->error, validation_context))
    return false;

  if (!mojo::internal::ValidateInlinedUnion(object->value, validation_context))
    return false;

  return true;
}

RemoteInvocationResult_Data::RemoteInvocationResult_Data()
    : header_({sizeof(*this), 0}) {}


// static
bool RemoteObjectHost_GetObject_Params_Data::Validate(
    const void* data,
    mojo::internal::ValidationContext* validation_context) {
  if (!data)
    return true;
  if (!ValidateUnversionedStructHeaderAndSizeAndClaimMemory(
          data, 16, validation_context)) {
    return false;
  }

  // NOTE: The memory backing |object| may be smaller than |sizeof(*object)| if
  // the message comes from an older version.
  [[maybe_unused]] const RemoteObjectHost_GetObject_Params_Data* object =
      static_cast<const RemoteObjectHost_GetObject_Params_Data*>(data);

  if (!mojo::internal::ValidateHandleOrInterfaceNonNullable(
          object->receiver, 2, validation_context)) {
    return false;
  }
  if (!mojo::internal::ValidateHandleOrInterface(object->receiver,
                                                 validation_context)) {
    return false;
  }

  return true;
}

RemoteObjectHost_GetObject_Params_Data::RemoteObjectHost_GetObject_Params_Data()
    : header_({sizeof(*this), 0}) {}


// static
bool RemoteObjectHost_AcquireObject_Params_Data::Validate(
    const void* data,
    mojo::internal::ValidationContext* validation_context) {
  if (!data)
    return true;
  if (!ValidateUnversionedStructHeaderAndSizeAndClaimMemory(
          data, 16, validation_context)) {
    return false;
  }

  // NOTE: The memory backing |object| may be smaller than |sizeof(*object)| if
  // the message comes from an older version.
  [[maybe_unused]] const RemoteObjectHost_AcquireObject_Params_Data* object =
      static_cast<const RemoteObjectHost_AcquireObject_Params_Data*>(data);

  return true;
}

RemoteObjectHost_AcquireObject_Params_Data::RemoteObjectHost_AcquireObject_Params_Data()
    : header_({sizeof(*this), 0}) {}


// static
bool RemoteObjectHost_ReleaseObject_Params_Data::Validate(
    const void* data,
    mojo::internal::ValidationContext* validation_context) {
  if (!data)
    return true;
  if (!ValidateUnversionedStructHeaderAndSizeAndClaimMemory(
          data, 16, validation_context)) {
    return false;
  }

  // NOTE: The memory backing |object| may be smaller than |sizeof(*object)| if
  // the message comes from an older version.
  [[maybe_unused]] const RemoteObjectHost_ReleaseObject_Params_Data* object =
      static_cast<const RemoteObjectHost_ReleaseObject_Params_Data*>(data);

  return true;
}

RemoteObjectHost_ReleaseObject_Params_Data::RemoteObjectHost_ReleaseObject_Params_Data()
    : header_({sizeof(*this), 0}) {}


// static
bool RemoteObject_HasMethod_Params_Data::Validate(
    const void* data,
    mojo::internal::ValidationContext* validation_context) {
  if (!data)
    return true;
  if (!ValidateUnversionedStructHeaderAndSizeAndClaimMemory(
          data, 16, validation_context)) {
    return false;
  }

  // NOTE: The memory backing |object| may be smaller than |sizeof(*object)| if
  // the message comes from an older version.
  [[maybe_unused]] const RemoteObject_HasMethod_Params_Data* object =
      static_cast<const RemoteObject_HasMethod_Params_Data*>(data);

  if (!mojo::internal::ValidatePointerNonNullable(
          object->name, 1, validation_context)) {
    return false;
  }
  constexpr const mojo::internal::ContainerValidateParams& name_validate_params =
      mojo::internal::GetArrayValidator<0, false, nullptr>();
  if (!mojo::internal::ValidateContainer(object->name, validation_context,
                                         &name_validate_params)) {
    return false;
  }

  return true;
}

RemoteObject_HasMethod_Params_Data::RemoteObject_HasMethod_Params_Data()
    : header_({sizeof(*this), 0}) {}


// static
bool RemoteObject_HasMethod_ResponseParams_Data::Validate(
    const void* data,
    mojo::internal::ValidationContext* validation_context) {
  if (!data)
    return true;
  if (!ValidateUnversionedStructHeaderAndSizeAndClaimMemory(
          data, 16, validation_context)) {
    return false;
  }

  // NOTE: The memory backing |object| may be smaller than |sizeof(*object)| if
  // the message comes from an older version.
  [[maybe_unused]] const RemoteObject_HasMethod_ResponseParams_Data* object =
      static_cast<const RemoteObject_HasMethod_ResponseParams_Data*>(data);

  return true;
}

RemoteObject_HasMethod_ResponseParams_Data::RemoteObject_HasMethod_ResponseParams_Data()
    : header_({sizeof(*this), 0}) {}


// static
bool RemoteObject_GetMethods_Params_Data::Validate(
    const void* data,
    mojo::internal::ValidationContext* validation_context) {
  if (!data)
    return true;
  if (!ValidateUnversionedStructHeaderAndSizeAndClaimMemory(
          data, 8, validation_context)) {
    return false;
  }

  // NOTE: The memory backing |object| may be smaller than |sizeof(*object)| if
  // the message comes from an older version.
  [[maybe_unused]] const RemoteObject_GetMethods_Params_Data* object =
      static_cast<const RemoteObject_GetMethods_Params_Data*>(data);

  return true;
}

RemoteObject_GetMethods_Params_Data::RemoteObject_GetMethods_Params_Data()
    : header_({sizeof(*this), 0}) {}


// static
bool RemoteObject_GetMethods_ResponseParams_Data::Validate(
    const void* data,
    mojo::internal::ValidationContext* validation_context) {
  if (!data)
    return true;
  if (!ValidateUnversionedStructHeaderAndSizeAndClaimMemory(
          data, 16, validation_context)) {
    return false;
  }

  // NOTE: The memory backing |object| may be smaller than |sizeof(*object)| if
  // the message comes from an older version.
  [[maybe_unused]] const RemoteObject_GetMethods_ResponseParams_Data* object =
      static_cast<const RemoteObject_GetMethods_ResponseParams_Data*>(data);

  if (!mojo::internal::ValidatePointerNonNullable(
          object->method_names, 1, validation_context)) {
    return false;
  }
  constexpr const mojo::internal::ContainerValidateParams& method_names_validate_params =
      mojo::internal::GetArrayValidator<0, false, &mojo::internal::GetArrayValidator<0, false, nullptr>()>();
  if (!mojo::internal::ValidateContainer(object->method_names, validation_context,
                                         &method_names_validate_params)) {
    return false;
  }

  return true;
}

RemoteObject_GetMethods_ResponseParams_Data::RemoteObject_GetMethods_ResponseParams_Data()
    : header_({sizeof(*this), 0}) {}


// static
bool RemoteObject_InvokeMethod_Params_Data::Validate(
    const void* data,
    mojo::internal::ValidationContext* validation_context) {
  if (!data)
    return true;
  if (!ValidateUnversionedStructHeaderAndSizeAndClaimMemory(
          data, 24, validation_context)) {
    return false;
  }

  // NOTE: The memory backing |object| may be smaller than |sizeof(*object)| if
  // the message comes from an older version.
  [[maybe_unused]] const RemoteObject_InvokeMethod_Params_Data* object =
      static_cast<const RemoteObject_InvokeMethod_Params_Data*>(data);

  if (!mojo::internal::ValidatePointerNonNullable(
          object->name, 1, validation_context)) {
    return false;
  }
  constexpr const mojo::internal::ContainerValidateParams& name_validate_params =
      mojo::internal::GetArrayValidator<0, false, nullptr>();
  if (!mojo::internal::ValidateContainer(object->name, validation_context,
                                         &name_validate_params)) {
    return false;
  }

  if (!mojo::internal::ValidatePointerNonNullable(
          object->arguments, 2, validation_context)) {
    return false;
  }
  constexpr const mojo::internal::ContainerValidateParams& arguments_validate_params =
      mojo::internal::GetArrayValidator<0, false, nullptr>();
  if (!mojo::internal::ValidateContainer(object->arguments, validation_context,
                                         &arguments_validate_params)) {
    return false;
  }

  return true;
}

RemoteObject_InvokeMethod_Params_Data::RemoteObject_InvokeMethod_Params_Data()
    : header_({sizeof(*this), 0}) {}


// static
bool RemoteObject_InvokeMethod_ResponseParams_Data::Validate(
    const void* data,
    mojo::internal::ValidationContext* validation_context) {
  if (!data)
    return true;
  if (!ValidateUnversionedStructHeaderAndSizeAndClaimMemory(
          data, 16, validation_context)) {
    return false;
  }

  // NOTE: The memory backing |object| may be smaller than |sizeof(*object)| if
  // the message comes from an older version.
  [[maybe_unused]] const RemoteObject_InvokeMethod_ResponseParams_Data* object =
      static_cast<const RemoteObject_InvokeMethod_ResponseParams_Data*>(data);

  if (!mojo::internal::ValidatePointerNonNullable(
          object->result, 1, validation_context)) {
    return false;
  }
  if (!mojo::internal::ValidateStruct(object->result, validation_context))
    return false;

  return true;
}

RemoteObject_InvokeMethod_ResponseParams_Data::RemoteObject_InvokeMethod_ResponseParams_Data()
    : header_({sizeof(*this), 0}) {}


// static
bool RemoteObject_NotifyReleasedObject_Params_Data::Validate(
    const void* data,
    mojo::internal::ValidationContext* validation_context) {
  if (!data)
    return true;
  if (!ValidateUnversionedStructHeaderAndSizeAndClaimMemory(
          data, 8, validation_context)) {
    return false;
  }

  // NOTE: The memory backing |object| may be smaller than |sizeof(*object)| if
  // the message comes from an older version.
  [[maybe_unused]] const RemoteObject_NotifyReleasedObject_Params_Data* object =
      static_cast<const RemoteObject_NotifyReleasedObject_Params_Data*>(data);

  return true;
}

RemoteObject_NotifyReleasedObject_Params_Data::RemoteObject_NotifyReleasedObject_Params_Data()
    : header_({sizeof(*this), 0}) {}


// static
bool RemoteObjectGatewayFactory_CreateRemoteObjectGateway_Params_Data::Validate(
    const void* data,
    mojo::internal::ValidationContext* validation_context) {
  if (!data)
    return true;
  if (!ValidateUnversionedStructHeaderAndSizeAndClaimMemory(
          data, 24, validation_context)) {
    return false;
  }

  // NOTE: The memory backing |object| may be smaller than |sizeof(*object)| if
  // the message comes from an older version.
  [[maybe_unused]] const RemoteObjectGatewayFactory_CreateRemoteObjectGateway_Params_Data* object =
      static_cast<const RemoteObjectGatewayFactory_CreateRemoteObjectGateway_Params_Data*>(data);

  if (!mojo::internal::ValidateHandleOrInterfaceNonNullable(
          object->host, 1, validation_context)) {
    return false;
  }
  if (!mojo::internal::ValidateHandleOrInterface(object->host,
                                                 validation_context)) {
    return false;
  }

  if (!mojo::internal::ValidateHandleOrInterfaceNonNullable(
          object->gateway, 2, validation_context)) {
    return false;
  }
  if (!mojo::internal::ValidateHandleOrInterface(object->gateway,
                                                 validation_context)) {
    return false;
  }

  return true;
}

RemoteObjectGatewayFactory_CreateRemoteObjectGateway_Params_Data::RemoteObjectGatewayFactory_CreateRemoteObjectGateway_Params_Data()
    : header_({sizeof(*this), 0}) {}


// static
bool RemoteObjectGateway_AddNamedObject_Params_Data::Validate(
    const void* data,
    mojo::internal::ValidationContext* validation_context) {
  if (!data)
    return true;
  if (!ValidateUnversionedStructHeaderAndSizeAndClaimMemory(
          data, 24, validation_context)) {
    return false;
  }

  // NOTE: The memory backing |object| may be smaller than |sizeof(*object)| if
  // the message comes from an older version.
  [[maybe_unused]] const RemoteObjectGateway_AddNamedObject_Params_Data* object =
      static_cast<const RemoteObjectGateway_AddNamedObject_Params_Data*>(data);

  if (!mojo::internal::ValidatePointerNonNullable(
          object->name, 1, validation_context)) {
    return false;
  }
  constexpr const mojo::internal::ContainerValidateParams& name_validate_params =
      mojo::internal::GetArrayValidator<0, false, nullptr>();
  if (!mojo::internal::ValidateContainer(object->name, validation_context,
                                         &name_validate_params)) {
    return false;
  }

  return true;
}

RemoteObjectGateway_AddNamedObject_Params_Data::RemoteObjectGateway_AddNamedObject_Params_Data()
    : header_({sizeof(*this), 0}) {}


// static
bool RemoteObjectGateway_RemoveNamedObject_Params_Data::Validate(
    const void* data,
    mojo::internal::ValidationContext* validation_context) {
  if (!data)
    return true;
  if (!ValidateUnversionedStructHeaderAndSizeAndClaimMemory(
          data, 16, validation_context)) {
    return false;
  }

  // NOTE: The memory backing |object| may be smaller than |sizeof(*object)| if
  // the message comes from an older version.
  [[maybe_unused]] const RemoteObjectGateway_RemoveNamedObject_Params_Data* object =
      static_cast<const RemoteObjectGateway_RemoveNamedObject_Params_Data*>(data);

  if (!mojo::internal::ValidatePointerNonNullable(
          object->name, 1, validation_context)) {
    return false;
  }
  constexpr const mojo::internal::ContainerValidateParams& name_validate_params =
      mojo::internal::GetArrayValidator<0, false, nullptr>();
  if (!mojo::internal::ValidateContainer(object->name, validation_context,
                                         &name_validate_params)) {
    return false;
  }

  return true;
}

RemoteObjectGateway_RemoveNamedObject_Params_Data::RemoteObjectGateway_RemoveNamedObject_Params_Data()
    : header_({sizeof(*this), 0}) {}

}  // namespace internal
}  // namespace mojom
}  // namespace blink

namespace perfetto {

// static
void TraceFormatTraits<::blink::mojom::SingletonJavaScriptValue>::WriteIntoTrace(
   perfetto::TracedValue context, ::blink::mojom::SingletonJavaScriptValue value) {
  return std::move(context).WriteString(::blink::mojom::SingletonJavaScriptValueToString(value));
}

} // namespace perfetto

namespace perfetto {

// static
void TraceFormatTraits<::blink::mojom::RemoteArrayType>::WriteIntoTrace(
   perfetto::TracedValue context, ::blink::mojom::RemoteArrayType value) {
  return std::move(context).WriteString(::blink::mojom::RemoteArrayTypeToString(value));
}

} // namespace perfetto

namespace perfetto {

// static
void TraceFormatTraits<::blink::mojom::RemoteInvocationError>::WriteIntoTrace(
   perfetto::TracedValue context, ::blink::mojom::RemoteInvocationError value) {
  return std::move(context).WriteString(::blink::mojom::RemoteInvocationErrorToString(value));
}

} // namespace perfetto