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 GetUserMediaRequest_h__
6 : #define GetUserMediaRequest_h__
7 :
8 : #include "mozilla/ErrorResult.h"
9 : #include "nsISupportsImpl.h"
10 : #include "nsAutoPtr.h"
11 : #include "nsWrapperCache.h"
12 : #include "mozilla/dom/BindingUtils.h"
13 : #include "nsPIDOMWindow.h"
14 :
15 : namespace mozilla {
16 : namespace dom {
17 :
18 : struct MediaStreamConstraints;
19 :
20 : class GetUserMediaRequest : public nsISupports, public nsWrapperCache
21 : {
22 : public:
23 : GetUserMediaRequest(nsPIDOMWindowInner* aInnerWindow,
24 : const nsAString& aCallID,
25 : const MediaStreamConstraints& aConstraints,
26 : bool aIsSecure);
27 : GetUserMediaRequest(nsPIDOMWindowInner* aInnerWindow,
28 : const nsAString& aRawId,
29 : const nsAString& aMediaSource);
30 :
31 : NS_DECL_CYCLE_COLLECTING_ISUPPORTS
32 0 : NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(GetUserMediaRequest)
33 :
34 : JSObject* WrapObject(JSContext* cx, JS::Handle<JSObject*> aGivenProto) override;
35 : nsISupports* GetParentObject();
36 :
37 : uint64_t WindowID();
38 : uint64_t InnerWindowID();
39 : bool IsSecure();
40 : void GetCallID(nsString& retval);
41 : void GetRawID(nsString& retval);
42 : void GetMediaSource(nsString& retval);
43 : void GetConstraints(MediaStreamConstraints &result);
44 :
45 : private:
46 0 : virtual ~GetUserMediaRequest() {}
47 :
48 : uint64_t mInnerWindowID, mOuterWindowID;
49 : const nsString mCallID;
50 : const nsString mRawID;
51 : const nsString mMediaSource;
52 : nsAutoPtr<MediaStreamConstraints> mConstraints;
53 : bool mIsSecure;
54 : };
55 :
56 : } // namespace dom
57 : } // namespace mozilla
58 :
59 : #endif // GetUserMediaRequest_h__
|