OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2011 Ericsson AB. All rights reserved. | 2 * Copyright (C) 2011 Ericsson AB. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * | 7 * |
8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
(...skipping 14 matching lines...) Expand all Loading... |
25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
29 */ | 29 */ |
30 | 30 |
31 #ifndef UserMediaRequest_h | 31 #ifndef UserMediaRequest_h |
32 #define UserMediaRequest_h | 32 #define UserMediaRequest_h |
33 | 33 |
34 #include "core/dom/ActiveDOMObject.h" | 34 #include "core/dom/ActiveDOMObject.h" |
| 35 #include "core/frame/OriginsUsingFeatures.h" |
35 #include "modules/ModulesExport.h" | 36 #include "modules/ModulesExport.h" |
36 #include "modules/mediastream/NavigatorUserMediaErrorCallback.h" | 37 #include "modules/mediastream/NavigatorUserMediaErrorCallback.h" |
37 #include "modules/mediastream/NavigatorUserMediaSuccessCallback.h" | 38 #include "modules/mediastream/NavigatorUserMediaSuccessCallback.h" |
38 #include "platform/mediastream/MediaStreamSource.h" | 39 #include "platform/mediastream/MediaStreamSource.h" |
39 #include "public/platform/WebMediaConstraints.h" | 40 #include "public/platform/WebMediaConstraints.h" |
40 #include "wtf/Forward.h" | 41 #include "wtf/Forward.h" |
41 #include "wtf/PassRefPtr.h" | 42 #include "wtf/PassRefPtr.h" |
42 | 43 |
43 namespace blink { | 44 namespace blink { |
44 | 45 |
(...skipping 19 matching lines...) Expand all Loading... |
64 void succeed(PassRefPtr<MediaStreamDescriptor>); | 65 void succeed(PassRefPtr<MediaStreamDescriptor>); |
65 void failPermissionDenied(const String& message); | 66 void failPermissionDenied(const String& message); |
66 void failConstraint(const String& constraintName, const String& message); | 67 void failConstraint(const String& constraintName, const String& message); |
67 void failUASpecific(const String& name, const String& message, const String&
constraintName); | 68 void failUASpecific(const String& name, const String& message, const String&
constraintName); |
68 | 69 |
69 bool audio() const; | 70 bool audio() const; |
70 bool video() const; | 71 bool video() const; |
71 WebMediaConstraints audioConstraints() const; | 72 WebMediaConstraints audioConstraints() const; |
72 WebMediaConstraints videoConstraints() const; | 73 WebMediaConstraints videoConstraints() const; |
73 | 74 |
| 75 // errorMessage is only set if requestIsPrivilegedContext() returns |false|. |
| 76 // Caller is responsible for properly setting errors and canceling request. |
| 77 bool isPrivilegedContextUse(String& errorMessage); |
| 78 |
74 // ContextLifecycleObserver | 79 // ContextLifecycleObserver |
75 void contextDestroyed() override; | 80 void contextDestroyed() override; |
76 | 81 |
77 DECLARE_VIRTUAL_TRACE(); | 82 DECLARE_VIRTUAL_TRACE(); |
78 | 83 |
79 private: | 84 private: |
80 UserMediaRequest(ExecutionContext*, UserMediaController*, WebMediaConstraint
s audio, WebMediaConstraints video, NavigatorUserMediaSuccessCallback*, Navigato
rUserMediaErrorCallback*); | 85 UserMediaRequest(ExecutionContext*, UserMediaController*, WebMediaConstraint
s audio, WebMediaConstraints video, NavigatorUserMediaSuccessCallback*, Navigato
rUserMediaErrorCallback*); |
81 | 86 |
82 WebMediaConstraints m_audio; | 87 WebMediaConstraints m_audio; |
83 WebMediaConstraints m_video; | 88 WebMediaConstraints m_video; |
84 | 89 |
85 RawPtrWillBeMember<UserMediaController> m_controller; | 90 RawPtrWillBeMember<UserMediaController> m_controller; |
86 | 91 |
87 Member<NavigatorUserMediaSuccessCallback> m_successCallback; | 92 Member<NavigatorUserMediaSuccessCallback> m_successCallback; |
88 Member<NavigatorUserMediaErrorCallback> m_errorCallback; | 93 Member<NavigatorUserMediaErrorCallback> m_errorCallback; |
89 }; | 94 }; |
90 | 95 |
91 } // namespace blink | 96 } // namespace blink |
92 | 97 |
93 #endif // UserMediaRequest_h | 98 #endif // UserMediaRequest_h |
OLD | NEW |