Bug 1941046 - Part 4: Send a callback request for impression and clicks of MARS Top...
[gecko.git] / dom / media / VideoPlaybackQuality.h
blob76ca38de7b3053fa5a950fecce0eadd36756ad80
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/. */
7 #ifndef mozilla_dom_VideoPlaybackQuality_h_
8 #define mozilla_dom_VideoPlaybackQuality_h_
10 #include "mozilla/dom/HTMLMediaElement.h"
11 #include "nsCycleCollectionParticipant.h"
12 #include "nsDOMNavigationTiming.h"
13 #include "nsWrapperCache.h"
15 namespace mozilla::dom {
17 class VideoPlaybackQuality final : public nsWrapperCache {
18 public:
19 NS_INLINE_DECL_CYCLE_COLLECTING_NATIVE_REFCOUNTING(VideoPlaybackQuality)
20 NS_DECL_CYCLE_COLLECTION_NATIVE_WRAPPERCACHE_CLASS(VideoPlaybackQuality)
22 VideoPlaybackQuality(HTMLMediaElement* aElement,
23 DOMHighResTimeStamp aCreationTime, uint32_t aTotalFrames,
24 uint32_t aDroppedFrames);
26 HTMLMediaElement* GetParentObject() const;
28 JSObject* WrapObject(JSContext* aCx,
29 JS::Handle<JSObject*> aGivenProto) override;
31 DOMHighResTimeStamp CreationTime() const { return mCreationTime; }
33 uint32_t TotalVideoFrames() const { return mTotalFrames; }
35 uint32_t DroppedVideoFrames() const { return mDroppedFrames; }
37 private:
38 ~VideoPlaybackQuality() = default;
40 RefPtr<HTMLMediaElement> mElement;
41 DOMHighResTimeStamp mCreationTime;
42 uint32_t mTotalFrames;
43 uint32_t mDroppedFrames;
46 } // namespace mozilla::dom
48 #endif // mozilla_dom_VideoPlaybackQuality_h_