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 21 matching lines...) Expand all Loading... |
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 "core/frame/OriginsUsingFeatures.h" |
36 #include "modules/ModulesExport.h" | 36 #include "modules/ModulesExport.h" |
37 #include "modules/mediastream/NavigatorUserMediaErrorCallback.h" | 37 #include "modules/mediastream/NavigatorUserMediaErrorCallback.h" |
38 #include "modules/mediastream/NavigatorUserMediaSuccessCallback.h" | 38 #include "modules/mediastream/NavigatorUserMediaSuccessCallback.h" |
39 #include "platform/mediastream/MediaStreamSource.h" | 39 #include "platform/mediastream/MediaStreamSource.h" |
40 #include "public/platform/WebMediaConstraints.h" | 40 #include "public/platform/WebMediaConstraints.h" |
41 #include "wtf/Forward.h" | 41 #include "wtf/Forward.h" |
42 #include "wtf/PassRefPtr.h" | |
43 | 42 |
44 namespace blink { | 43 namespace blink { |
45 | 44 |
46 class Dictionary; | 45 class Dictionary; |
47 class Document; | 46 class Document; |
48 class ExceptionState; | 47 class ExceptionState; |
49 class MediaStreamConstraints; | 48 class MediaStreamConstraints; |
50 class MediaStreamDescriptor; | 49 class MediaStreamDescriptor; |
51 class UserMediaController; | 50 class UserMediaController; |
52 | 51 |
53 class MODULES_EXPORT UserMediaRequest final : public GarbageCollectedFinalized<U
serMediaRequest>, public ContextLifecycleObserver { | 52 class MODULES_EXPORT UserMediaRequest final : public GarbageCollectedFinalized<U
serMediaRequest>, public ContextLifecycleObserver { |
54 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(UserMediaRequest); | 53 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(UserMediaRequest); |
55 public: | 54 public: |
56 static UserMediaRequest* create(ExecutionContext*, UserMediaController*, con
st MediaStreamConstraints& options, NavigatorUserMediaSuccessCallback*, Navigato
rUserMediaErrorCallback*, ExceptionState&); | 55 static UserMediaRequest* create(ExecutionContext*, UserMediaController*, con
st MediaStreamConstraints& options, NavigatorUserMediaSuccessCallback*, Navigato
rUserMediaErrorCallback*, ExceptionState&); |
57 virtual ~UserMediaRequest(); | 56 virtual ~UserMediaRequest(); |
58 | 57 |
59 NavigatorUserMediaSuccessCallback* successCallback() const { return m_succes
sCallback.get(); } | 58 NavigatorUserMediaSuccessCallback* successCallback() const { return m_succes
sCallback.get(); } |
60 NavigatorUserMediaErrorCallback* errorCallback() const { return m_errorCallb
ack.get(); } | 59 NavigatorUserMediaErrorCallback* errorCallback() const { return m_errorCallb
ack.get(); } |
61 Document* ownerDocument(); | 60 Document* ownerDocument(); |
62 | 61 |
63 void start(); | 62 void start(); |
64 | 63 |
65 void succeed(PassRefPtr<MediaStreamDescriptor>); | 64 void succeed(MediaStreamDescriptor*); |
66 void failPermissionDenied(const String& message); | 65 void failPermissionDenied(const String& message); |
67 void failConstraint(const String& constraintName, const String& message); | 66 void failConstraint(const String& constraintName, const String& message); |
68 void failUASpecific(const String& name, const String& message, const String&
constraintName); | 67 void failUASpecific(const String& name, const String& message, const String&
constraintName); |
69 | 68 |
70 bool audio() const; | 69 bool audio() const; |
71 bool video() const; | 70 bool video() const; |
72 WebMediaConstraints audioConstraints() const; | 71 WebMediaConstraints audioConstraints() const; |
73 WebMediaConstraints videoConstraints() const; | 72 WebMediaConstraints videoConstraints() const; |
74 | 73 |
75 // errorMessage is only set if requestIsPrivilegedContext() returns |false|. | 74 // errorMessage is only set if requestIsPrivilegedContext() returns |false|. |
(...skipping 13 matching lines...) Expand all Loading... |
89 | 88 |
90 RawPtrWillBeMember<UserMediaController> m_controller; | 89 RawPtrWillBeMember<UserMediaController> m_controller; |
91 | 90 |
92 Member<NavigatorUserMediaSuccessCallback> m_successCallback; | 91 Member<NavigatorUserMediaSuccessCallback> m_successCallback; |
93 Member<NavigatorUserMediaErrorCallback> m_errorCallback; | 92 Member<NavigatorUserMediaErrorCallback> m_errorCallback; |
94 }; | 93 }; |
95 | 94 |
96 } // namespace blink | 95 } // namespace blink |
97 | 96 |
98 #endif // UserMediaRequest_h | 97 #endif // UserMediaRequest_h |
OLD | NEW |