Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(709)

Issue 2764043002: Serialize processing of getUserMedia() requests. (Closed)

Created:
3 years, 9 months ago by Guido Urdaneta
Modified:
3 years, 9 months ago
CC:
chromium-reviews, mlamouri+watch-content_chromium.org, posciak+watch_chromium.org, chfremer+watch_chromium.org, jam, feature-media-reviews_chromium.org, darin-cc_chromium.org
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

Serialize processing of getUserMedia() requests. This is in anticipation to using the spec-compliant algorithm for constraints processing. The standard algorithm requires knowing the capabilities of all devices before selecting the settings to be used. If two requests are processed in parallel this can lead to races that would result in unexpected errors. For example, there may be two requests that require the same camera but prefer (though not require) different resolutions. If the requests are handled in parallel and the camera has not been opened yet, both requests will see that all resolutions are supported and both will try to open the camera with different resolutions and one of the requests will fail unxpectedly. If the requests are handled sequentially, the camera will be opened with the resolution selected by the first request, and the second request will see that that resolution is the only available one. If that resolution satisfies the constraints for the second request, the request will succeed. Otherwise, it will fail in a spec-compliant way. This CL also includes: * A minor refactoring to expose fewer implementation details to the unit test. * Removal of some unnecessary includes and logging statements. * More consistent naming of variables. request_info for UserMediaRequestInfo and request or user_media_request for WebUserMediaRequest. BUG=657733 Review-Url: https://codereview.chromium.org/2764043002 Cr-Commit-Position: refs/heads/master@{#458560} Committed: https://chromium.googlesource.com/chromium/src/+/d727ed27c3dde3c85195625b97e79472eda73508

Patch Set 1 #

Total comments: 2

Patch Set 2 : Address tommi's comments #

Unified diffs Side-by-side diffs Delta from patch set Stats (+358 lines, -359 lines) Patch
M content/renderer/media/user_media_client_impl.h View 8 chunks +37 lines, -113 lines 0 comments Download
M content/renderer/media/user_media_client_impl.cc View 1 22 chunks +307 lines, -227 lines 0 comments Download
M content/renderer/media/user_media_client_impl_unittest.cc View 3 chunks +14 lines, -19 lines 0 comments Download

Messages

Total messages: 17 (11 generated)
Guido Urdaneta
Hi, PTAL.
3 years, 9 months ago (2017-03-21 16:14:10 UTC) #9
tommi (sloooow) - chröme
https://codereview.chromium.org/2764043002/diff/40001/content/renderer/media/user_media_client_impl.cc File content/renderer/media/user_media_client_impl.cc (right): https://codereview.chromium.org/2764043002/diff/40001/content/renderer/media/user_media_client_impl.cc#newcode246 content/renderer/media/user_media_client_impl.cc:246: int request_id; lots of public member variables - intentional? ...
3 years, 9 months ago (2017-03-21 16:59:34 UTC) #10
Guido Urdaneta
https://codereview.chromium.org/2764043002/diff/40001/content/renderer/media/user_media_client_impl.cc File content/renderer/media/user_media_client_impl.cc (right): https://codereview.chromium.org/2764043002/diff/40001/content/renderer/media/user_media_client_impl.cc#newcode246 content/renderer/media/user_media_client_impl.cc:246: int request_id; On 2017/03/21 16:59:34, tommi - chröme wrote: ...
3 years, 9 months ago (2017-03-21 18:41:34 UTC) #11
tommi (sloooow) - chröme
thanks, lgtm
3 years, 9 months ago (2017-03-21 19:07:29 UTC) #12
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2764043002/60001
3 years, 9 months ago (2017-03-21 20:14:41 UTC) #14
commit-bot: I haz the power
3 years, 9 months ago (2017-03-21 21:43:41 UTC) #17
Message was sent while issue was closed.
Committed patchset #2 (id:60001) as
https://chromium.googlesource.com/chromium/src/+/d727ed27c3dde3c85195625b97e7...

Powered by Google App Engine
This is Rietveld 408576698