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 file, michael@0: * You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: #ifndef MediaStreamList_h__ michael@0: #define MediaStreamList_h__ michael@0: michael@0: #include "mozilla/ErrorResult.h" michael@0: #include "nsISupportsImpl.h" michael@0: #include "nsAutoPtr.h" michael@0: #include "nsWrapperCache.h" michael@0: michael@0: #ifdef USE_FAKE_MEDIA_STREAMS michael@0: #include "FakeMediaStreams.h" michael@0: #else michael@0: #include "DOMMediaStream.h" michael@0: #endif michael@0: michael@0: namespace sipcc { michael@0: class PeerConnectionImpl; michael@0: } // namespace sipcc michael@0: michael@0: namespace mozilla { michael@0: namespace dom { michael@0: michael@0: class MediaStreamList : public nsISupports, michael@0: public nsWrapperCache michael@0: { michael@0: public: michael@0: enum StreamType { michael@0: Local, michael@0: Remote michael@0: }; michael@0: michael@0: MediaStreamList(sipcc::PeerConnectionImpl* peerConnection, StreamType type); michael@0: virtual ~MediaStreamList(); michael@0: michael@0: NS_DECL_CYCLE_COLLECTING_ISUPPORTS michael@0: NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(MediaStreamList) michael@0: michael@0: virtual JSObject* WrapObject(JSContext *cx) michael@0: MOZ_OVERRIDE; michael@0: nsISupports* GetParentObject(); michael@0: michael@0: DOMMediaStream* IndexedGetter(uint32_t index, bool& found); michael@0: uint32_t Length(); michael@0: michael@0: private: michael@0: nsRefPtr mPeerConnection; michael@0: StreamType mType; michael@0: }; michael@0: michael@0: } // namespace dom michael@0: } // namespace mozilla michael@0: michael@0: #endif // MediaStreamList_h__