Line data Source code
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_VideoPlaybackQuality_h_
8 : #define mozilla_dom_VideoPlaybackQuality_h_
9 :
10 : #include "mozilla/dom/HTMLMediaElement.h"
11 : #include "nsCycleCollectionParticipant.h"
12 : #include "nsDOMNavigationTiming.h"
13 : #include "nsWrapperCache.h"
14 :
15 : namespace mozilla {
16 : namespace dom {
17 :
18 : class VideoPlaybackQuality final : public nsWrapperCache
19 : {
20 : public:
21 0 : NS_INLINE_DECL_CYCLE_COLLECTING_NATIVE_REFCOUNTING(VideoPlaybackQuality)
22 0 : NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_NATIVE_CLASS(VideoPlaybackQuality)
23 :
24 : VideoPlaybackQuality(HTMLMediaElement* aElement,
25 : DOMHighResTimeStamp aCreationTime,
26 : uint32_t aTotalFrames,
27 : uint32_t aDroppedFrames,
28 : uint32_t aCorruptedFrames);
29 :
30 : HTMLMediaElement* GetParentObject() const;
31 :
32 : JSObject* WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) override;
33 :
34 0 : DOMHighResTimeStamp CreationTime() const
35 : {
36 0 : return mCreationTime;
37 : }
38 :
39 0 : uint32_t TotalVideoFrames() const
40 : {
41 0 : return mTotalFrames;
42 : }
43 :
44 0 : uint32_t DroppedVideoFrames() const
45 : {
46 0 : return mDroppedFrames;
47 : }
48 :
49 0 : uint32_t CorruptedVideoFrames() const
50 : {
51 0 : return mCorruptedFrames;
52 : }
53 :
54 : private:
55 0 : ~VideoPlaybackQuality() {}
56 :
57 : RefPtr<HTMLMediaElement> mElement;
58 : DOMHighResTimeStamp mCreationTime;
59 : uint32_t mTotalFrames;
60 : uint32_t mDroppedFrames;
61 : uint32_t mCorruptedFrames;
62 : };
63 :
64 : } // namespace dom
65 : } // namespace mozilla
66 :
67 : #endif // mozilla_dom_VideoPlaybackQuality_h_
|