#ifdef UNSAFE_BUFFERS_BUILD
#pragma allow_unsafe_buffers
#endif
#include "device/gamepad/gamepad_service.h"
#include <utility>
#include "base/check_op.h"
#include "base/functional/bind.h"
#include "base/memory/ptr_util.h"
#include "base/memory/singleton.h"
#include "base/threading/thread.h"
#include "device/gamepad/gamepad_consumer.h"
#include "device/gamepad/gamepad_data_fetcher.h"
#include "device/gamepad/gamepad_data_fetcher_manager.h"
#include "device/gamepad/gamepad_provider.h"
namespace device {
namespace {
GamepadService* g_gamepad_service = …;
}
GamepadService::GamepadService() { … }
GamepadService::GamepadService(std::unique_ptr<GamepadDataFetcher> fetcher)
: … { … }
GamepadService::~GamepadService() = default;
void GamepadService::SetInstance(GamepadService* instance) { … }
GamepadService* GamepadService::GetInstance() { … }
void GamepadService::StartUp(
GamepadDataFetcher::HidManagerBinder hid_manager_binder) { … }
bool GamepadService::ConsumerBecameActive(GamepadConsumer* consumer) { … }
bool GamepadService::ConsumerBecameInactive(GamepadConsumer* consumer) { … }
bool GamepadService::RemoveConsumer(GamepadConsumer* consumer) { … }
void GamepadService::RegisterForUserGesture(base::OnceClosure closure) { … }
void GamepadService::Terminate() { … }
void GamepadService::OnGamepadConnectionChange(bool connected,
uint32_t index,
const Gamepad& pad) { … }
void GamepadService::OnGamepadChange(mojom::GamepadChangesPtr changes) { … }
void GamepadService::OnGamepadConnected(uint32_t index, const Gamepad& pad) { … }
void GamepadService::OnGamepadDisconnected(uint32_t index, const Gamepad& pad) { … }
void GamepadService::PlayVibrationEffectOnce(
uint32_t pad_index,
mojom::GamepadHapticEffectType type,
mojom::GamepadEffectParametersPtr params,
mojom::GamepadHapticsManager::PlayVibrationEffectOnceCallback callback) { … }
void GamepadService::ResetVibrationActuator(
uint32_t pad_index,
mojom::GamepadHapticsManager::ResetVibrationActuatorCallback callback) { … }
base::ReadOnlySharedMemoryRegion GamepadService::DuplicateSharedMemoryRegion() { … }
void GamepadService::OnUserGesture() { … }
void GamepadService::SetSanitizationEnabled(bool sanitize) { … }
}