tor-browser

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

VideoPlaybackQuality.h (1598B)


      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::dom {
     16 
     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)
     21 
     22  VideoPlaybackQuality(HTMLMediaElement* aElement,
     23                       DOMHighResTimeStamp aCreationTime, uint32_t aTotalFrames,
     24                       uint32_t aDroppedFrames);
     25 
     26  HTMLMediaElement* GetParentObject() const;
     27 
     28  JSObject* WrapObject(JSContext* aCx,
     29                       JS::Handle<JSObject*> aGivenProto) override;
     30 
     31  DOMHighResTimeStamp CreationTime() const { return mCreationTime; }
     32 
     33  uint32_t TotalVideoFrames() const { return mTotalFrames; }
     34 
     35  uint32_t DroppedVideoFrames() const { return mDroppedFrames; }
     36 
     37 private:
     38  ~VideoPlaybackQuality() = default;
     39 
     40  RefPtr<HTMLMediaElement> mElement;
     41  DOMHighResTimeStamp mCreationTime;
     42  uint32_t mTotalFrames;
     43  uint32_t mDroppedFrames;
     44 };
     45 
     46 }  // namespace mozilla::dom
     47 
     48 #endif  // mozilla_dom_VideoPlaybackQuality_h_