/src/mozilla-central/dom/gamepad/ipc/GamepadEventChannelParent.h
Line | Count | Source (jump to first uncovered line) |
1 | | /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ |
2 | | /* vim: set ts=8 sts=2 et sw=2 tw=80: */ |
3 | | /* This Source Code Form is subject to the terms of the Mozilla Public |
4 | | * License, v. 2.0. If a copy of the MPL was not distributed with this |
5 | | * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
6 | | #include "mozilla/dom/PGamepadEventChannelParent.h" |
7 | | |
8 | | #ifndef mozilla_dom_GamepadEventChannelParent_h_ |
9 | | #define mozilla_dom_GamepadEventChannelParent_h_ |
10 | | |
11 | | namespace mozilla { |
12 | | namespace dom { |
13 | | |
14 | | class GamepadEventChannelParent final : public PGamepadEventChannelParent |
15 | | { |
16 | | public: |
17 | | NS_INLINE_DECL_THREADSAFE_REFCOUNTING(GamepadEventChannelParent) |
18 | | GamepadEventChannelParent(); |
19 | | virtual void ActorDestroy(ActorDestroyReason aWhy) override; |
20 | | virtual mozilla::ipc::IPCResult RecvGamepadListenerAdded() override; |
21 | | virtual mozilla::ipc::IPCResult RecvGamepadListenerRemoved() override; |
22 | | virtual mozilla::ipc::IPCResult RecvVibrateHaptic(const uint32_t& aControllerIdx, |
23 | | const uint32_t& aHapticIndex, |
24 | | const double& aIntensity, |
25 | | const double& aDuration, |
26 | | const uint32_t& aPromiseID) override; |
27 | | virtual mozilla::ipc::IPCResult RecvStopVibrateHaptic( |
28 | | const uint32_t& aGamepadIndex) override; |
29 | | void DispatchUpdateEvent(const GamepadChangeEvent& aEvent); |
30 | 0 | bool HasGamepadListener() const { return mHasGamepadListener; } |
31 | | private: |
32 | 0 | ~GamepadEventChannelParent() {} |
33 | | bool mHasGamepadListener; |
34 | | nsCOMPtr<nsIEventTarget> mBackgroundEventTarget; |
35 | | }; |
36 | | |
37 | | } // namespace dom |
38 | | } // namespace mozilla |
39 | | |
40 | | #endif |