GMPTimerChild.h (1072B)
1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 2 /* This Source Code Form is subject to the terms of the Mozilla Public 3 * License, v. 2.0. If a copy of the MPL was not distributed with this 4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 5 6 #ifndef GMPTimerChild_h_ 7 #define GMPTimerChild_h_ 8 9 #include "gmp-errors.h" 10 #include "gmp-platform.h" 11 #include "mozilla/Monitor.h" 12 #include "mozilla/gmp/PGMPTimerChild.h" 13 #include "nsHashKeys.h" 14 #include "nsTHashMap.h" 15 16 namespace mozilla::gmp { 17 18 class GMPChild; 19 20 class GMPTimerChild : public PGMPTimerChild { 21 friend class PGMPTimerChild; 22 23 public: 24 NS_INLINE_DECL_REFCOUNTING(GMPTimerChild) 25 26 explicit GMPTimerChild(GMPChild* aPlugin); 27 28 GMPErr SetTimer(GMPTask* aTask, int64_t aTimeoutMS); 29 30 protected: 31 // GMPTimerChild 32 mozilla::ipc::IPCResult RecvTimerExpired(const uint32_t& aTimerId); 33 34 private: 35 ~GMPTimerChild(); 36 37 nsTHashMap<nsUint32HashKey, GMPTask*> mTimers; 38 uint32_t mTimerCount; 39 40 GMPChild* mPlugin; 41 }; 42 43 } // namespace mozilla::gmp 44 45 #endif // GMPTimerChild_h_