icecat: add release icecat-140.10.1-1gnu1 for ecne

This commit is contained in:
Ark74 2026-05-04 16:58:41 -06:00
parent a5f93cb214
commit ff85d7c623
1256 changed files with 63469 additions and 24141 deletions

View file

@ -80,8 +80,8 @@ void GamepadMonitoringState::Set(bool aIsMonitoring) {
}
GamepadPlatformService::GamepadPlatformService()
: mNextGamepadHandleValue(1),
mMutex("mozilla::dom::GamepadPlatformService") {}
: mMutex("mozilla::dom::GamepadPlatformService"),
mNextGamepadHandleValue(1) {}
GamepadPlatformService::~GamepadPlatformService() { Cleanup(); }
@ -113,10 +113,6 @@ void GamepadPlatformService::NotifyGamepadChange(GamepadHandle aHandle,
GamepadChangeEventBody body(aInfo);
GamepadChangeEvent e(aHandle, body);
// mChannelParents may be accessed by background thread in the
// same time, we use mutex to prevent possible race condtion
MutexAutoLock autoLock(mMutex);
for (uint32_t i = 0; i < mChannelParents.Length(); ++i) {
mChannelParents[i]->DispatchUpdateEvent(e);
}
@ -131,16 +127,19 @@ GamepadHandle GamepadPlatformService::AddGamepad(
MOZ_ASSERT(XRE_IsParentProcess());
MOZ_ASSERT(!NS_IsMainThread());
GamepadHandle gamepadHandle{mNextGamepadHandleValue++,
GamepadHandleKind::GamepadPlatformManager};
// Only VR controllers has displayID, we give 0 to the general gamepads.
GamepadAdded a(NS_ConvertUTF8toUTF16(nsDependentCString(aID)), aMapping,
aHand, 0, aNumButtons, aNumAxes, aHaptics, aNumLightIndicator,
aNumTouchEvents);
mGamepadAdded.emplace(gamepadHandle, a);
NotifyGamepadChange<GamepadAdded>(gamepadHandle, a);
GamepadHandle gamepadHandle;
{
MutexAutoLock autoLock(mMutex);
gamepadHandle = GamepadHandle{mNextGamepadHandleValue++,
GamepadHandleKind::GamepadPlatformManager};
mGamepadAdded.emplace(gamepadHandle, a);
NotifyGamepadChange<GamepadAdded>(gamepadHandle, a);
}
return gamepadHandle;
}
@ -150,8 +149,11 @@ void GamepadPlatformService::RemoveGamepad(GamepadHandle aHandle) {
MOZ_ASSERT(XRE_IsParentProcess());
MOZ_ASSERT(!NS_IsMainThread());
GamepadRemoved a;
NotifyGamepadChange<GamepadRemoved>(aHandle, a);
mGamepadAdded.erase(aHandle);
{
MutexAutoLock autoLock(mMutex);
NotifyGamepadChange<GamepadRemoved>(aHandle, a);
mGamepadAdded.erase(aHandle);
}
}
void GamepadPlatformService::NewButtonEvent(GamepadHandle aHandle,
@ -162,6 +164,7 @@ void GamepadPlatformService::NewButtonEvent(GamepadHandle aHandle,
MOZ_ASSERT(XRE_IsParentProcess());
MOZ_ASSERT(!NS_IsMainThread());
GamepadButtonInformation a(aButton, aValue, aPressed, aTouched);
MutexAutoLock autoLock(mMutex);
NotifyGamepadChange<GamepadButtonInformation>(aHandle, a);
}
@ -204,6 +207,7 @@ void GamepadPlatformService::NewAxisMoveEvent(GamepadHandle aHandle,
MOZ_ASSERT(XRE_IsParentProcess());
MOZ_ASSERT(!NS_IsMainThread());
GamepadAxisInformation a(aAxis, aValue);
MutexAutoLock autoLock(mMutex);
NotifyGamepadChange<GamepadAxisInformation>(aHandle, a);
}
@ -214,6 +218,7 @@ void GamepadPlatformService::NewLightIndicatorTypeEvent(
MOZ_ASSERT(XRE_IsParentProcess());
MOZ_ASSERT(!NS_IsMainThread());
GamepadLightIndicatorTypeInformation a(aLight, aType);
MutexAutoLock autoLock(mMutex);
NotifyGamepadChange<GamepadLightIndicatorTypeInformation>(aHandle, a);
}
@ -224,6 +229,7 @@ void GamepadPlatformService::NewPoseEvent(GamepadHandle aHandle,
MOZ_ASSERT(XRE_IsParentProcess());
MOZ_ASSERT(!NS_IsMainThread());
GamepadPoseInformation a(aState);
MutexAutoLock autoLock(mMutex);
NotifyGamepadChange<GamepadPoseInformation>(aHandle, a);
}
@ -236,6 +242,7 @@ void GamepadPlatformService::NewMultiTouchEvent(
MOZ_ASSERT(!NS_IsMainThread());
GamepadTouchInformation a(aTouchArrayIndex, aState);
MutexAutoLock autoLock(mMutex);
NotifyGamepadChange<GamepadTouchInformation>(aHandle, a);
}
@ -244,6 +251,7 @@ void GamepadPlatformService::ResetGamepadIndexes() {
// platform-dependent backends
MOZ_ASSERT(XRE_IsParentProcess());
MOZ_ASSERT(!NS_IsMainThread());
MutexAutoLock autoLock(mMutex);
mNextGamepadHandleValue = 1;
}
@ -253,11 +261,11 @@ void GamepadPlatformService::AddChannelParent(
// is created or removed in Background thread
AssertIsOnBackgroundThread();
MOZ_ASSERT(aParent);
MOZ_ASSERT(!mChannelParents.Contains(aParent));
// We use mutex here to prevent race condition with monitor thread
{
MutexAutoLock autoLock(mMutex);
MOZ_ASSERT(!mChannelParents.Contains(aParent));
mChannelParents.AppendElement(aParent);
// For a new GamepadEventChannel, we have to send the exising GamepadAdded
@ -282,11 +290,11 @@ void GamepadPlatformService::RemoveChannelParent(
// is created or removed in Background thread
AssertIsOnBackgroundThread();
MOZ_ASSERT(aParent);
MOZ_ASSERT(mChannelParents.Contains(aParent));
// We use mutex here to prevent race condition with monitor thread
{
MutexAutoLock autoLock(mMutex);
MOZ_ASSERT(mChannelParents.Contains(aParent));
mChannelParents.RemoveElement(aParent);
if (!mChannelParents.IsEmpty()) {
return;