media/webrtc/signaling/src/peerconnection/MediaStreamList.h

Thu, 15 Jan 2015 15:59:08 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 15 Jan 2015 15:59:08 +0100
branch
TOR_BUG_9701
changeset 10
ac0c01689b40
permissions
-rw-r--r--

Implement a real Private Browsing Mode condition by changing the API/ABI;
This solves Tor bug #9701, complying with disk avoidance documented in
https://www.torproject.org/projects/torbrowser/design/#disk-avoidance.

     1 /* This Source Code Form is subject to the terms of the Mozilla Public
     2  * License, v. 2.0. If a copy of the MPL was not distributed with this file,
     3  * You can obtain one at http://mozilla.org/MPL/2.0/. */
     5 #ifndef MediaStreamList_h__
     6 #define MediaStreamList_h__
     8 #include "mozilla/ErrorResult.h"
     9 #include "nsISupportsImpl.h"
    10 #include "nsAutoPtr.h"
    11 #include "nsWrapperCache.h"
    13 #ifdef USE_FAKE_MEDIA_STREAMS
    14 #include "FakeMediaStreams.h"
    15 #else
    16 #include "DOMMediaStream.h"
    17 #endif
    19 namespace sipcc {
    20 class PeerConnectionImpl;
    21 } // namespace sipcc
    23 namespace mozilla {
    24 namespace dom {
    26 class MediaStreamList : public nsISupports,
    27                         public nsWrapperCache
    28 {
    29 public:
    30   enum StreamType {
    31     Local,
    32     Remote
    33   };
    35   MediaStreamList(sipcc::PeerConnectionImpl* peerConnection, StreamType type);
    36   virtual ~MediaStreamList();
    38   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
    39   NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(MediaStreamList)
    41   virtual JSObject* WrapObject(JSContext *cx)
    42     MOZ_OVERRIDE;
    43   nsISupports* GetParentObject();
    45   DOMMediaStream* IndexedGetter(uint32_t index, bool& found);
    46   uint32_t Length();
    48 private:
    49   nsRefPtr<sipcc::PeerConnectionImpl> mPeerConnection;
    50   StreamType mType;
    51 };
    53 } // namespace dom
    54 } // namespace mozilla
    56 #endif // MediaStreamList_h__

mercurial