Bug 97540 - MediaStream API: Update getUserMedia to match the latest specification
Summary: MediaStream API: Update getUserMedia to match the latest specification
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore Misc. (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Tommy Widenflycht
URL:
Keywords: WebExposed
Depends on: 97582
Blocks: 56459
  Show dependency treegraph
 
Reported: 2012-09-25 02:26 PDT by Tommy Widenflycht
Modified: 2012-09-27 04:09 PDT (History)
8 users (show)

See Also:


Attachments
Patch (40.58 KB, patch)
2012-09-25 02:40 PDT, Tommy Widenflycht
no flags Details | Formatted Diff | Diff
Patch (41.26 KB, patch)
2012-09-26 01:15 PDT, Tommy Widenflycht
abarth: review+
webkit.review.bot: commit-queue-
Details | Formatted Diff | Diff
Patch for landing (40.48 KB, patch)
2012-09-27 02:09 PDT, Tommy Widenflycht
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Tommy Widenflycht 2012-09-25 02:26:11 PDT
http://dev.w3.org/2011/webrtc/editor/getusermedia.html#navigatorusermedia

Navigator.getUserMedia is changed so that the audio and video members can either be a bool or a constraints object.
Comment 1 Tommy Widenflycht 2012-09-25 02:40:46 PDT
Created attachment 165564 [details]
Patch
Comment 2 WebKit Review Bot 2012-09-25 02:44:34 PDT
Please wait for approval from abarth@webkit.org, dglazkov@chromium.org, fishd@chromium.org, jamesr@chromium.org or tkent@chromium.org before submitting, as this patch contains changes to the Chromium public API. See also https://trac.webkit.org/wiki/ChromiumWebKitAPI.
Comment 3 Adam Barth 2012-09-25 09:20:09 PDT
Comment on attachment 165564 [details]
Patch

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

> Source/WebCore/Modules/mediastream/UserMediaRequest.cpp:59
> +        bool flag = false;

flag = ?  I guess the name ok is already taken...

> Source/WebCore/Modules/mediastream/UserMediaRequest.cpp:83
> +    RefPtr<UserMediaRequest> request = adoptRef(new UserMediaRequest(context, controller, audio.release(), video.release(), successCallback, errorCallback));
> +
>      return request.release();

You can merge these lines and delete the variable |request| if you like.

> Source/WebCore/Modules/mediastream/UserMediaRequest.cpp:102
> +    return (bool)m_audio;

static_cast<bool>(m_audio)

WebKit uses C++ style casts.

Actually, is that even necessary?  Does the compiler complain if you leave off the explicit cast?
Comment 4 Adam Barth 2012-09-25 09:21:09 PDT
Comment on attachment 165564 [details]
Patch

Tommy, would you be willing to fix these nits in a followup patch?  I see that you're already asleep and I want to save you the timezone round-trip.
Comment 5 WebKit Review Bot 2012-09-25 09:29:52 PDT
Comment on attachment 165564 [details]
Patch

Clearing flags on attachment: 165564

Committed r129517: <http://trac.webkit.org/changeset/129517>
Comment 6 WebKit Review Bot 2012-09-25 09:29:56 PDT
All reviewed patches have been landed.  Closing bug.
Comment 7 WebKit Review Bot 2012-09-25 11:21:06 PDT
Re-opened since this is blocked by 97582
Comment 8 Tommy Widenflycht 2012-09-26 01:07:07 PDT
Comment on attachment 165564 [details]
Patch

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

>> Source/WebCore/Modules/mediastream/UserMediaRequest.cpp:59
>> +        bool flag = false;
> 
> flag = ?  I guess the name ok is already taken...

Changed names to make more sense. "name" -> "mediaType" and "flag" -> "mediaRequested".

Here I am checking if the mediaType is a Dictionary or a boolean, and extracting the correct value.

>> Source/WebCore/Modules/mediastream/UserMediaRequest.cpp:83
>>      return request.release();
> 
> You can merge these lines and delete the variable |request| if you like.

Done.

>> Source/WebCore/Modules/mediastream/UserMediaRequest.cpp:102
>> +    return (bool)m_audio;
> 
> static_cast<bool>(m_audio)
> 
> WebKit uses C++ style casts.
> 
> Actually, is that even necessary?  Does the compiler complain if you leave off the explicit cast?

I have not used c-style casts for ages and recently I started adding them, sigh. I'm sorry.

You are right, there is no need for a cast at all here.
Comment 9 Tommy Widenflycht 2012-09-26 01:07:51 PDT
(In reply to comment #7)
> Re-opened since this is blocked by 97582

Caused by a missing WEBKIT_EXPORT in WebMediaConstraints.h. Fixed.
Comment 10 Tommy Widenflycht 2012-09-26 01:15:08 PDT
Created attachment 165746 [details]
Patch
Comment 11 Build Bot 2012-09-26 01:38:46 PDT
Comment on attachment 165746 [details]
Patch

Attachment 165746 [details] did not pass mac-ews (mac):
Output: http://queues.webkit.org/results/14032377

New failing tests:
http/tests/workers/terminate-during-sync-operation.html
Comment 12 Tommy Widenflycht 2012-09-26 02:00:05 PDT
Since the Mac build hasn't enabled MEDIA_STREAMS I am pretty sure my patch has nothing to do with this failure.

(In reply to comment #11)
> (From update of attachment 165746 [details])
> Attachment 165746 [details] did not pass mac-ews (mac):
> Output: http://queues.webkit.org/results/14032377
> 
> New failing tests:
> http/tests/workers/terminate-during-sync-operation.html
Comment 13 Adam Barth 2012-09-26 08:57:25 PDT
> Since the Mac build hasn't enabled MEDIA_STREAMS I am pretty sure my patch has nothing to do with this failure.

Yeah, running the tests on mac is new.  I think that's just a flaky test.
Comment 14 WebKit Review Bot 2012-09-26 09:23:40 PDT
Comment on attachment 165746 [details]
Patch

Rejecting attachment 165746 [details] from commit-queue.

Failed to run "['/mnt/git/webkit-commit-queue/Tools/Scripts/webkit-patch', '--status-host=queues.webkit.org', '-..." exit_code: 2

Last 500 characters of output:
Kit/chromium/third_party/yasm/source/patched-yasm --revision 154708 --non-interactive --force --accept theirs-conflict --ignore-externals' in '/mnt/git/webkit-commit-queue/Source/WebKit/chromium'
51>At revision 154708.

________ running '/usr/bin/python tools/clang/scripts/update.py --mac-only' in '/mnt/git/webkit-commit-queue/Source/WebKit/chromium'

________ running '/usr/bin/python gyp_webkit' in '/mnt/git/webkit-commit-queue/Source/WebKit/chromium'
Updating webkit projects from gyp files...

Full output: http://queues.webkit.org/results/14036464
Comment 15 Tommy Widenflycht 2012-09-27 02:09:18 PDT
Created attachment 165954 [details]
Patch for landing
Comment 16 WebKit Review Bot 2012-09-27 04:06:56 PDT
Comment on attachment 165954 [details]
Patch for landing

Clearing flags on attachment: 165954

Committed r129749: <http://trac.webkit.org/changeset/129749>