blob: ecbff7808601c851233ada5080561c0ee8ff4579 [file] [log] [blame]
// chromeos/ash/services/cros_healthd/public/mojom/cros_healthd_events.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 "chromeos/ash/services/cros_healthd/public/mojom/cros_healthd_events.mojom-shared.h"
// Used to support stream output operator for enums.
// TODO(dcheng): Consider omitting this somehow if not needed.
#include <ostream>
#include <utility>
#include "base/strings/stringprintf.h"
#include "mojo/public/cpp/bindings/lib/validate_params.h"
#include "mojo/public/cpp/bindings/lib/validation_errors.h"
#include "mojo/public/cpp/bindings/lib/validation_util.h"
#include "third_party/perfetto/include/perfetto/tracing/traced_value.h"
#include "chromeos/ash/services/cros_healthd/public/mojom/cros_healthd_events.mojom-params-data.h"
namespace ash {
namespace cros_healthd {
namespace mojom {
NOINLINE static const char* InputTouchButtonToStringHelper(InputTouchButton value) {
// Defined in a helper function to ensure that Clang generates a lookup table.
switch(value) {
case InputTouchButton::kUnmappedEnumField:
return "kUnmappedEnumField";
case InputTouchButton::kLeft:
return "kLeft";
case InputTouchButton::kMiddle:
return "kMiddle";
case InputTouchButton::kRight:
return "kRight";
default:
return nullptr;
}
}
std::string InputTouchButtonToString(InputTouchButton value) {
const char *str = InputTouchButtonToStringHelper(value);
if (!str) {
return base::StringPrintf("Unknown InputTouchButton value: %i", static_cast<int32_t>(value));
}
return str;
}
std::ostream& operator<<(std::ostream& os, InputTouchButton value) {
return os << InputTouchButtonToString(value);
}
NOINLINE static const char* EventCategoryEnumToStringHelper(EventCategoryEnum value) {
// Defined in a helper function to ensure that Clang generates a lookup table.
switch(value) {
case EventCategoryEnum::kUnmappedEnumField:
return "kUnmappedEnumField";
case EventCategoryEnum::kUsb:
return "kUsb";
case EventCategoryEnum::kThunderbolt:
return "kThunderbolt";
case EventCategoryEnum::kLid:
return "kLid";
case EventCategoryEnum::kBluetooth:
return "kBluetooth";
case EventCategoryEnum::kPower:
return "kPower";
case EventCategoryEnum::kAudio:
return "kAudio";
case EventCategoryEnum::kAudioJack:
return "kAudioJack";
case EventCategoryEnum::kSdCard:
return "kSdCard";
case EventCategoryEnum::kNetwork:
return "kNetwork";
case EventCategoryEnum::kKeyboardDiagnostic:
return "kKeyboardDiagnostic";
case EventCategoryEnum::kTouchpad:
return "kTouchpad";
case EventCategoryEnum::kExternalDisplay:
return "kExternalDisplay";
case EventCategoryEnum::kTouchscreen:
return "kTouchscreen";
case EventCategoryEnum::kStylusGarage:
return "kStylusGarage";
case EventCategoryEnum::kStylus:
return "kStylus";
case EventCategoryEnum::kCrash:
return "kCrash";
default:
return nullptr;
}
}
std::string EventCategoryEnumToString(EventCategoryEnum value) {
const char *str = EventCategoryEnumToStringHelper(value);
if (!str) {
return base::StringPrintf("Unknown EventCategoryEnum value: %i", static_cast<int32_t>(value));
}
return str;
}
std::ostream& operator<<(std::ostream& os, EventCategoryEnum value) {
return os << EventCategoryEnumToString(value);
}
NOINLINE static const char* UsbEventInfo_StateToStringHelper(UsbEventInfo_State value) {
// Defined in a helper function to ensure that Clang generates a lookup table.
switch(value) {
case UsbEventInfo_State::kUnmappedEnumField:
return "kUnmappedEnumField";
case UsbEventInfo_State::kAdd:
return "kAdd";
case UsbEventInfo_State::kRemove:
return "kRemove";
default:
return nullptr;
}
}
std::string UsbEventInfo_StateToString(UsbEventInfo_State value) {
const char *str = UsbEventInfo_StateToStringHelper(value);
if (!str) {
return base::StringPrintf("Unknown UsbEventInfo_State value: %i", static_cast<int32_t>(value));
}
return str;
}
std::ostream& operator<<(std::ostream& os, UsbEventInfo_State value) {
return os << UsbEventInfo_StateToString(value);
}
NOINLINE static const char* ThunderboltEventInfo_StateToStringHelper(ThunderboltEventInfo_State value) {
// Defined in a helper function to ensure that Clang generates a lookup table.
switch(value) {
case ThunderboltEventInfo_State::kUnmappedEnumField:
return "kUnmappedEnumField";
case ThunderboltEventInfo_State::kAdd:
return "kAdd";
case ThunderboltEventInfo_State::kRemove:
return "kRemove";
case ThunderboltEventInfo_State::kAuthorized:
return "kAuthorized";
case ThunderboltEventInfo_State::kUnAuthorized:
return "kUnAuthorized";
default:
return nullptr;
}
}
std::string ThunderboltEventInfo_StateToString(ThunderboltEventInfo_State value) {
const char *str = ThunderboltEventInfo_StateToStringHelper(value);
if (!str) {
return base::StringPrintf("Unknown ThunderboltEventInfo_State value: %i", static_cast<int32_t>(value));
}
return str;
}
std::ostream& operator<<(std::ostream& os, ThunderboltEventInfo_State value) {
return os << ThunderboltEventInfo_StateToString(value);
}
NOINLINE static const char* LidEventInfo_StateToStringHelper(LidEventInfo_State value) {
// Defined in a helper function to ensure that Clang generates a lookup table.
switch(value) {
case LidEventInfo_State::kUnmappedEnumField:
return "kUnmappedEnumField";
case LidEventInfo_State::kClosed:
return "kClosed";
case LidEventInfo_State::kOpened:
return "kOpened";
default:
return nullptr;
}
}
std::string LidEventInfo_StateToString(LidEventInfo_State value) {
const char *str = LidEventInfo_StateToStringHelper(value);
if (!str) {
return base::StringPrintf("Unknown LidEventInfo_State value: %i", static_cast<int32_t>(value));
}
return str;
}
std::ostream& operator<<(std::ostream& os, LidEventInfo_State value) {
return os << LidEventInfo_StateToString(value);
}
NOINLINE static const char* BluetoothEventInfo_StateToStringHelper(BluetoothEventInfo_State value) {
// Defined in a helper function to ensure that Clang generates a lookup table.
switch(value) {
case BluetoothEventInfo_State::kUnmappedEnumField:
return "kUnmappedEnumField";
case BluetoothEventInfo_State::kAdapterAdded:
return "kAdapterAdded";
case BluetoothEventInfo_State::kAdapterRemoved:
return "kAdapterRemoved";
case BluetoothEventInfo_State::kAdapterPropertyChanged:
return "kAdapterPropertyChanged";
case BluetoothEventInfo_State::kDeviceAdded:
return "kDeviceAdded";
case BluetoothEventInfo_State::kDeviceRemoved:
return "kDeviceRemoved";
case BluetoothEventInfo_State::kDevicePropertyChanged:
return "kDevicePropertyChanged";
default:
return nullptr;
}
}
std::string BluetoothEventInfo_StateToString(BluetoothEventInfo_State value) {
const char *str = BluetoothEventInfo_StateToStringHelper(value);
if (!str) {
return base::StringPrintf("Unknown BluetoothEventInfo_State value: %i", static_cast<int32_t>(value));
}
return str;
}
std::ostream& operator<<(std::ostream& os, BluetoothEventInfo_State value) {
return os << BluetoothEventInfo_StateToString(value);
}
NOINLINE static const char* PowerEventInfo_StateToStringHelper(PowerEventInfo_State value) {
// Defined in a helper function to ensure that Clang generates a lookup table.
switch(value) {
case PowerEventInfo_State::kUnmappedEnumField:
return "kUnmappedEnumField";
case PowerEventInfo_State::kAcInserted:
return "kAcInserted";
case PowerEventInfo_State::kAcRemoved:
return "kAcRemoved";
case PowerEventInfo_State::kOsSuspend:
return "kOsSuspend";
case PowerEventInfo_State::kOsResume:
return "kOsResume";
default:
return nullptr;
}
}
std::string PowerEventInfo_StateToString(PowerEventInfo_State value) {
const char *str = PowerEventInfo_StateToStringHelper(value);
if (!str) {
return base::StringPrintf("Unknown PowerEventInfo_State value: %i", static_cast<int32_t>(value));
}
return str;
}
std::ostream& operator<<(std::ostream& os, PowerEventInfo_State value) {
return os << PowerEventInfo_StateToString(value);
}
NOINLINE static const char* AudioEventInfo_StateToStringHelper(AudioEventInfo_State value) {
// Defined in a helper function to ensure that Clang generates a lookup table.
switch(value) {
case AudioEventInfo_State::kUnmappedEnumField:
return "kUnmappedEnumField";
case AudioEventInfo_State::kUnderrun:
return "kUnderrun";
case AudioEventInfo_State::kSevereUnderrun:
return "kSevereUnderrun";
default:
return nullptr;
}
}
std::string AudioEventInfo_StateToString(AudioEventInfo_State value) {
const char *str = AudioEventInfo_StateToStringHelper(value);
if (!str) {
return base::StringPrintf("Unknown AudioEventInfo_State value: %i", static_cast<int32_t>(value));
}
return str;
}
std::ostream& operator<<(std::ostream& os, AudioEventInfo_State value) {
return os << AudioEventInfo_StateToString(value);
}
NOINLINE static const char* AudioJackEventInfo_StateToStringHelper(AudioJackEventInfo_State value) {
// Defined in a helper function to ensure that Clang generates a lookup table.
switch(value) {
case AudioJackEventInfo_State::kUnmappedEnumField:
return "kUnmappedEnumField";
case AudioJackEventInfo_State::kAdd:
return "kAdd";
case AudioJackEventInfo_State::kRemove:
return "kRemove";
default:
return nullptr;
}
}
std::string AudioJackEventInfo_StateToString(AudioJackEventInfo_State value) {
const char *str = AudioJackEventInfo_StateToStringHelper(value);
if (!str) {
return base::StringPrintf("Unknown AudioJackEventInfo_State value: %i", static_cast<int32_t>(value));
}
return str;
}
std::ostream& operator<<(std::ostream& os, AudioJackEventInfo_State value) {
return os << AudioJackEventInfo_StateToString(value);
}
NOINLINE static const char* AudioJackEventInfo_DeviceTypeToStringHelper(AudioJackEventInfo_DeviceType value) {
// Defined in a helper function to ensure that Clang generates a lookup table.
switch(value) {
case AudioJackEventInfo_DeviceType::kUnmappedEnumField:
return "kUnmappedEnumField";
case AudioJackEventInfo_DeviceType::kHeadphone:
return "kHeadphone";
case AudioJackEventInfo_DeviceType::kMicrophone:
return "kMicrophone";
default:
return nullptr;
}
}
std::string AudioJackEventInfo_DeviceTypeToString(AudioJackEventInfo_DeviceType value) {
const char *str = AudioJackEventInfo_DeviceTypeToStringHelper(value);
if (!str) {
return base::StringPrintf("Unknown AudioJackEventInfo_DeviceType value: %i", static_cast<int32_t>(value));
}
return str;
}
std::ostream& operator<<(std::ostream& os, AudioJackEventInfo_DeviceType value) {
return os << AudioJackEventInfo_DeviceTypeToString(value);
}
NOINLINE static const char* SdCardEventInfo_StateToStringHelper(SdCardEventInfo_State value) {
// Defined in a helper function to ensure that Clang generates a lookup table.
switch(value) {
case SdCardEventInfo_State::kUnmappedEnumField:
return "kUnmappedEnumField";
case SdCardEventInfo_State::kAdd:
return "kAdd";
case SdCardEventInfo_State::kRemove:
return "kRemove";
default:
return nullptr;
}
}
std::string SdCardEventInfo_StateToString(SdCardEventInfo_State value) {
const char *str = SdCardEventInfo_StateToStringHelper(value);
if (!str) {
return base::StringPrintf("Unknown SdCardEventInfo_State value: %i", static_cast<int32_t>(value));
}
return str;
}
std::ostream& operator<<(std::ostream& os, SdCardEventInfo_State value) {
return os << SdCardEventInfo_StateToString(value);
}
NOINLINE static const char* ExternalDisplayEventInfo_StateToStringHelper(ExternalDisplayEventInfo_State value) {
// Defined in a helper function to ensure that Clang generates a lookup table.
switch(value) {
case ExternalDisplayEventInfo_State::kUnmappedEnumField:
return "kUnmappedEnumField";
case ExternalDisplayEventInfo_State::kAdd:
return "kAdd";
case ExternalDisplayEventInfo_State::kRemove:
return "kRemove";
default:
return nullptr;
}
}
std::string ExternalDisplayEventInfo_StateToString(ExternalDisplayEventInfo_State value) {
const char *str = ExternalDisplayEventInfo_StateToStringHelper(value);
if (!str) {
return base::StringPrintf("Unknown ExternalDisplayEventInfo_State value: %i", static_cast<int32_t>(value));
}
return str;
}
std::ostream& operator<<(std::ostream& os, ExternalDisplayEventInfo_State value) {
return os << ExternalDisplayEventInfo_StateToString(value);
}
NOINLINE static const char* StylusGarageEventInfo_StateToStringHelper(StylusGarageEventInfo_State value) {
// Defined in a helper function to ensure that Clang generates a lookup table.
switch(value) {
case StylusGarageEventInfo_State::kUnmappedEnumField:
return "kUnmappedEnumField";
case StylusGarageEventInfo_State::kInserted:
return "kInserted";
case StylusGarageEventInfo_State::kRemoved:
return "kRemoved";
default:
return nullptr;
}
}
std::string StylusGarageEventInfo_StateToString(StylusGarageEventInfo_State value) {
const char *str = StylusGarageEventInfo_StateToStringHelper(value);
if (!str) {
return base::StringPrintf("Unknown StylusGarageEventInfo_State value: %i", static_cast<int32_t>(value));
}
return str;
}
std::ostream& operator<<(std::ostream& os, StylusGarageEventInfo_State value) {
return os << StylusGarageEventInfo_StateToString(value);
}
NOINLINE static const char* CrashEventInfo_CrashTypeToStringHelper(CrashEventInfo_CrashType value) {
// Defined in a helper function to ensure that Clang generates a lookup table.
switch(value) {
case CrashEventInfo_CrashType::kUnknown:
return "kUnknown";
case CrashEventInfo_CrashType::kKernel:
return "kKernel";
case CrashEventInfo_CrashType::kEmbeddedController:
return "kEmbeddedController";
case CrashEventInfo_CrashType::kChrome:
return "kChrome";
default:
return nullptr;
}
}
std::string CrashEventInfo_CrashTypeToString(CrashEventInfo_CrashType value) {
const char *str = CrashEventInfo_CrashTypeToStringHelper(value);
if (!str) {
return base::StringPrintf("Unknown CrashEventInfo_CrashType value: %i", static_cast<int32_t>(value));
}
return str;
}
std::ostream& operator<<(std::ostream& os, CrashEventInfo_CrashType value) {
return os << CrashEventInfo_CrashTypeToString(value);
}
namespace internal {
// static
bool TouchpadEventInfo_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 TouchpadEventInfo_Data* object = static_cast<const TouchpadEventInfo_Data*>(data);
if (inlined && object->is_null())
return true;
switch (object->tag) {
case TouchpadEventInfo_Tag::kDefaultType: {
return true;
}
case TouchpadEventInfo_Tag::kButtonEvent: {
if (!mojo::internal::ValidatePointerNonNullable(
object->data.f_button_event, 2, validation_context)) {
return false;
}
if (!mojo::internal::ValidateStruct(object->data.f_button_event, validation_context))
return false;
return true;
}
case TouchpadEventInfo_Tag::kTouchEvent: {
if (!mojo::internal::ValidatePointerNonNullable(
object->data.f_touch_event, 3, validation_context)) {
return false;
}
if (!mojo::internal::ValidateStruct(object->data.f_touch_event, validation_context))
return false;
return true;
}
case TouchpadEventInfo_Tag::kConnectedEvent: {
if (!mojo::internal::ValidatePointerNonNullable(
object->data.f_connected_event, 4, validation_context)) {
return false;
}
if (!mojo::internal::ValidateStruct(object->data.f_connected_event, validation_context))
return false;
return true;
}
default: {
return true;
}
}
}
// static
bool TouchscreenEventInfo_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 TouchscreenEventInfo_Data* object = static_cast<const TouchscreenEventInfo_Data*>(data);
if (inlined && object->is_null())
return true;
switch (object->tag) {
case TouchscreenEventInfo_Tag::kDefaultType: {
return true;
}
case TouchscreenEventInfo_Tag::kTouchEvent: {
if (!mojo::internal::ValidatePointerNonNullable(
object->data.f_touch_event, 2, validation_context)) {
return false;
}
if (!mojo::internal::ValidateStruct(object->data.f_touch_event, validation_context))
return false;
return true;
}
case TouchscreenEventInfo_Tag::kConnectedEvent: {
if (!mojo::internal::ValidatePointerNonNullable(
object->data.f_connected_event, 3, validation_context)) {
return false;
}
if (!mojo::internal::ValidateStruct(object->data.f_connected_event, validation_context))
return false;
return true;
}
default: {
return true;
}
}
}
// static
bool StylusEventInfo_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 StylusEventInfo_Data* object = static_cast<const StylusEventInfo_Data*>(data);
if (inlined && object->is_null())
return true;
switch (object->tag) {
case StylusEventInfo_Tag::kDefaultType: {
return true;
}
case StylusEventInfo_Tag::kTouchEvent: {
if (!mojo::internal::ValidatePointerNonNullable(
object->data.f_touch_event, 2, validation_context)) {
return false;
}
if (!mojo::internal::ValidateStruct(object->data.f_touch_event, validation_context))
return false;
return true;
}
case StylusEventInfo_Tag::kConnectedEvent: {
if (!mojo::internal::ValidatePointerNonNullable(
object->data.f_connected_event, 3, validation_context)) {
return false;
}
if (!mojo::internal::ValidateStruct(object->data.f_connected_event, validation_context))
return false;
return true;
}
default: {
return true;
}
}
}
// static
bool EventInfo_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 EventInfo_Data* object = static_cast<const EventInfo_Data*>(data);
if (inlined && object->is_null())
return true;
switch (object->tag) {
case EventInfo_Tag::kDefaultType: {
return true;
}
case EventInfo_Tag::kUsbEventInfo: {
if (!mojo::internal::ValidatePointerNonNullable(
object->data.f_usb_event_info, 2, validation_context)) {
return false;
}
if (!mojo::internal::ValidateStruct(object->data.f_usb_event_info, validation_context))
return false;
return true;
}
case EventInfo_Tag::kThunderboltEventInfo: {
if (!mojo::internal::ValidatePointerNonNullable(
object->data.f_thunderbolt_event_info, 3, validation_context)) {
return false;
}
if (!mojo::internal::ValidateStruct(object->data.f_thunderbolt_event_info, validation_context))
return false;
return true;
}
case EventInfo_Tag::kLidEventInfo: {
if (!mojo::internal::ValidatePointerNonNullable(
object->data.f_lid_event_info, 4, validation_context)) {
return false;
}
if (!mojo::internal::ValidateStruct(object->data.f_lid_event_info, validation_context))
return false;
return true;
}
case EventInfo_Tag::kBluetoothEventInfo: {
if (!mojo::internal::ValidatePointerNonNullable(
object->data.f_bluetooth_event_info, 5, validation_context)) {
return false;
}
if (!mojo::internal::ValidateStruct(object->data.f_bluetooth_event_info, validation_context))
return false;
return true;
}
case EventInfo_Tag::kPowerEventInfo: {
if (!mojo::internal::ValidatePointerNonNullable(
object->data.f_power_event_info, 6, validation_context)) {
return false;
}
if (!mojo::internal::ValidateStruct(object->data.f_power_event_info, validation_context))
return false;
return true;
}
case EventInfo_Tag::kAudioEventInfo: {
if (!mojo::internal::ValidatePointerNonNullable(
object->data.f_audio_event_info, 7, validation_context)) {
return false;
}
if (!mojo::internal::ValidateStruct(object->data.f_audio_event_info, validation_context))
return false;
return true;
}
case EventInfo_Tag::kAudioJackEventInfo: {
if (!mojo::internal::ValidatePointerNonNullable(
object->data.f_audio_jack_event_info, 8, validation_context)) {
return false;
}
if (!mojo::internal::ValidateStruct(object->data.f_audio_jack_event_info, validation_context))
return false;
return true;
}
case EventInfo_Tag::kSdCardEventInfo: {
if (!mojo::internal::ValidatePointerNonNullable(
object->data.f_sd_card_event_info, 9, validation_context)) {
return false;
}
if (!mojo::internal::ValidateStruct(object->data.f_sd_card_event_info, validation_context))
return false;
return true;
}
case EventInfo_Tag::kKeyboardDiagnosticEventInfo: {
if (!mojo::internal::ValidatePointerNonNullable(
object->data.f_keyboard_diagnostic_event_info, 10, validation_context)) {
return false;
}
if (!mojo::internal::ValidateStruct(object->data.f_keyboard_diagnostic_event_info, validation_context))
return false;
return true;
}
case EventInfo_Tag::kTouchpadEventInfo: {
if (!mojo::internal::ValidatePointerNonNullable(
object->data.f_touchpad_event_info, 11, validation_context)) {
return false;
}
if (!mojo::internal::ValidateNonInlinedUnion(object->data.f_touchpad_event_info,
validation_context))
return false;
return true;
}
case EventInfo_Tag::kExternalDisplayEventInfo: {
if (!mojo::internal::ValidatePointerNonNullable(
object->data.f_external_display_event_info, 12, validation_context)) {
return false;
}
if (!mojo::internal::ValidateStruct(object->data.f_external_display_event_info, validation_context))
return false;
return true;
}
case EventInfo_Tag::kTouchscreenEventInfo: {
if (!mojo::internal::ValidatePointerNonNullable(
object->data.f_touchscreen_event_info, 13, validation_context)) {
return false;
}
if (!mojo::internal::ValidateNonInlinedUnion(object->data.f_touchscreen_event_info,
validation_context))
return false;
return true;
}
case EventInfo_Tag::kStylusGarageEventInfo: {
if (!mojo::internal::ValidatePointerNonNullable(
object->data.f_stylus_garage_event_info, 14, validation_context)) {
return false;
}
if (!mojo::internal::ValidateStruct(object->data.f_stylus_garage_event_info, validation_context))
return false;
return true;
}
case EventInfo_Tag::kStylusEventInfo: {
if (!mojo::internal::ValidatePointerNonNullable(
object->data.f_stylus_event_info, 15, validation_context)) {
return false;
}
if (!mojo::internal::ValidateNonInlinedUnion(object->data.f_stylus_event_info,
validation_context))
return false;
return true;
}
case EventInfo_Tag::kCrashEventInfo: {
if (!mojo::internal::ValidatePointerNonNullable(
object->data.f_crash_event_info, 16, validation_context)) {
return false;
}
if (!mojo::internal::ValidateStruct(object->data.f_crash_event_info, validation_context))
return false;
return true;
}
default: {
return true;
}
}
}
// static
bool UsbEventInfo_Data::Validate(
const void* data,
mojo::internal::ValidationContext* validation_context) {
if (!data)
return true;
static constexpr mojo::internal::StructVersionSize kVersionSizes[] = {
{ 0, 40 },
{ 1, 40 },
};
if (!ValidateStructHeaderAndVersionSizeAndClaimMemory(
data, kVersionSizes, 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 UsbEventInfo_Data* object =
static_cast<const UsbEventInfo_Data*>(data);
if (!mojo::internal::ValidatePointerNonNullable(
object->vendor, 1, validation_context)) {
return false;
}
constexpr const mojo::internal::ContainerValidateParams& vendor_validate_params =
mojo::internal::GetArrayValidator<0, false, nullptr>();
if (!mojo::internal::ValidateContainer(object->vendor, validation_context,
&vendor_validate_params)) {
return false;
}
if (!mojo::internal::ValidatePointerNonNullable(
object->name, 2, 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->categories, 5, validation_context)) {
return false;
}
constexpr const mojo::internal::ContainerValidateParams& categories_validate_params =
mojo::internal::GetArrayValidator<0, false, &mojo::internal::GetArrayValidator<0, false, nullptr>()>();
if (!mojo::internal::ValidateContainer(object->categories, validation_context,
&categories_validate_params)) {
return false;
}
if (object->header_.version < 1)
return true;
if (!::ash::cros_healthd::mojom::internal::UsbEventInfo_State_Data
::Validate(object->state, validation_context))
return false;
return true;
}
UsbEventInfo_Data::UsbEventInfo_Data()
: header_({sizeof(*this), 1}) {}
// static
bool ThunderboltEventInfo_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 ThunderboltEventInfo_Data* object =
static_cast<const ThunderboltEventInfo_Data*>(data);
if (!::ash::cros_healthd::mojom::internal::ThunderboltEventInfo_State_Data
::Validate(object->state, validation_context))
return false;
return true;
}
ThunderboltEventInfo_Data::ThunderboltEventInfo_Data()
: header_({sizeof(*this), 0}) {}
// static
bool LidEventInfo_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 LidEventInfo_Data* object =
static_cast<const LidEventInfo_Data*>(data);
if (!::ash::cros_healthd::mojom::internal::LidEventInfo_State_Data
::Validate(object->state, validation_context))
return false;
return true;
}
LidEventInfo_Data::LidEventInfo_Data()
: header_({sizeof(*this), 0}) {}
// static
bool BluetoothEventInfo_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 BluetoothEventInfo_Data* object =
static_cast<const BluetoothEventInfo_Data*>(data);
if (!::ash::cros_healthd::mojom::internal::BluetoothEventInfo_State_Data
::Validate(object->state, validation_context))
return false;
return true;
}
BluetoothEventInfo_Data::BluetoothEventInfo_Data()
: header_({sizeof(*this), 0}) {}
// static
bool PowerEventInfo_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 PowerEventInfo_Data* object =
static_cast<const PowerEventInfo_Data*>(data);
if (!::ash::cros_healthd::mojom::internal::PowerEventInfo_State_Data
::Validate(object->state, validation_context))
return false;
return true;
}
PowerEventInfo_Data::PowerEventInfo_Data()
: header_({sizeof(*this), 0}) {}
// static
bool AudioEventInfo_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 AudioEventInfo_Data* object =
static_cast<const AudioEventInfo_Data*>(data);
if (!::ash::cros_healthd::mojom::internal::AudioEventInfo_State_Data
::Validate(object->state, validation_context))
return false;
return true;
}
AudioEventInfo_Data::AudioEventInfo_Data()
: header_({sizeof(*this), 0}) {}
// static
bool AudioJackEventInfo_Data::Validate(
const void* data,
mojo::internal::ValidationContext* validation_context) {
if (!data)
return true;
static constexpr mojo::internal::StructVersionSize kVersionSizes[] = {
{ 0, 16 },
{ 1, 16 },
};
if (!ValidateStructHeaderAndVersionSizeAndClaimMemory(
data, kVersionSizes, 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 AudioJackEventInfo_Data* object =
static_cast<const AudioJackEventInfo_Data*>(data);
if (!::ash::cros_healthd::mojom::internal::AudioJackEventInfo_State_Data
::Validate(object->state, validation_context))
return false;
if (object->header_.version < 1)
return true;
if (!::ash::cros_healthd::mojom::internal::AudioJackEventInfo_DeviceType_Data
::Validate(object->device_type, validation_context))
return false;
return true;
}
AudioJackEventInfo_Data::AudioJackEventInfo_Data()
: header_({sizeof(*this), 1}) {}
// static
bool SdCardEventInfo_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 SdCardEventInfo_Data* object =
static_cast<const SdCardEventInfo_Data*>(data);
if (!::ash::cros_healthd::mojom::internal::SdCardEventInfo_State_Data
::Validate(object->state, validation_context))
return false;
return true;
}
SdCardEventInfo_Data::SdCardEventInfo_Data()
: header_({sizeof(*this), 0}) {}
// static
bool TouchpadButtonEvent_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 TouchpadButtonEvent_Data* object =
static_cast<const TouchpadButtonEvent_Data*>(data);
if (!::ash::cros_healthd::mojom::internal::InputTouchButton_Data
::Validate(object->button, validation_context))
return false;
return true;
}
TouchpadButtonEvent_Data::TouchpadButtonEvent_Data()
: header_({sizeof(*this), 0}) {}
// static
bool TouchPointInfo_Data::Validate(
const void* data,
mojo::internal::ValidationContext* validation_context) {
if (!data)
return true;
if (!ValidateUnversionedStructHeaderAndSizeAndClaimMemory(
data, 48, 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 TouchPointInfo_Data* object =
static_cast<const TouchPointInfo_Data*>(data);
if (!mojo::internal::ValidateStruct(object->pressure, validation_context))
return false;
if (!mojo::internal::ValidateStruct(object->touch_major, validation_context))
return false;
if (!mojo::internal::ValidateStruct(object->touch_minor, validation_context))
return false;
return true;
}
TouchPointInfo_Data::TouchPointInfo_Data()
: header_({sizeof(*this), 0}) {}
// static
bool TouchpadTouchEvent_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 TouchpadTouchEvent_Data* object =
static_cast<const TouchpadTouchEvent_Data*>(data);
if (!mojo::internal::ValidatePointerNonNullable(
object->touch_points, 1, validation_context)) {
return false;
}
constexpr const mojo::internal::ContainerValidateParams& touch_points_validate_params =
mojo::internal::GetArrayValidator<0, false, nullptr>();
if (!mojo::internal::ValidateContainer(object->touch_points, validation_context,
&touch_points_validate_params)) {
return false;
}
return true;
}
TouchpadTouchEvent_Data::TouchpadTouchEvent_Data()
: header_({sizeof(*this), 0}) {}
// static
bool TouchpadConnectedEvent_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 TouchpadConnectedEvent_Data* object =
static_cast<const TouchpadConnectedEvent_Data*>(data);
if (!mojo::internal::ValidatePointerNonNullable(
object->buttons, 4, validation_context)) {
return false;
}
constexpr const mojo::internal::ContainerValidateParams& buttons_validate_params =
mojo::internal::GetArrayOfEnumsValidator<0, false, ::ash::cros_healthd::mojom::internal::InputTouchButton_Data::Validate>();
if (!mojo::internal::ValidateContainer(object->buttons, validation_context,
&buttons_validate_params)) {
return false;
}
return true;
}
TouchpadConnectedEvent_Data::TouchpadConnectedEvent_Data()
: header_({sizeof(*this), 0}) {}
// static
bool ExternalDisplayEventInfo_Data::Validate(
const void* data,
mojo::internal::ValidationContext* validation_context) {
if (!data)
return true;
static constexpr mojo::internal::StructVersionSize kVersionSizes[] = {
{ 0, 16 },
{ 1, 24 },
};
if (!ValidateStructHeaderAndVersionSizeAndClaimMemory(
data, kVersionSizes, 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 ExternalDisplayEventInfo_Data* object =
static_cast<const ExternalDisplayEventInfo_Data*>(data);
if (!::ash::cros_healthd::mojom::internal::ExternalDisplayEventInfo_State_Data
::Validate(object->state, validation_context))
return false;
if (object->header_.version < 1)
return true;
if (!mojo::internal::ValidateStruct(object->display_info, validation_context))
return false;
return true;
}
ExternalDisplayEventInfo_Data::ExternalDisplayEventInfo_Data()
: header_({sizeof(*this), 1}) {}
// static
bool TouchscreenTouchEvent_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 TouchscreenTouchEvent_Data* object =
static_cast<const TouchscreenTouchEvent_Data*>(data);
if (!mojo::internal::ValidatePointerNonNullable(
object->touch_points, 1, validation_context)) {
return false;
}
constexpr const mojo::internal::ContainerValidateParams& touch_points_validate_params =
mojo::internal::GetArrayValidator<0, false, nullptr>();
if (!mojo::internal::ValidateContainer(object->touch_points, validation_context,
&touch_points_validate_params)) {
return false;
}
return true;
}
TouchscreenTouchEvent_Data::TouchscreenTouchEvent_Data()
: header_({sizeof(*this), 0}) {}
// static
bool TouchscreenConnectedEvent_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 TouchscreenConnectedEvent_Data* object =
static_cast<const TouchscreenConnectedEvent_Data*>(data);
return true;
}
TouchscreenConnectedEvent_Data::TouchscreenConnectedEvent_Data()
: header_({sizeof(*this), 0}) {}
// static
bool StylusGarageEventInfo_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 StylusGarageEventInfo_Data* object =
static_cast<const StylusGarageEventInfo_Data*>(data);
if (!::ash::cros_healthd::mojom::internal::StylusGarageEventInfo_State_Data
::Validate(object->state, validation_context))
return false;
return true;
}
StylusGarageEventInfo_Data::StylusGarageEventInfo_Data()
: header_({sizeof(*this), 0}) {}
// static
bool StylusTouchPointInfo_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 StylusTouchPointInfo_Data* object =
static_cast<const StylusTouchPointInfo_Data*>(data);
if (!mojo::internal::ValidateStruct(object->pressure, validation_context))
return false;
return true;
}
StylusTouchPointInfo_Data::StylusTouchPointInfo_Data()
: header_({sizeof(*this), 0}) {}
// static
bool StylusTouchEvent_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 StylusTouchEvent_Data* object =
static_cast<const StylusTouchEvent_Data*>(data);
if (!mojo::internal::ValidateStruct(object->touch_point, validation_context))
return false;
return true;
}
StylusTouchEvent_Data::StylusTouchEvent_Data()
: header_({sizeof(*this), 0}) {}
// static
bool StylusConnectedEvent_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 StylusConnectedEvent_Data* object =
static_cast<const StylusConnectedEvent_Data*>(data);
return true;
}
StylusConnectedEvent_Data::StylusConnectedEvent_Data()
: header_({sizeof(*this), 0}) {}
// static
bool CrashUploadInfo_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 CrashUploadInfo_Data* object =
static_cast<const CrashUploadInfo_Data*>(data);
if (!mojo::internal::ValidatePointerNonNullable(
object->crash_report_id, 1, validation_context)) {
return false;
}
constexpr const mojo::internal::ContainerValidateParams& crash_report_id_validate_params =
mojo::internal::GetArrayValidator<0, false, nullptr>();
if (!mojo::internal::ValidateContainer(object->crash_report_id, validation_context,
&crash_report_id_validate_params)) {
return false;
}
if (!mojo::internal::ValidatePointerNonNullable(
object->creation_time, 2, validation_context)) {
return false;
}
if (!mojo::internal::ValidateStruct(object->creation_time, validation_context))
return false;
return true;
}
CrashUploadInfo_Data::CrashUploadInfo_Data()
: header_({sizeof(*this), 0}) {}
// static
bool CrashEventInfo_Data::Validate(
const void* data,
mojo::internal::ValidationContext* validation_context) {
if (!data)
return true;
if (!ValidateUnversionedStructHeaderAndSizeAndClaimMemory(
data, 40, 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 CrashEventInfo_Data* object =
static_cast<const CrashEventInfo_Data*>(data);
if (!::ash::cros_healthd::mojom::internal::CrashEventInfo_CrashType_Data
::Validate(object->crash_type, validation_context))
return false;
if (!mojo::internal::ValidatePointerNonNullable(
object->local_id, 2, validation_context)) {
return false;
}
constexpr const mojo::internal::ContainerValidateParams& local_id_validate_params =
mojo::internal::GetArrayValidator<0, false, nullptr>();
if (!mojo::internal::ValidateContainer(object->local_id, validation_context,
&local_id_validate_params)) {
return false;
}
if (!mojo::internal::ValidatePointerNonNullable(
object->capture_time, 3, validation_context)) {
return false;
}
if (!mojo::internal::ValidateStruct(object->capture_time, validation_context))
return false;
if (!mojo::internal::ValidateStruct(object->upload_info, validation_context))
return false;
return true;
}
CrashEventInfo_Data::CrashEventInfo_Data()
: header_({sizeof(*this), 0}) {}
// static
bool CrosHealthdBluetoothObserver_OnAdapterAdded_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 CrosHealthdBluetoothObserver_OnAdapterAdded_Params_Data* object =
static_cast<const CrosHealthdBluetoothObserver_OnAdapterAdded_Params_Data*>(data);
return true;
}
CrosHealthdBluetoothObserver_OnAdapterAdded_Params_Data::CrosHealthdBluetoothObserver_OnAdapterAdded_Params_Data()
: header_({sizeof(*this), 0}) {}
// static
bool CrosHealthdBluetoothObserver_OnAdapterRemoved_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 CrosHealthdBluetoothObserver_OnAdapterRemoved_Params_Data* object =
static_cast<const CrosHealthdBluetoothObserver_OnAdapterRemoved_Params_Data*>(data);
return true;
}
CrosHealthdBluetoothObserver_OnAdapterRemoved_Params_Data::CrosHealthdBluetoothObserver_OnAdapterRemoved_Params_Data()
: header_({sizeof(*this), 0}) {}
// static
bool CrosHealthdBluetoothObserver_OnAdapterPropertyChanged_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 CrosHealthdBluetoothObserver_OnAdapterPropertyChanged_Params_Data* object =
static_cast<const CrosHealthdBluetoothObserver_OnAdapterPropertyChanged_Params_Data*>(data);
return true;
}
CrosHealthdBluetoothObserver_OnAdapterPropertyChanged_Params_Data::CrosHealthdBluetoothObserver_OnAdapterPropertyChanged_Params_Data()
: header_({sizeof(*this), 0}) {}
// static
bool CrosHealthdBluetoothObserver_OnDeviceAdded_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 CrosHealthdBluetoothObserver_OnDeviceAdded_Params_Data* object =
static_cast<const CrosHealthdBluetoothObserver_OnDeviceAdded_Params_Data*>(data);
return true;
}
CrosHealthdBluetoothObserver_OnDeviceAdded_Params_Data::CrosHealthdBluetoothObserver_OnDeviceAdded_Params_Data()
: header_({sizeof(*this), 0}) {}
// static
bool CrosHealthdBluetoothObserver_OnDeviceRemoved_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 CrosHealthdBluetoothObserver_OnDeviceRemoved_Params_Data* object =
static_cast<const CrosHealthdBluetoothObserver_OnDeviceRemoved_Params_Data*>(data);
return true;
}
CrosHealthdBluetoothObserver_OnDeviceRemoved_Params_Data::CrosHealthdBluetoothObserver_OnDeviceRemoved_Params_Data()
: header_({sizeof(*this), 0}) {}
// static
bool CrosHealthdBluetoothObserver_OnDevicePropertyChanged_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 CrosHealthdBluetoothObserver_OnDevicePropertyChanged_Params_Data* object =
static_cast<const CrosHealthdBluetoothObserver_OnDevicePropertyChanged_Params_Data*>(data);
return true;
}
CrosHealthdBluetoothObserver_OnDevicePropertyChanged_Params_Data::CrosHealthdBluetoothObserver_OnDevicePropertyChanged_Params_Data()
: header_({sizeof(*this), 0}) {}
// static
bool CrosHealthdLidObserver_OnLidClosed_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 CrosHealthdLidObserver_OnLidClosed_Params_Data* object =
static_cast<const CrosHealthdLidObserver_OnLidClosed_Params_Data*>(data);
return true;
}
CrosHealthdLidObserver_OnLidClosed_Params_Data::CrosHealthdLidObserver_OnLidClosed_Params_Data()
: header_({sizeof(*this), 0}) {}
// static
bool CrosHealthdLidObserver_OnLidOpened_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 CrosHealthdLidObserver_OnLidOpened_Params_Data* object =
static_cast<const CrosHealthdLidObserver_OnLidOpened_Params_Data*>(data);
return true;
}
CrosHealthdLidObserver_OnLidOpened_Params_Data::CrosHealthdLidObserver_OnLidOpened_Params_Data()
: header_({sizeof(*this), 0}) {}
// static
bool CrosHealthdPowerObserver_OnAcInserted_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 CrosHealthdPowerObserver_OnAcInserted_Params_Data* object =
static_cast<const CrosHealthdPowerObserver_OnAcInserted_Params_Data*>(data);
return true;
}
CrosHealthdPowerObserver_OnAcInserted_Params_Data::CrosHealthdPowerObserver_OnAcInserted_Params_Data()
: header_({sizeof(*this), 0}) {}
// static
bool CrosHealthdPowerObserver_OnAcRemoved_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 CrosHealthdPowerObserver_OnAcRemoved_Params_Data* object =
static_cast<const CrosHealthdPowerObserver_OnAcRemoved_Params_Data*>(data);
return true;
}
CrosHealthdPowerObserver_OnAcRemoved_Params_Data::CrosHealthdPowerObserver_OnAcRemoved_Params_Data()
: header_({sizeof(*this), 0}) {}
// static
bool CrosHealthdPowerObserver_OnOsSuspend_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 CrosHealthdPowerObserver_OnOsSuspend_Params_Data* object =
static_cast<const CrosHealthdPowerObserver_OnOsSuspend_Params_Data*>(data);
return true;
}
CrosHealthdPowerObserver_OnOsSuspend_Params_Data::CrosHealthdPowerObserver_OnOsSuspend_Params_Data()
: header_({sizeof(*this), 0}) {}
// static
bool CrosHealthdPowerObserver_OnOsResume_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 CrosHealthdPowerObserver_OnOsResume_Params_Data* object =
static_cast<const CrosHealthdPowerObserver_OnOsResume_Params_Data*>(data);
return true;
}
CrosHealthdPowerObserver_OnOsResume_Params_Data::CrosHealthdPowerObserver_OnOsResume_Params_Data()
: header_({sizeof(*this), 0}) {}
// static
bool CrosHealthdAudioObserver_OnUnderrun_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 CrosHealthdAudioObserver_OnUnderrun_Params_Data* object =
static_cast<const CrosHealthdAudioObserver_OnUnderrun_Params_Data*>(data);
return true;
}
CrosHealthdAudioObserver_OnUnderrun_Params_Data::CrosHealthdAudioObserver_OnUnderrun_Params_Data()
: header_({sizeof(*this), 0}) {}
// static
bool CrosHealthdAudioObserver_OnSevereUnderrun_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 CrosHealthdAudioObserver_OnSevereUnderrun_Params_Data* object =
static_cast<const CrosHealthdAudioObserver_OnSevereUnderrun_Params_Data*>(data);
return true;
}
CrosHealthdAudioObserver_OnSevereUnderrun_Params_Data::CrosHealthdAudioObserver_OnSevereUnderrun_Params_Data()
: header_({sizeof(*this), 0}) {}
// static
bool CrosHealthdThunderboltObserver_OnAdd_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 CrosHealthdThunderboltObserver_OnAdd_Params_Data* object =
static_cast<const CrosHealthdThunderboltObserver_OnAdd_Params_Data*>(data);
return true;
}
CrosHealthdThunderboltObserver_OnAdd_Params_Data::CrosHealthdThunderboltObserver_OnAdd_Params_Data()
: header_({sizeof(*this), 0}) {}
// static
bool CrosHealthdThunderboltObserver_OnRemove_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 CrosHealthdThunderboltObserver_OnRemove_Params_Data* object =
static_cast<const CrosHealthdThunderboltObserver_OnRemove_Params_Data*>(data);
return true;
}
CrosHealthdThunderboltObserver_OnRemove_Params_Data::CrosHealthdThunderboltObserver_OnRemove_Params_Data()
: header_({sizeof(*this), 0}) {}
// static
bool CrosHealthdThunderboltObserver_OnAuthorized_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 CrosHealthdThunderboltObserver_OnAuthorized_Params_Data* object =
static_cast<const CrosHealthdThunderboltObserver_OnAuthorized_Params_Data*>(data);
return true;
}
CrosHealthdThunderboltObserver_OnAuthorized_Params_Data::CrosHealthdThunderboltObserver_OnAuthorized_Params_Data()
: header_({sizeof(*this), 0}) {}
// static
bool CrosHealthdThunderboltObserver_OnUnAuthorized_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 CrosHealthdThunderboltObserver_OnUnAuthorized_Params_Data* object =
static_cast<const CrosHealthdThunderboltObserver_OnUnAuthorized_Params_Data*>(data);
return true;
}
CrosHealthdThunderboltObserver_OnUnAuthorized_Params_Data::CrosHealthdThunderboltObserver_OnUnAuthorized_Params_Data()
: header_({sizeof(*this), 0}) {}
// static
bool CrosHealthdUsbObserver_OnAdd_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 CrosHealthdUsbObserver_OnAdd_Params_Data* object =
static_cast<const CrosHealthdUsbObserver_OnAdd_Params_Data*>(data);
if (!mojo::internal::ValidatePointerNonNullable(
object->info, 1, validation_context)) {
return false;
}
if (!mojo::internal::ValidateStruct(object->info, validation_context))
return false;
return true;
}
CrosHealthdUsbObserver_OnAdd_Params_Data::CrosHealthdUsbObserver_OnAdd_Params_Data()
: header_({sizeof(*this), 0}) {}
// static
bool CrosHealthdUsbObserver_OnRemove_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 CrosHealthdUsbObserver_OnRemove_Params_Data* object =
static_cast<const CrosHealthdUsbObserver_OnRemove_Params_Data*>(data);
if (!mojo::internal::ValidatePointerNonNullable(
object->info, 1, validation_context)) {
return false;
}
if (!mojo::internal::ValidateStruct(object->info, validation_context))
return false;
return true;
}
CrosHealthdUsbObserver_OnRemove_Params_Data::CrosHealthdUsbObserver_OnRemove_Params_Data()
: header_({sizeof(*this), 0}) {}
// static
bool CrosHealthdSdCardObserver_OnAdd_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 CrosHealthdSdCardObserver_OnAdd_Params_Data* object =
static_cast<const CrosHealthdSdCardObserver_OnAdd_Params_Data*>(data);
return true;
}
CrosHealthdSdCardObserver_OnAdd_Params_Data::CrosHealthdSdCardObserver_OnAdd_Params_Data()
: header_({sizeof(*this), 0}) {}
// static
bool CrosHealthdSdCardObserver_OnRemove_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 CrosHealthdSdCardObserver_OnRemove_Params_Data* object =
static_cast<const CrosHealthdSdCardObserver_OnRemove_Params_Data*>(data);
return true;
}
CrosHealthdSdCardObserver_OnRemove_Params_Data::CrosHealthdSdCardObserver_OnRemove_Params_Data()
: header_({sizeof(*this), 0}) {}
// static
bool EventObserver_OnEvent_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 EventObserver_OnEvent_Params_Data* object =
static_cast<const EventObserver_OnEvent_Params_Data*>(data);
if (!mojo::internal::ValidateInlinedUnionNonNullable(
object->info, 1, validation_context)) {
return false;
}
if (!mojo::internal::ValidateInlinedUnion(object->info, validation_context))
return false;
return true;
}
EventObserver_OnEvent_Params_Data::EventObserver_OnEvent_Params_Data()
: header_({sizeof(*this), 0}) {}
} // namespace internal
} // namespace mojom
} // namespace cros_healthd
} // namespace ash
namespace perfetto {
// static
void TraceFormatTraits<::ash::cros_healthd::mojom::InputTouchButton>::WriteIntoTrace(
perfetto::TracedValue context, ::ash::cros_healthd::mojom::InputTouchButton value) {
return std::move(context).WriteString(::ash::cros_healthd::mojom::InputTouchButtonToString(value));
}
} // namespace perfetto
namespace perfetto {
// static
void TraceFormatTraits<::ash::cros_healthd::mojom::EventCategoryEnum>::WriteIntoTrace(
perfetto::TracedValue context, ::ash::cros_healthd::mojom::EventCategoryEnum value) {
return std::move(context).WriteString(::ash::cros_healthd::mojom::EventCategoryEnumToString(value));
}
} // namespace perfetto
namespace perfetto {
// static
void TraceFormatTraits<::ash::cros_healthd::mojom::UsbEventInfo_State>::WriteIntoTrace(
perfetto::TracedValue context, ::ash::cros_healthd::mojom::UsbEventInfo_State value) {
return std::move(context).WriteString(::ash::cros_healthd::mojom::UsbEventInfo_StateToString(value));
}
} // namespace perfetto
namespace perfetto {
// static
void TraceFormatTraits<::ash::cros_healthd::mojom::ThunderboltEventInfo_State>::WriteIntoTrace(
perfetto::TracedValue context, ::ash::cros_healthd::mojom::ThunderboltEventInfo_State value) {
return std::move(context).WriteString(::ash::cros_healthd::mojom::ThunderboltEventInfo_StateToString(value));
}
} // namespace perfetto
namespace perfetto {
// static
void TraceFormatTraits<::ash::cros_healthd::mojom::LidEventInfo_State>::WriteIntoTrace(
perfetto::TracedValue context, ::ash::cros_healthd::mojom::LidEventInfo_State value) {
return std::move(context).WriteString(::ash::cros_healthd::mojom::LidEventInfo_StateToString(value));
}
} // namespace perfetto
namespace perfetto {
// static
void TraceFormatTraits<::ash::cros_healthd::mojom::BluetoothEventInfo_State>::WriteIntoTrace(
perfetto::TracedValue context, ::ash::cros_healthd::mojom::BluetoothEventInfo_State value) {
return std::move(context).WriteString(::ash::cros_healthd::mojom::BluetoothEventInfo_StateToString(value));
}
} // namespace perfetto
namespace perfetto {
// static
void TraceFormatTraits<::ash::cros_healthd::mojom::PowerEventInfo_State>::WriteIntoTrace(
perfetto::TracedValue context, ::ash::cros_healthd::mojom::PowerEventInfo_State value) {
return std::move(context).WriteString(::ash::cros_healthd::mojom::PowerEventInfo_StateToString(value));
}
} // namespace perfetto
namespace perfetto {
// static
void TraceFormatTraits<::ash::cros_healthd::mojom::AudioEventInfo_State>::WriteIntoTrace(
perfetto::TracedValue context, ::ash::cros_healthd::mojom::AudioEventInfo_State value) {
return std::move(context).WriteString(::ash::cros_healthd::mojom::AudioEventInfo_StateToString(value));
}
} // namespace perfetto
namespace perfetto {
// static
void TraceFormatTraits<::ash::cros_healthd::mojom::AudioJackEventInfo_State>::WriteIntoTrace(
perfetto::TracedValue context, ::ash::cros_healthd::mojom::AudioJackEventInfo_State value) {
return std::move(context).WriteString(::ash::cros_healthd::mojom::AudioJackEventInfo_StateToString(value));
}
} // namespace perfetto
namespace perfetto {
// static
void TraceFormatTraits<::ash::cros_healthd::mojom::AudioJackEventInfo_DeviceType>::WriteIntoTrace(
perfetto::TracedValue context, ::ash::cros_healthd::mojom::AudioJackEventInfo_DeviceType value) {
return std::move(context).WriteString(::ash::cros_healthd::mojom::AudioJackEventInfo_DeviceTypeToString(value));
}
} // namespace perfetto
namespace perfetto {
// static
void TraceFormatTraits<::ash::cros_healthd::mojom::SdCardEventInfo_State>::WriteIntoTrace(
perfetto::TracedValue context, ::ash::cros_healthd::mojom::SdCardEventInfo_State value) {
return std::move(context).WriteString(::ash::cros_healthd::mojom::SdCardEventInfo_StateToString(value));
}
} // namespace perfetto
namespace perfetto {
// static
void TraceFormatTraits<::ash::cros_healthd::mojom::ExternalDisplayEventInfo_State>::WriteIntoTrace(
perfetto::TracedValue context, ::ash::cros_healthd::mojom::ExternalDisplayEventInfo_State value) {
return std::move(context).WriteString(::ash::cros_healthd::mojom::ExternalDisplayEventInfo_StateToString(value));
}
} // namespace perfetto
namespace perfetto {
// static
void TraceFormatTraits<::ash::cros_healthd::mojom::StylusGarageEventInfo_State>::WriteIntoTrace(
perfetto::TracedValue context, ::ash::cros_healthd::mojom::StylusGarageEventInfo_State value) {
return std::move(context).WriteString(::ash::cros_healthd::mojom::StylusGarageEventInfo_StateToString(value));
}
} // namespace perfetto
namespace perfetto {
// static
void TraceFormatTraits<::ash::cros_healthd::mojom::CrashEventInfo_CrashType>::WriteIntoTrace(
perfetto::TracedValue context, ::ash::cros_healthd::mojom::CrashEventInfo_CrashType value) {
return std::move(context).WriteString(::ash::cros_healthd::mojom::CrashEventInfo_CrashTypeToString(value));
}
} // namespace perfetto