Bug 120880 - [MediaStream API] Updating NavigatorUserMediaError to match the spec
Summary: [MediaStream API] Updating NavigatorUserMediaError to match the spec
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore Misc. (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Eric Carlson
URL:
Keywords: BlinkMergeCandidate
Depends on:
Blocks: 121101
  Show dependency treegraph
 
Reported: 2013-09-06 12:00 PDT by Eric Carlson
Modified: 2013-09-11 16:52 PDT (History)
10 users (show)

See Also:


Attachments
Proposed patch (5.78 KB, patch)
2013-09-11 15:01 PDT, Eric Carlson
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Eric Carlson 2013-09-06 12:00:20 PDT
Consider merging https://chromium.googlesource.com/chromium/blink/+/f07305e49ddebaa166f5dee514bcc881a8efd341 

Adding support for CONSTRAINT_NOT_SATISFIED as well as uppdating the error callback to match the spec.
Comment 1 Eric Carlson 2013-09-11 15:01:24 PDT
Created attachment 211357 [details]
Proposed patch
Comment 2 Darin Adler 2013-09-11 15:12:09 PDT
Comment on attachment 211357 [details]
Proposed patch

View in context: https://bugs.webkit.org/attachment.cgi?id=211357&action=review

> Source/WebCore/Modules/mediastream/UserMediaRequest.cpp:163
> +        RefPtr<NavigatorUserMediaError> error = NavigatorUserMediaError::create(ASCIILiteral("PERMISSION_DENIED"), description, String());
> +        m_errorCallback->handleEvent(error.get());

I sometimes like the way these read without a local variable. The single line would be no longer than the first of these two lines of code.
Comment 3 Jer Noble 2013-09-11 15:12:51 PDT
Comment on attachment 211357 [details]
Proposed patch

View in context: https://bugs.webkit.org/attachment.cgi?id=211357&action=review

Apart from a minor nit (which could, if anything, be fixed in a future patch), LGTM. r=me.

> Source/WebCore/Modules/mediastream/UserMediaRequest.cpp:162
> +        RefPtr<NavigatorUserMediaError> error = NavigatorUserMediaError::create(ASCIILiteral("PERMISSION_DENIED"), description, String());

Nit: Should this and...

> Source/WebCore/Modules/mediastream/UserMediaRequest.cpp:174
> +        RefPtr<NavigatorUserMediaError> error = NavigatorUserMediaError::create(ASCIILiteral("CONSTRAINT_NOT_SATISFIED"), description, constraintName);

...this be static keywords on NavigatorUserMediaError?
Comment 4 Eric Carlson 2013-09-11 16:46:25 PDT
(In reply to comment #2)
> (From update of attachment 211357 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=211357&action=review
> 
> > Source/WebCore/Modules/mediastream/UserMediaRequest.cpp:163
> > +        RefPtr<NavigatorUserMediaError> error = NavigatorUserMediaError::create(ASCIILiteral("PERMISSION_DENIED"), description, String());
> > +        m_errorCallback->handleEvent(error.get());
> 
> I sometimes like the way these read without a local variable. The single line would be no longer than the first of these two lines of code.

Done
Comment 5 Eric Carlson 2013-09-11 16:48:08 PDT
(In reply to comment #3)
> (From update of attachment 211357 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=211357&action=review
> 
> Apart from a minor nit (which could, if anything, be fixed in a future patch), LGTM. r=me.
> 
> > Source/WebCore/Modules/mediastream/UserMediaRequest.cpp:162
> > +        RefPtr<NavigatorUserMediaError> error = NavigatorUserMediaError::create(ASCIILiteral("PERMISSION_DENIED"), description, String());
> 
> Nit: Should this and...
> 
> > Source/WebCore/Modules/mediastream/UserMediaRequest.cpp:174
> > +        RefPtr<NavigatorUserMediaError> error = NavigatorUserMediaError::create(ASCIILiteral("CONSTRAINT_NOT_SATISFIED"), description, constraintName);
> 
> ...this be static keywords on NavigatorUserMediaError?

Great idea. It turns out that the spec has changed and both of those error strings are incorrect, so I will fix this when I update.
Comment 6 Eric Carlson 2013-09-11 16:51:50 PDT
Committed r155579: https://trac.webkit.org/r155579