backout 29799f914cab, Bug 917642 - [Helix] Please update the helix blobs
[gecko.git] / content / media / VideoPlaybackQuality.cpp
blob3904cd82c259c67920868ba97fd07370292f30dc
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 #include "VideoPlaybackQuality.h"
9 #include "mozilla/dom/HTMLMediaElement.h"
10 #include "mozilla/dom/VideoPlaybackQualityBinding.h"
11 #include "nsCycleCollectionParticipant.h"
12 #include "nsWrapperCache.h"
14 namespace mozilla {
15 namespace dom {
17 VideoPlaybackQuality::VideoPlaybackQuality(HTMLMediaElement* aElement,
18 DOMHighResTimeStamp aCreationTime,
19 uint64_t aTotalFrames,
20 uint64_t aDroppedFrames,
21 uint64_t aCorruptedFrames,
22 double aTotalFrameDelay)
23 : mElement(aElement)
24 , mCreationTime(aCreationTime)
25 , mTotalFrames(aTotalFrames)
26 , mDroppedFrames(aDroppedFrames)
27 , mCorruptedFrames(aCorruptedFrames)
28 , mTotalFrameDelay(aTotalFrameDelay)
30 SetIsDOMBinding();
33 HTMLMediaElement*
34 VideoPlaybackQuality::GetParentObject() const
36 return mElement;
39 JSObject*
40 VideoPlaybackQuality::WrapObject(JSContext *aCx, JS::Handle<JSObject*> aScope)
42 return VideoPlaybackQualityBinding::Wrap(aCx, aScope, this);
45 NS_IMPL_CYCLE_COLLECTION_ROOT_NATIVE(VideoPlaybackQuality, AddRef)
46 NS_IMPL_CYCLE_COLLECTION_UNROOT_NATIVE(VideoPlaybackQuality, Release)
48 NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE_1(VideoPlaybackQuality, mElement)
50 } // namespace dom
51 } // namespace mozilla