content/media/VideoPlaybackQuality.cpp

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/content/media/VideoPlaybackQuality.cpp	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,49 @@
     1.4 +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
     1.5 +/* vim: set ts=8 sts=2 et sw=2 tw=80: */
     1.6 +/* This Source Code Form is subject to the terms of the Mozilla Public
     1.7 + * License, v. 2.0. If a copy of the MPL was not distributed with this
     1.8 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     1.9 +
    1.10 +#include "VideoPlaybackQuality.h"
    1.11 +
    1.12 +#include "mozilla/dom/HTMLMediaElement.h"
    1.13 +#include "mozilla/dom/VideoPlaybackQualityBinding.h"
    1.14 +#include "nsCycleCollectionParticipant.h"
    1.15 +#include "nsWrapperCache.h"
    1.16 +
    1.17 +namespace mozilla {
    1.18 +namespace dom {
    1.19 +
    1.20 +VideoPlaybackQuality::VideoPlaybackQuality(HTMLMediaElement* aElement,
    1.21 +                                           DOMHighResTimeStamp aCreationTime,
    1.22 +                                           uint64_t aTotalFrames,
    1.23 +                                           uint64_t aDroppedFrames,
    1.24 +                                           uint64_t aCorruptedFrames)
    1.25 +  : mElement(aElement)
    1.26 +  , mCreationTime(aCreationTime)
    1.27 +  , mTotalFrames(aTotalFrames)
    1.28 +  , mDroppedFrames(aDroppedFrames)
    1.29 +  , mCorruptedFrames(aCorruptedFrames)
    1.30 +{
    1.31 +  SetIsDOMBinding();
    1.32 +}
    1.33 +
    1.34 +HTMLMediaElement*
    1.35 +VideoPlaybackQuality::GetParentObject() const
    1.36 +{
    1.37 +  return mElement;
    1.38 +}
    1.39 +
    1.40 +JSObject*
    1.41 +VideoPlaybackQuality::WrapObject(JSContext *aCx)
    1.42 +{
    1.43 +  return VideoPlaybackQualityBinding::Wrap(aCx, this);
    1.44 +}
    1.45 +
    1.46 +NS_IMPL_CYCLE_COLLECTION_ROOT_NATIVE(VideoPlaybackQuality, AddRef)
    1.47 +NS_IMPL_CYCLE_COLLECTION_UNROOT_NATIVE(VideoPlaybackQuality, Release)
    1.48 +
    1.49 +NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE_1(VideoPlaybackQuality, mElement)
    1.50 +
    1.51 +} // namespace dom
    1.52 +} // namespace mozilla

mercurial