Changeset 155579 in webkit
- Timestamp:
- Sep 11, 2013 4:46:44 PM (11 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r155573 r155579 1 2013-09-11 Eric Carlson <eric.carlson@apple.com> 2 3 [MediaStream API] Updating NavigatorUserMediaError to match the spec 4 https://bugs.webkit.org/show_bug.cgi?id=120880 5 6 Reviewed by Darin Adler. 7 8 Merge https://chromium.googlesource.com/chromium/blink/+/f07305e49ddebaa166f5dee514bcc881a8efd341 9 by Tommy Widenflycht. 10 11 The Blink change did not have any test changes because they don't appear to have any tests 12 for NavigatorUserMediaError. I can't add tests now because the MediaStream feature isn't enabled 13 yet, so https://bugs.webkit.org/show_bug.cgi?id=121182 tracks adding tests. 14 15 * Modules/mediastream/NavigatorUserMediaError.h: 16 (WebCore::NavigatorUserMediaError::create): 17 (WebCore::NavigatorUserMediaError::name): 18 (WebCore::NavigatorUserMediaError::message): 19 (WebCore::NavigatorUserMediaError::constraintName): 20 (WebCore::NavigatorUserMediaError::NavigatorUserMediaError): 21 * Modules/mediastream/NavigatorUserMediaError.idl: 22 * Modules/mediastream/UserMediaRequest.cpp: 23 (WebCore::UserMediaRequest::fail): 24 (WebCore::UserMediaRequest::failConstraint): 25 * Modules/mediastream/UserMediaRequest.h: 26 1 27 2013-09-11 Thiago de Barros Lacerda <thiago.lacerda@openbossa.org> 2 28 -
trunk/Source/WebCore/Modules/mediastream/NavigatorUserMediaError.h
r123945 r155579 35 35 class NavigatorUserMediaError : public RefCounted<NavigatorUserMediaError> { 36 36 public: 37 // Should be kept in sync with the values in the idl file. 38 enum ErrorCode { 39 PERMISSION_DENIED = 1 40 }; 41 42 static PassRefPtr<NavigatorUserMediaError> create(ErrorCode code) 37 static PassRefPtr<NavigatorUserMediaError> create(const String& name, const String& message, const String& constraintName) 43 38 { 44 return adoptRef(new NavigatorUserMediaError( code));39 return adoptRef(new NavigatorUserMediaError(name, message, constraintName)); 45 40 } 46 41 47 42 virtual ~NavigatorUserMediaError() { } 48 43 49 ErrorCode code() const { return m_code; } 44 const String& name() const { return m_name; } 45 const String& message() const { return m_message; } 46 const String& constraintName() const { return m_constraintName; } 50 47 51 48 private: 52 explicit NavigatorUserMediaError(ErrorCode code) : m_code(code) { } 49 NavigatorUserMediaError(const String& name, const String& message, const String& constraintName) 50 : m_name(name) 51 , m_message(message) 52 , m_constraintName(constraintName) 53 { 54 } 53 55 54 ErrorCode m_code; 56 String m_name; 57 String m_message; 58 String m_constraintName; 55 59 }; 56 60 -
trunk/Source/WebCore/Modules/mediastream/NavigatorUserMediaError.idl
r149796 r155579 27 27 Conditional=MEDIA_STREAM 28 28 ] interface NavigatorUserMediaError { 29 const unsigned short PERMISSION_DENIED = 1; 30 readonly attribute unsigned short code; 29 readonly attribute DOMString name; 30 readonly attribute DOMString message; 31 readonly attribute DOMString constraintName; 31 32 }; 32 33 -
trunk/Source/WebCore/Modules/mediastream/UserMediaRequest.cpp
r155573 r155579 145 145 } 146 146 147 void UserMediaRequest::fail( )147 void UserMediaRequest::fail(const String& description) 148 148 { 149 149 if (!m_scriptExecutionContext) 150 150 return; 151 151 152 if (m_errorCallback) { 153 RefPtr<NavigatorUserMediaError> error = NavigatorUserMediaError::create(NavigatorUserMediaError::PERMISSION_DENIED); 154 m_errorCallback->handleEvent(error.get()); 155 } 152 if (m_errorCallback) 153 m_errorCallback->handleEvent(NavigatorUserMediaError::create(ASCIILiteral("PERMISSION_DENIED"), description, String()).get()); 154 } 155 156 void UserMediaRequest::failConstraint(const String& constraintName, const String& description) 157 { 158 ASSERT(!constraintName.isEmpty()); 159 if (!m_scriptExecutionContext) 160 return; 161 162 if (m_errorCallback) 163 m_errorCallback->handleEvent(NavigatorUserMediaError::create(ASCIILiteral("CONSTRAINT_NOT_SATISFIED"), description, constraintName).get()); 156 164 } 157 165 -
trunk/Source/WebCore/Modules/mediastream/UserMediaRequest.h
r155573 r155579 65 65 66 66 void succeed(PassRefPtr<MediaStreamDescriptor>); 67 void fail(); 67 void fail(const String& description); 68 void failConstraint(const String& constraintName, const String& description); 68 69 69 70 MediaConstraints* audioConstraints() const;
Note: See TracChangeset
for help on using the changeset viewer.