GamepadTestChannelChild.h (1572B)
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 7 #ifndef mozilla_dom_GamepadTestChannelChild_h_ 8 #define mozilla_dom_GamepadTestChannelChild_h_ 9 10 #include "mozilla/WeakPtr.h" 11 #include "mozilla/dom/PGamepadTestChannelChild.h" 12 #include "mozilla/dom/Promise.h" 13 #include "nsRefPtrHashtable.h" 14 15 namespace mozilla::dom { 16 17 class GamepadServiceTest; 18 19 class GamepadTestChannelChild final : public PGamepadTestChannelChild { 20 public: 21 NS_INLINE_DECL_THREADSAFE_REFCOUNTING(GamepadTestChannelChild) 22 23 static already_AddRefed<GamepadTestChannelChild> Create( 24 GamepadServiceTest* aGamepadServiceTest); 25 26 GamepadTestChannelChild(const GamepadTestChannelChild&) = delete; 27 GamepadTestChannelChild(GamepadTestChannelChild&&) = delete; 28 GamepadTestChannelChild& operator=(const GamepadTestChannelChild&) = delete; 29 GamepadTestChannelChild& operator=(GamepadTestChannelChild&&) = delete; 30 31 private: 32 explicit GamepadTestChannelChild(GamepadServiceTest* aGamepadServiceTest); 33 ~GamepadTestChannelChild() = default; 34 35 mozilla::ipc::IPCResult RecvReplyGamepadHandle(const uint32_t& aID, 36 const GamepadHandle& aHandle); 37 38 WeakPtr<GamepadServiceTest> mGamepadServiceTest; 39 40 friend class PGamepadTestChannelChild; 41 }; 42 43 } // namespace mozilla::dom 44 45 #endif