#if defined(__clang__)
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wunused-private-field"
#endif
#include "device/gamepad/public/mojom/gamepad.mojom.h"
#include <math.h>
#include <stdint.h>
#include <utility>
#include "base/debug/alias.h"
#include "base/hash/md5_constexpr.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/features.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_util.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 "device/gamepad/public/mojom/gamepad.mojom-params-data.h"
#include "device/gamepad/public/mojom/gamepad.mojom-shared-message-ids.h"
#include "device/gamepad/public/mojom/gamepad.mojom-import-headers.h"
#include "device/gamepad/public/mojom/gamepad.mojom-test-utils.h"
namespace device::mojom {
GamepadQuaternion::GamepadQuaternion()
: … { … }
GamepadQuaternion::GamepadQuaternion(
float x_in,
float y_in,
float z_in,
float w_in)
: … { … }
GamepadQuaternion::~GamepadQuaternion() = default;
void GamepadQuaternion::WriteIntoTrace(
perfetto::TracedValue traced_context) const { … }
bool GamepadQuaternion::Validate(
const void* data,
mojo::internal::ValidationContext* validation_context) { … }
GamepadVector::GamepadVector()
: … { … }
GamepadVector::GamepadVector(
float x_in,
float y_in,
float z_in)
: … { … }
GamepadVector::~GamepadVector() = default;
void GamepadVector::WriteIntoTrace(
perfetto::TracedValue traced_context) const { … }
bool GamepadVector::Validate(
const void* data,
mojo::internal::ValidationContext* validation_context) { … }
GamepadButton::GamepadButton()
: … { … }
GamepadButton::GamepadButton(
bool pressed_in,
bool touched_in,
double value_in)
: … { … }
GamepadButton::~GamepadButton() = default;
void GamepadButton::WriteIntoTrace(
perfetto::TracedValue traced_context) const { … }
bool GamepadButton::Validate(
const void* data,
mojo::internal::ValidationContext* validation_context) { … }
ButtonChange::ButtonChange()
: … { … }
ButtonChange::ButtonChange(
uint32_t button_index_in,
bool button_down_in,
bool button_up_in,
bool value_changed_in,
const ::device::GamepadButton& button_snapshot_in)
: … { … }
ButtonChange::~ButtonChange() = default;
void ButtonChange::WriteIntoTrace(
perfetto::TracedValue traced_context) const { … }
bool ButtonChange::Validate(
const void* data,
mojo::internal::ValidationContext* validation_context) { … }
AxisChange::AxisChange()
: … { … }
AxisChange::AxisChange(
uint32_t axis_index_in,
double axis_snapshot_in)
: … { … }
AxisChange::~AxisChange() = default;
size_t AxisChange::Hash(size_t seed) const { … }
void AxisChange::WriteIntoTrace(
perfetto::TracedValue traced_context) const { … }
bool AxisChange::Validate(
const void* data,
mojo::internal::ValidationContext* validation_context) { … }
GamepadChanges::GamepadChanges()
: … { … }
GamepadChanges::GamepadChanges(
uint32_t gamepad_index_in,
std::vector<ButtonChangePtr> button_changes_in,
std::vector<AxisChangePtr> axis_changes_in,
int64_t timestamp_in)
: … { … }
GamepadChanges::~GamepadChanges() = default;
void GamepadChanges::WriteIntoTrace(
perfetto::TracedValue traced_context) const { … }
bool GamepadChanges::Validate(
const void* data,
mojo::internal::ValidationContext* validation_context) { … }
GamepadTouch::GamepadTouch()
: … { … }
GamepadTouch::GamepadTouch(
uint32_t touch_id_in,
uint8_t surface_id_in,
double x_in,
double y_in,
uint32_t surface_height_in,
uint32_t surface_width_in,
bool has_surface_dimensions_in)
: … { … }
GamepadTouch::~GamepadTouch() = default;
void GamepadTouch::WriteIntoTrace(
perfetto::TracedValue traced_context) const { … }
bool GamepadTouch::Validate(
const void* data,
mojo::internal::ValidationContext* validation_context) { … }
GamepadPose::GamepadPose()
: … { … }
GamepadPose::GamepadPose(
const ::device::GamepadQuaternion& orientation_in,
const ::device::GamepadVector& position_in,
const ::device::GamepadVector& angular_velocity_in,
const ::device::GamepadVector& linear_velocity_in,
const ::device::GamepadVector& angular_acceleration_in,
const ::device::GamepadVector& linear_acceleration_in)
: … { … }
GamepadPose::~GamepadPose() = default;
void GamepadPose::WriteIntoTrace(
perfetto::TracedValue traced_context) const { … }
bool GamepadPose::Validate(
const void* data,
mojo::internal::ValidationContext* validation_context) { … }
GamepadHapticActuator::GamepadHapticActuator()
: … { … }
GamepadHapticActuator::GamepadHapticActuator(
::device::GamepadHapticActuatorType type_in)
: … { … }
GamepadHapticActuator::~GamepadHapticActuator() = default;
void GamepadHapticActuator::WriteIntoTrace(
perfetto::TracedValue traced_context) const { … }
bool GamepadHapticActuator::Validate(
const void* data,
mojo::internal::ValidationContext* validation_context) { … }
Gamepad::Gamepad()
: … { … }
Gamepad::Gamepad(
bool connected_in,
std::vector<uint16_t> id_in,
int64_t timestamp_in,
std::vector<double> axes_in,
std::vector<::device::GamepadButton> buttons_in,
const ::device::GamepadHapticActuator& vibration_actuator_in,
::device::GamepadMapping mapping_in,
const ::device::GamepadPose& pose_in,
::device::GamepadHand hand_in,
std::vector<::device::GamepadTouch> touch_events_in,
uint32_t display_id_in)
: … { … }
Gamepad::~Gamepad() = default;
void Gamepad::WriteIntoTrace(
perfetto::TracedValue traced_context) const { … }
bool Gamepad::Validate(
const void* data,
mojo::internal::ValidationContext* validation_context) { … }
GamepadEffectParameters::GamepadEffectParameters()
: … { … }
GamepadEffectParameters::GamepadEffectParameters(
double duration_in,
double start_delay_in,
double strong_magnitude_in,
double weak_magnitude_in,
double left_trigger_in,
double right_trigger_in)
: … { … }
GamepadEffectParameters::~GamepadEffectParameters() = default;
size_t GamepadEffectParameters::Hash(size_t seed) const { … }
void GamepadEffectParameters::WriteIntoTrace(
perfetto::TracedValue traced_context) const { … }
bool GamepadEffectParameters::Validate(
const void* data,
mojo::internal::ValidationContext* validation_context) { … }
const char GamepadObserver::Name_[] = …;
GamepadObserver::IPCStableHashFunction GamepadObserver::MessageToMethodInfo_(mojo::Message& message) { … }
const char* GamepadObserver::MessageToMethodName_(mojo::Message& message) { … }
#if !BUILDFLAG(IS_FUCHSIA)
uint32_t GamepadObserver::GamepadConnected_Sym::IPCStableHash() { … }
uint32_t GamepadObserver::GamepadDisconnected_Sym::IPCStableHash() { … }
uint32_t GamepadObserver::GamepadChanged_Sym::IPCStableHash() { … }
# endif
GamepadObserverProxy::GamepadObserverProxy(mojo::MessageReceiverWithResponder* receiver)
: … { … }
void GamepadObserverProxy::GamepadConnected(
uint32_t in_index, const ::device::Gamepad& in_gamepad) { … }
void GamepadObserverProxy::GamepadDisconnected(
uint32_t in_index, const ::device::Gamepad& in_gamepad) { … }
void GamepadObserverProxy::GamepadChanged(
GamepadChangesPtr in_changes) { … }
bool GamepadObserverStubDispatch::Accept(
GamepadObserver* impl,
mojo::Message* message) { … }
bool GamepadObserverStubDispatch::AcceptWithResponder(
GamepadObserver* impl,
mojo::Message* message,
std::unique_ptr<mojo::MessageReceiverWithStatus> responder) { … }
namespace {
}
static const mojo::internal::GenericValidationInfo kGamepadObserverValidationInfo[] = …;
bool GamepadObserverRequestValidator::Accept(mojo::Message* message) { … }
const char GamepadMonitor::Name_[] = …;
GamepadMonitor::IPCStableHashFunction GamepadMonitor::MessageToMethodInfo_(mojo::Message& message) { … }
const char* GamepadMonitor::MessageToMethodName_(mojo::Message& message) { … }
#if !BUILDFLAG(IS_FUCHSIA)
uint32_t GamepadMonitor::GamepadStartPolling_Sym::IPCStableHash() { … }
uint32_t GamepadMonitor::GamepadStopPolling_Sym::IPCStableHash() { … }
uint32_t GamepadMonitor::SetObserver_Sym::IPCStableHash() { … }
# endif
bool GamepadMonitor::GamepadStartPolling(::base::ReadOnlySharedMemoryRegion* out_memory_region) { … }
bool GamepadMonitor::GamepadStopPolling() { … }
class GamepadMonitor_GamepadStartPolling_HandleSyncResponse
: public mojo::MessageReceiver { … };
class GamepadMonitor_GamepadStartPolling_ForwardToCallback
: public mojo::MessageReceiver { … };
class GamepadMonitor_GamepadStopPolling_HandleSyncResponse
: public mojo::MessageReceiver { … };
class GamepadMonitor_GamepadStopPolling_ForwardToCallback
: public mojo::MessageReceiver { … };
GamepadMonitorProxy::GamepadMonitorProxy(mojo::MessageReceiverWithResponder* receiver)
: … { … }
bool GamepadMonitorProxy::GamepadStartPolling(
::base::ReadOnlySharedMemoryRegion* out_param_memory_region) { … }
void GamepadMonitorProxy::GamepadStartPolling(
GamepadStartPollingCallback callback) { … }
bool GamepadMonitorProxy::GamepadStopPolling(
) { … }
void GamepadMonitorProxy::GamepadStopPolling(
GamepadStopPollingCallback callback) { … }
void GamepadMonitorProxy::SetObserver(
::mojo::PendingRemote<GamepadObserver> in_gamepad_observer) { … }
class GamepadMonitor_GamepadStartPolling_ProxyToResponder : public ::mojo::internal::ProxyToResponder { … };
bool GamepadMonitor_GamepadStartPolling_ForwardToCallback::Accept(
mojo::Message* message) { … }
void GamepadMonitor_GamepadStartPolling_ProxyToResponder::Run(
::base::ReadOnlySharedMemoryRegion in_memory_region) { … }
bool GamepadMonitor_GamepadStartPolling_HandleSyncResponse::Accept(
mojo::Message* message) { … }
class GamepadMonitor_GamepadStopPolling_ProxyToResponder : public ::mojo::internal::ProxyToResponder { … };
bool GamepadMonitor_GamepadStopPolling_ForwardToCallback::Accept(
mojo::Message* message) { … }
void GamepadMonitor_GamepadStopPolling_ProxyToResponder::Run(
) { … }
bool GamepadMonitor_GamepadStopPolling_HandleSyncResponse::Accept(
mojo::Message* message) { … }
bool GamepadMonitorStubDispatch::Accept(
GamepadMonitor* impl,
mojo::Message* message) { … }
bool GamepadMonitorStubDispatch::AcceptWithResponder(
GamepadMonitor* impl,
mojo::Message* message,
std::unique_ptr<mojo::MessageReceiverWithStatus> responder) { … }
namespace {
}
static const mojo::internal::GenericValidationInfo kGamepadMonitorValidationInfo[] = …;
bool GamepadMonitorRequestValidator::Accept(mojo::Message* message) { … }
bool GamepadMonitorResponseValidator::Accept(mojo::Message* message) { … }
const char GamepadHapticsManager::Name_[] = …;
GamepadHapticsManager::IPCStableHashFunction GamepadHapticsManager::MessageToMethodInfo_(mojo::Message& message) { … }
const char* GamepadHapticsManager::MessageToMethodName_(mojo::Message& message) { … }
#if !BUILDFLAG(IS_FUCHSIA)
uint32_t GamepadHapticsManager::PlayVibrationEffectOnce_Sym::IPCStableHash() { … }
uint32_t GamepadHapticsManager::ResetVibrationActuator_Sym::IPCStableHash() { … }
# endif
class GamepadHapticsManager_PlayVibrationEffectOnce_ForwardToCallback
: public mojo::MessageReceiver { … };
class GamepadHapticsManager_ResetVibrationActuator_ForwardToCallback
: public mojo::MessageReceiver { … };
GamepadHapticsManagerProxy::GamepadHapticsManagerProxy(mojo::MessageReceiverWithResponder* receiver)
: … { … }
void GamepadHapticsManagerProxy::PlayVibrationEffectOnce(
uint32_t in_pad_index, GamepadHapticEffectType in_type, GamepadEffectParametersPtr in_params, PlayVibrationEffectOnceCallback callback) { … }
void GamepadHapticsManagerProxy::ResetVibrationActuator(
uint32_t in_pad_index, ResetVibrationActuatorCallback callback) { … }
class GamepadHapticsManager_PlayVibrationEffectOnce_ProxyToResponder : public ::mojo::internal::ProxyToResponder { … };
bool GamepadHapticsManager_PlayVibrationEffectOnce_ForwardToCallback::Accept(
mojo::Message* message) { … }
void GamepadHapticsManager_PlayVibrationEffectOnce_ProxyToResponder::Run(
GamepadHapticsResult in_result) { … }
class GamepadHapticsManager_ResetVibrationActuator_ProxyToResponder : public ::mojo::internal::ProxyToResponder { … };
bool GamepadHapticsManager_ResetVibrationActuator_ForwardToCallback::Accept(
mojo::Message* message) { … }
void GamepadHapticsManager_ResetVibrationActuator_ProxyToResponder::Run(
GamepadHapticsResult in_result) { … }
bool GamepadHapticsManagerStubDispatch::Accept(
GamepadHapticsManager* impl,
mojo::Message* message) { … }
bool GamepadHapticsManagerStubDispatch::AcceptWithResponder(
GamepadHapticsManager* impl,
mojo::Message* message,
std::unique_ptr<mojo::MessageReceiverWithStatus> responder) { … }
namespace {
}
static const mojo::internal::GenericValidationInfo kGamepadHapticsManagerValidationInfo[] = …;
bool GamepadHapticsManagerRequestValidator::Accept(mojo::Message* message) { … }
bool GamepadHapticsManagerResponseValidator::Accept(mojo::Message* message) { … }
}
namespace mojo {
bool StructTraits<::device::mojom::GamepadQuaternion::DataView, ::device::mojom::GamepadQuaternionPtr>::Read(
::device::mojom::GamepadQuaternion::DataView input,
::device::mojom::GamepadQuaternionPtr* output) { … }
bool StructTraits<::device::mojom::GamepadVector::DataView, ::device::mojom::GamepadVectorPtr>::Read(
::device::mojom::GamepadVector::DataView input,
::device::mojom::GamepadVectorPtr* output) { … }
bool StructTraits<::device::mojom::GamepadButton::DataView, ::device::mojom::GamepadButtonPtr>::Read(
::device::mojom::GamepadButton::DataView input,
::device::mojom::GamepadButtonPtr* output) { … }
bool StructTraits<::device::mojom::ButtonChange::DataView, ::device::mojom::ButtonChangePtr>::Read(
::device::mojom::ButtonChange::DataView input,
::device::mojom::ButtonChangePtr* output) { … }
bool StructTraits<::device::mojom::AxisChange::DataView, ::device::mojom::AxisChangePtr>::Read(
::device::mojom::AxisChange::DataView input,
::device::mojom::AxisChangePtr* output) { … }
bool StructTraits<::device::mojom::GamepadChanges::DataView, ::device::mojom::GamepadChangesPtr>::Read(
::device::mojom::GamepadChanges::DataView input,
::device::mojom::GamepadChangesPtr* output) { … }
bool StructTraits<::device::mojom::GamepadTouch::DataView, ::device::mojom::GamepadTouchPtr>::Read(
::device::mojom::GamepadTouch::DataView input,
::device::mojom::GamepadTouchPtr* output) { … }
bool StructTraits<::device::mojom::GamepadPose::DataView, ::device::mojom::GamepadPosePtr>::Read(
::device::mojom::GamepadPose::DataView input,
::device::mojom::GamepadPosePtr* output) { … }
bool StructTraits<::device::mojom::GamepadHapticActuator::DataView, ::device::mojom::GamepadHapticActuatorPtr>::Read(
::device::mojom::GamepadHapticActuator::DataView input,
::device::mojom::GamepadHapticActuatorPtr* output) { … }
bool StructTraits<::device::mojom::Gamepad::DataView, ::device::mojom::GamepadPtr>::Read(
::device::mojom::Gamepad::DataView input,
::device::mojom::GamepadPtr* output) { … }
bool StructTraits<::device::mojom::GamepadEffectParameters::DataView, ::device::mojom::GamepadEffectParametersPtr>::Read(
::device::mojom::GamepadEffectParameters::DataView input,
::device::mojom::GamepadEffectParametersPtr* output) { … }
}
namespace device::mojom {
void GamepadObserverInterceptorForTesting::GamepadConnected(uint32_t index, const ::device::Gamepad& gamepad) { … }
void GamepadObserverInterceptorForTesting::GamepadDisconnected(uint32_t index, const ::device::Gamepad& gamepad) { … }
void GamepadObserverInterceptorForTesting::GamepadChanged(GamepadChangesPtr changes) { … }
GamepadObserverAsyncWaiter::GamepadObserverAsyncWaiter(
GamepadObserver* proxy) : … { … }
GamepadObserverAsyncWaiter::~GamepadObserverAsyncWaiter() = default;
void GamepadMonitorInterceptorForTesting::GamepadStartPolling(GamepadStartPollingCallback callback) { … }
void GamepadMonitorInterceptorForTesting::GamepadStopPolling(GamepadStopPollingCallback callback) { … }
void GamepadMonitorInterceptorForTesting::SetObserver(::mojo::PendingRemote<GamepadObserver> gamepad_observer) { … }
GamepadMonitorAsyncWaiter::GamepadMonitorAsyncWaiter(
GamepadMonitor* proxy) : … { … }
GamepadMonitorAsyncWaiter::~GamepadMonitorAsyncWaiter() = default;
void GamepadMonitorAsyncWaiter::GamepadStartPolling(
::base::ReadOnlySharedMemoryRegion* out_memory_region) { … }
::base::ReadOnlySharedMemoryRegion GamepadMonitorAsyncWaiter::GamepadStartPolling(
) { … }
void GamepadMonitorAsyncWaiter::GamepadStopPolling(
) { … }
void GamepadHapticsManagerInterceptorForTesting::PlayVibrationEffectOnce(uint32_t pad_index, GamepadHapticEffectType type, GamepadEffectParametersPtr params, PlayVibrationEffectOnceCallback callback) { … }
void GamepadHapticsManagerInterceptorForTesting::ResetVibrationActuator(uint32_t pad_index, ResetVibrationActuatorCallback callback) { … }
GamepadHapticsManagerAsyncWaiter::GamepadHapticsManagerAsyncWaiter(
GamepadHapticsManager* proxy) : … { … }
GamepadHapticsManagerAsyncWaiter::~GamepadHapticsManagerAsyncWaiter() = default;
void GamepadHapticsManagerAsyncWaiter::PlayVibrationEffectOnce(
uint32_t pad_index, GamepadHapticEffectType type, GamepadEffectParametersPtr params, GamepadHapticsResult* out_result) { … }
GamepadHapticsResult GamepadHapticsManagerAsyncWaiter::PlayVibrationEffectOnce(
uint32_t pad_index, GamepadHapticEffectType type, GamepadEffectParametersPtr params) { … }
void GamepadHapticsManagerAsyncWaiter::ResetVibrationActuator(
uint32_t pad_index, GamepadHapticsResult* out_result) { … }
GamepadHapticsResult GamepadHapticsManagerAsyncWaiter::ResetVibrationActuator(
uint32_t pad_index) { … }
}
#if defined(__clang__)
#pragma clang diagnostic pop
#endif