content/media/VideoPlaybackQuality.h

Fri, 16 Jan 2015 04:50:19 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Fri, 16 Jan 2015 04:50:19 +0100
branch
TOR_BUG_9701
changeset 13
44a2da4a2ab2
permissions
-rw-r--r--

Replace accessor implementation with direct member state manipulation, by
request https://trac.torproject.org/projects/tor/ticket/9701#comment:32

michael@0 1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
michael@0 2 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
michael@0 3 /* This Source Code Form is subject to the terms of the Mozilla Public
michael@0 4 * License, v. 2.0. If a copy of the MPL was not distributed with this
michael@0 5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
michael@0 6
michael@0 7 #ifndef mozilla_dom_VideoPlaybackQuality_h_
michael@0 8 #define mozilla_dom_VideoPlaybackQuality_h_
michael@0 9
michael@0 10 #include "mozilla/dom/HTMLMediaElement.h"
michael@0 11 #include "nsCycleCollectionParticipant.h"
michael@0 12 #include "nsDOMNavigationTiming.h"
michael@0 13 #include "nsWrapperCache.h"
michael@0 14
michael@0 15 namespace mozilla {
michael@0 16 namespace dom {
michael@0 17
michael@0 18 class VideoPlaybackQuality MOZ_FINAL : public nsWrapperCache
michael@0 19 {
michael@0 20 public:
michael@0 21 NS_INLINE_DECL_CYCLE_COLLECTING_NATIVE_REFCOUNTING(VideoPlaybackQuality)
michael@0 22 NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_NATIVE_CLASS(VideoPlaybackQuality)
michael@0 23
michael@0 24 VideoPlaybackQuality(HTMLMediaElement* aElement, DOMHighResTimeStamp aCreationTime,
michael@0 25 uint64_t aTotalFrames, uint64_t aDroppedFrames,
michael@0 26 uint64_t aCorruptedFrames);
michael@0 27
michael@0 28 HTMLMediaElement* GetParentObject() const;
michael@0 29
michael@0 30 JSObject* WrapObject(JSContext* aCx) MOZ_OVERRIDE;
michael@0 31
michael@0 32 DOMHighResTimeStamp CreationTime() const
michael@0 33 {
michael@0 34 return mCreationTime;
michael@0 35 }
michael@0 36
michael@0 37 uint64_t TotalVideoFrames()
michael@0 38 {
michael@0 39 return mTotalFrames;
michael@0 40 }
michael@0 41
michael@0 42 uint64_t DroppedVideoFrames()
michael@0 43 {
michael@0 44 return mDroppedFrames;
michael@0 45 }
michael@0 46
michael@0 47 uint64_t CorruptedVideoFrames()
michael@0 48 {
michael@0 49 return mCorruptedFrames;
michael@0 50 }
michael@0 51
michael@0 52 private:
michael@0 53 nsRefPtr<HTMLMediaElement> mElement;
michael@0 54 DOMHighResTimeStamp mCreationTime;
michael@0 55 uint64_t mTotalFrames;
michael@0 56 uint64_t mDroppedFrames;
michael@0 57 uint64_t mCorruptedFrames;
michael@0 58 };
michael@0 59
michael@0 60 } // namespace dom
michael@0 61 } // namespace mozilla
michael@0 62 #endif /* mozilla_dom_VideoPlaybackQuality_h_ */

mercurial