Coverage Report

Created: 2018-09-25 14:53

/src/mozilla-central/dom/media/GetUserMediaRequest.h
Line
Count
Source (jump to first uncovered line)
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
                      bool aIsHandlingUserInput);
28
  GetUserMediaRequest(nsPIDOMWindowInner* aInnerWindow,
29
                      const nsAString& aRawId,
30
                      const nsAString& aMediaSource);
31
32
  NS_DECL_CYCLE_COLLECTING_ISUPPORTS
33
  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(GetUserMediaRequest)
34
35
  JSObject* WrapObject(JSContext* cx, JS::Handle<JSObject*> aGivenProto) override;
36
  nsISupports* GetParentObject();
37
38
  uint64_t WindowID();
39
  uint64_t InnerWindowID();
40
  bool IsSecure();
41
  bool IsHandlingUserInput() const;
42
  void GetCallID(nsString& retval);
43
  void GetRawID(nsString& retval);
44
  void GetMediaSource(nsString& retval);
45
  void GetConstraints(MediaStreamConstraints &result);
46
47
private:
48
0
  virtual ~GetUserMediaRequest() = default;
49
50
  uint64_t mInnerWindowID, mOuterWindowID;
51
  const nsString mCallID;
52
  const nsString mRawID;
53
  const nsString mMediaSource;
54
  nsAutoPtr<MediaStreamConstraints> mConstraints;
55
  bool mIsSecure;
56
  bool mIsHandlingUserInput;
57
};
58
59
} // namespace dom
60
} // namespace mozilla
61
62
#endif // GetUserMediaRequest_h__