Bug 143255

Summary: WebRTC: Add support for Promise-based MediaDevices.getUserMedia()
Product: WebKit Reporter: Adam Bergkvist <adam.bergkvist>
Component: WebCore Misc.Assignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: commit-queue, eric.carlson, pnormand
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on:    
Bug Blocks: 143211    
Attachments:
Description Flags
Proposed patch
eric.carlson: review+
Patch for landing
commit-queue: commit-queue-
Patch for landing none

Description Adam Bergkvist 2015-03-30 22:35:12 PDT
MediaDevices [1] is a "name space" object that collects some functionality related to local media devices. It's, for example, home to the Promise-based version of getUserMedia() (unprefixed) and enumerateDevices().

[1] https://w3c.github.io/mediacapture-main/#mediadevices
Comment 1 Adam Bergkvist 2015-03-31 10:51:34 PDT
Created attachment 249834 [details]
Proposed patch
Comment 2 Eric Carlson 2015-04-02 06:37:37 PDT
Comment on attachment 249834 [details]
Proposed patch

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

> LayoutTests/fast/mediastream/MediaDevices-getUserMedia.html:20
> +<body>
> +<p id="description"></p>
> +<div id="console"></div>
> +<script>
> +description("Tests getUserMedia (Promise-based version on navigator.mediaDevices)");
> +
> +function setUserMediaPermission(isGranted) {
> +    if (window.testRunner)
> +        testRunner.setUserMediaPermission(isGranted);
> +    else
> +        debug("This test can not be run without the testRunner");
> +}
> +
> +var stream;
> +var errorArg;

Nit: I think this would be slightly easier to read and understand if it was indented.

> Source/WebCore/Modules/mediastream/UserMediaRequest.cpp:204
>      RefPtr<NavigatorUserMediaError> error = NavigatorUserMediaError::create(NavigatorUserMediaError::permissionDeniedErrorName(), emptyString());

Shouldn't this be a MediaStreamError? If so, please add a FIXME: with a bug.
Comment 3 Adam Bergkvist 2015-04-02 07:20:58 PDT
(In reply to comment #2)
> Nit: I think this would be slightly easier to read and understand if it was
> indented.

I found a few different styles among the tests, but most tests within the mediastream module seems to be indented so I'll align this test.

> > Source/WebCore/Modules/mediastream/UserMediaRequest.cpp:204
> >      RefPtr<NavigatorUserMediaError> error = NavigatorUserMediaError::create(NavigatorUserMediaError::permissionDeniedErrorName(), emptyString());
> 
> Shouldn't this be a MediaStreamError? If so, please add a FIXME: with a bug.

I'll do that.

Thanks for reviewing.
Comment 4 Adam Bergkvist 2015-04-02 07:59:57 PDT
Created attachment 249978 [details]
Patch for landing
Comment 5 Adam Bergkvist 2015-04-02 08:53:06 PDT
Comment on attachment 249978 [details]
Patch for landing

Bots all green, setting cq+
Comment 6 WebKit Commit Bot 2015-04-02 08:55:14 PDT
Comment on attachment 249978 [details]
Patch for landing

Rejecting attachment 249978 [details] from commit-queue.

Failed to run "['/Volumes/Data/EWS/WebKit/Tools/Scripts/webkit-patch', '--status-host=webkit-queues.appspot.com', '--bot-id=webkit-cq-02', 'validate-changelog', '--check-oops', '--non-interactive', 249978, '--port=mac']" exit_code: 1 cwd: /Volumes/Data/EWS/WebKit

ChangeLog entry in LayoutTests/ChangeLog contains OOPS!.

Full output: http://webkit-queues.appspot.com/results/5272158381015040
Comment 7 Adam Bergkvist 2015-04-02 09:07:17 PDT
Created attachment 249983 [details]
Patch for landing

With reviewer name this time.
Comment 8 WebKit Commit Bot 2015-04-02 10:38:10 PDT
Comment on attachment 249983 [details]
Patch for landing

Clearing flags on attachment: 249983

Committed r182275: <http://trac.webkit.org/changeset/182275>
Comment 9 WebKit Commit Bot 2015-04-02 10:38:14 PDT
All reviewed patches have been landed.  Closing bug.