GamepadEventChannelParent.h 1.0 KB

1234567891011121314151617181920212223242526272829303132
  1. /* This Source Code Form is subject to the terms of the Mozilla Public
  2. * License, v. 2.0. If a copy of the MPL was not distributed with this
  3. * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
  4. #include "mozilla/dom/PGamepadEventChannelParent.h"
  5. #ifndef mozilla_dom_GamepadEventChannelParent_h_
  6. #define mozilla_dom_GamepadEventChannelParent_h_
  7. namespace mozilla{
  8. namespace dom{
  9. class GamepadEventChannelParent final : public PGamepadEventChannelParent
  10. {
  11. public:
  12. NS_INLINE_DECL_THREADSAFE_REFCOUNTING(GamepadEventChannelParent)
  13. GamepadEventChannelParent();
  14. virtual void ActorDestroy(ActorDestroyReason aWhy) override;
  15. virtual bool RecvGamepadListenerAdded() override;
  16. virtual bool RecvGamepadListenerRemoved() override;
  17. void DispatchUpdateEvent(const GamepadChangeEvent& aEvent);
  18. bool HasGamepadListener() const { return mHasGamepadListener; }
  19. private:
  20. ~GamepadEventChannelParent() {}
  21. bool mHasGamepadListener;
  22. nsCOMPtr<nsIThread> mBackgroundThread;
  23. };
  24. }// namespace dom
  25. }// namespace mozilla
  26. #endif