diff -r 000000000000 -r 6474c204b198 media/webrtc/signaling/src/peerconnection/MediaStreamList.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/media/webrtc/signaling/src/peerconnection/MediaStreamList.h Wed Dec 31 06:09:35 2014 +0100 @@ -0,0 +1,56 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this file, + * You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#ifndef MediaStreamList_h__ +#define MediaStreamList_h__ + +#include "mozilla/ErrorResult.h" +#include "nsISupportsImpl.h" +#include "nsAutoPtr.h" +#include "nsWrapperCache.h" + +#ifdef USE_FAKE_MEDIA_STREAMS +#include "FakeMediaStreams.h" +#else +#include "DOMMediaStream.h" +#endif + +namespace sipcc { +class PeerConnectionImpl; +} // namespace sipcc + +namespace mozilla { +namespace dom { + +class MediaStreamList : public nsISupports, + public nsWrapperCache +{ +public: + enum StreamType { + Local, + Remote + }; + + MediaStreamList(sipcc::PeerConnectionImpl* peerConnection, StreamType type); + virtual ~MediaStreamList(); + + NS_DECL_CYCLE_COLLECTING_ISUPPORTS + NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(MediaStreamList) + + virtual JSObject* WrapObject(JSContext *cx) + MOZ_OVERRIDE; + nsISupports* GetParentObject(); + + DOMMediaStream* IndexedGetter(uint32_t index, bool& found); + uint32_t Length(); + +private: + nsRefPtr mPeerConnection; + StreamType mType; +}; + +} // namespace dom +} // namespace mozilla + +#endif // MediaStreamList_h__