michael@0: /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ michael@0: /* vim: set ts=8 sts=2 et sw=2 tw=80: */ michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: #include "VideoPlaybackQuality.h" michael@0: michael@0: #include "mozilla/dom/HTMLMediaElement.h" michael@0: #include "mozilla/dom/VideoPlaybackQualityBinding.h" michael@0: #include "nsCycleCollectionParticipant.h" michael@0: #include "nsWrapperCache.h" michael@0: michael@0: namespace mozilla { michael@0: namespace dom { michael@0: michael@0: VideoPlaybackQuality::VideoPlaybackQuality(HTMLMediaElement* aElement, michael@0: DOMHighResTimeStamp aCreationTime, michael@0: uint64_t aTotalFrames, michael@0: uint64_t aDroppedFrames, michael@0: uint64_t aCorruptedFrames) michael@0: : mElement(aElement) michael@0: , mCreationTime(aCreationTime) michael@0: , mTotalFrames(aTotalFrames) michael@0: , mDroppedFrames(aDroppedFrames) michael@0: , mCorruptedFrames(aCorruptedFrames) michael@0: { michael@0: SetIsDOMBinding(); michael@0: } michael@0: michael@0: HTMLMediaElement* michael@0: VideoPlaybackQuality::GetParentObject() const michael@0: { michael@0: return mElement; michael@0: } michael@0: michael@0: JSObject* michael@0: VideoPlaybackQuality::WrapObject(JSContext *aCx) michael@0: { michael@0: return VideoPlaybackQualityBinding::Wrap(aCx, this); michael@0: } michael@0: michael@0: NS_IMPL_CYCLE_COLLECTION_ROOT_NATIVE(VideoPlaybackQuality, AddRef) michael@0: NS_IMPL_CYCLE_COLLECTION_UNROOT_NATIVE(VideoPlaybackQuality, Release) michael@0: michael@0: NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE_1(VideoPlaybackQuality, mElement) michael@0: michael@0: } // namespace dom michael@0: } // namespace mozilla