Line data Source code
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 "mozilla/gmp/PGMPTimerChild.h"
10 : #include "mozilla/Monitor.h"
11 : #include "nsDataHashtable.h"
12 : #include "nsHashKeys.h"
13 : #include "gmp-errors.h"
14 : #include "gmp-platform.h"
15 :
16 : namespace mozilla {
17 : namespace gmp {
18 :
19 : class GMPChild;
20 :
21 : class GMPTimerChild : public PGMPTimerChild
22 : {
23 : public:
24 0 : 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) override;
33 :
34 : private:
35 : ~GMPTimerChild();
36 :
37 : nsDataHashtable<nsUint32HashKey, GMPTask*> mTimers;
38 : uint32_t mTimerCount;
39 :
40 : GMPChild* mPlugin;
41 : };
42 :
43 : } // namespace gmp
44 : } // namespace mozilla
45 :
46 : #endif // GMPTimerChild_h_
|