Bug 1657404 - Remove old IPDL workaround from GamepadTestChannelParent r=handyman

Differential Revision: https://phabricator.services.mozilla.com/D93019
This commit is contained in:
Chris Martin 2020-10-09 16:41:41 +00:00
Родитель 9c16898a12
Коммит c5f2277f3b
4 изменённых файлов: 9 добавлений и 15 удалений

Просмотреть файл

@ -80,7 +80,8 @@ void GamepadServiceTest::InitPBackgroundActor() {
}
void GamepadServiceTest::DestroyPBackgroundActor() {
mChild->SendShutdownChannel();
MOZ_ASSERT(mChild);
PGamepadTestChannelChild::Send__delete__(mChild);
mChild = nullptr;
}

Просмотреть файл

@ -47,9 +47,8 @@ void GamepadTestChannelParent::AddGamepadToPlatformService(
gamepadID.get(), static_cast<GamepadMappingType>(a.mapping()), a.hand(),
a.num_buttons(), a.num_axes(), a.num_haptics(), a.num_lights(),
a.num_touches());
if (!mShuttingdown) {
Unused << SendReplyGamepadIndex(aPromiseId, index);
}
Unused << SendReplyGamepadIndex(aPromiseId, index);
}
void GamepadTestChannelParent::OnMonitoringStateChanged(bool aNewState) {
@ -123,11 +122,5 @@ mozilla::ipc::IPCResult GamepadTestChannelParent::RecvGamepadTestEvent(
return IPC_FAIL_NO_REASON(this);
}
mozilla::ipc::IPCResult GamepadTestChannelParent::RecvShutdownChannel() {
mShuttingdown = true;
Unused << Send__delete__(this);
return IPC_OK();
}
} // namespace dom
} // namespace mozilla

Просмотреть файл

@ -15,12 +15,14 @@ namespace dom {
class GamepadTestChannelParent final : public PGamepadTestChannelParent {
public:
NS_INLINE_DECL_THREADSAFE_REFCOUNTING(GamepadTestChannelParent)
GamepadTestChannelParent() : mShuttingdown(false) {}
GamepadTestChannelParent() = default;
bool Init();
void ActorDestroy(ActorDestroyReason aWhy) override;
mozilla::ipc::IPCResult RecvGamepadTestEvent(
const uint32_t& aID, const GamepadChangeEvent& aGamepadEvent);
mozilla::ipc::IPCResult RecvShutdownChannel();
void OnMonitoringStateChanged(bool aNewState);
@ -32,7 +34,6 @@ class GamepadTestChannelParent final : public PGamepadTestChannelParent {
void AddGamepadToPlatformService(uint32_t aPromiseId,
const GamepadAdded& aGamepadAdded);
~GamepadTestChannelParent() = default;
bool mShuttingdown;
nsTArray<DeferredGamepadAdded> mDeferredGamepadAdded;
};

Просмотреть файл

@ -11,9 +11,8 @@ async protocol PGamepadTestChannel {
manager PBackground;
parent:
async GamepadTestEvent(uint32_t aID, GamepadChangeEvent aGamepadEvent);
async ShutdownChannel();
child:
async __delete__();
child:
async ReplyGamepadIndex(uint32_t aID, uint32_t aIndex);
};