Line data Source code
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/. */
4 :
5 : #ifndef MediaStreamList_h__
6 : #define MediaStreamList_h__
7 :
8 : #include "mozilla/ErrorResult.h"
9 : #include "nsISupportsImpl.h"
10 : #include "nsAutoPtr.h"
11 : #include "nsWrapperCache.h"
12 :
13 : #ifdef USE_FAKE_MEDIA_STREAMS
14 : #include "FakeMediaStreams.h"
15 : #else
16 : #include "DOMMediaStream.h"
17 : #endif
18 :
19 : namespace mozilla {
20 : class PeerConnectionImpl;
21 : namespace dom {
22 :
23 : class MediaStreamList : public nsISupports,
24 : public nsWrapperCache
25 : {
26 : public:
27 : enum StreamType {
28 : Local,
29 : Remote
30 : };
31 :
32 : MediaStreamList(PeerConnectionImpl* peerConnection, StreamType type);
33 :
34 : NS_DECL_CYCLE_COLLECTING_ISUPPORTS
35 0 : NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(MediaStreamList)
36 :
37 : virtual JSObject* WrapObject(JSContext *cx, JS::Handle<JSObject*> aGivenProto)
38 : override;
39 : nsISupports* GetParentObject();
40 :
41 : DOMMediaStream* IndexedGetter(uint32_t index, bool& found);
42 : uint32_t Length();
43 :
44 : private:
45 : virtual ~MediaStreamList();
46 :
47 : RefPtr<PeerConnectionImpl> mPeerConnection;
48 : StreamType mType;
49 : };
50 :
51 : } // namespace dom
52 : } // namespace mozilla
53 :
54 : #endif // MediaStreamList_h__
|