content/media/VideoPlaybackQuality.h

Tue, 06 Jan 2015 21:39:09 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Tue, 06 Jan 2015 21:39:09 +0100
branch
TOR_BUG_9701
changeset 8
97036ab72558
permissions
-rw-r--r--

Conditionally force memory storage according to privacy.thirdparty.isolate;
This solves Tor bug #9701, complying with disk avoidance documented in
https://www.torproject.org/projects/torbrowser/design/#disk-avoidance.

     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 #ifndef mozilla_dom_VideoPlaybackQuality_h_
     8 #define mozilla_dom_VideoPlaybackQuality_h_
    10 #include "mozilla/dom/HTMLMediaElement.h"
    11 #include "nsCycleCollectionParticipant.h"
    12 #include "nsDOMNavigationTiming.h"
    13 #include "nsWrapperCache.h"
    15 namespace mozilla {
    16 namespace dom {
    18 class VideoPlaybackQuality MOZ_FINAL : public nsWrapperCache
    19 {
    20 public:
    21   NS_INLINE_DECL_CYCLE_COLLECTING_NATIVE_REFCOUNTING(VideoPlaybackQuality)
    22   NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_NATIVE_CLASS(VideoPlaybackQuality)
    24   VideoPlaybackQuality(HTMLMediaElement* aElement, DOMHighResTimeStamp aCreationTime,
    25                        uint64_t aTotalFrames, uint64_t aDroppedFrames,
    26                        uint64_t aCorruptedFrames);
    28   HTMLMediaElement* GetParentObject() const;
    30   JSObject* WrapObject(JSContext* aCx) MOZ_OVERRIDE;
    32   DOMHighResTimeStamp CreationTime() const
    33   {
    34     return mCreationTime;
    35   }
    37   uint64_t TotalVideoFrames()
    38   {
    39     return mTotalFrames;
    40   }
    42   uint64_t DroppedVideoFrames()
    43   {
    44     return mDroppedFrames;
    45   }
    47   uint64_t CorruptedVideoFrames()
    48   {
    49     return mCorruptedFrames;
    50   }
    52 private:
    53   nsRefPtr<HTMLMediaElement> mElement;
    54   DOMHighResTimeStamp mCreationTime;
    55   uint64_t mTotalFrames;
    56   uint64_t mDroppedFrames;
    57   uint64_t mCorruptedFrames;
    58 };
    60 } // namespace dom
    61 } // namespace mozilla
    62 #endif /* mozilla_dom_VideoPlaybackQuality_h_ */

mercurial