tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

GamepadEventChannelChild.h (1485B)


      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/PGamepadEventChannelChild.h"
      7 #include "nsRefPtrHashtable.h"
      8 
      9 #ifndef mozilla_dom_GamepadEventChannelChild_h_
     10 #  define mozilla_dom_GamepadEventChannelChild_h_
     11 
     12 namespace mozilla::dom {
     13 
     14 class GamepadEventChannelChild final : public PGamepadEventChannelChild {
     15 public:
     16  NS_INLINE_DECL_THREADSAFE_REFCOUNTING(GamepadEventChannelChild, override)
     17 
     18  static already_AddRefed<GamepadEventChannelChild> Create();
     19 
     20  mozilla::ipc::IPCResult RecvGamepadUpdate(
     21      const GamepadChangeEvent& aGamepadEvent);
     22  mozilla::ipc::IPCResult RecvReplyGamepadPromise(const uint32_t& aPromiseID);
     23  void AddPromise(const uint32_t& aID, dom::Promise* aPromise);
     24 
     25  GamepadEventChannelChild(const GamepadEventChannelChild&) = delete;
     26  GamepadEventChannelChild(GamepadEventChannelChild&&) = delete;
     27  GamepadEventChannelChild& operator=(const GamepadEventChannelChild&) = delete;
     28  GamepadEventChannelChild& operator=(GamepadEventChannelChild&&) = delete;
     29 
     30 private:
     31  GamepadEventChannelChild() = default;
     32  ~GamepadEventChannelChild() = default;
     33 
     34  nsRefPtrHashtable<nsUint32HashKey, dom::Promise> mPromiseList;
     35 };
     36 
     37 }  // namespace mozilla::dom
     38 
     39 #endif