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

Issue 34393006: Refactor MediaStreamManager to never output real device id. It now always output sourceId in the fo… (Closed)

Created:
7 years, 1 month ago by perkj_chrome
Modified:
7 years, 1 month ago
CC:
chromium-reviews, fischman+watch_chromium.org, jam, joi+watch-content_chromium.org, feature-media-reviews_chromium.org, darin-cc_chromium.org, wjia+watch_chromium.org, miu+watch_chromium.org, justinlin
Visibility:
Public.

Description

Refactor MediaStreamManager to never output real device id. It now always output sourceId in the form of a HMAC. DeviceMessageFilter now don't need to create a source id. This also fix a bug that made the source ids useless unless you have called gum once. Note that the sourceIds are still just using the security origin as salt. Next step is to add a random number that is stored in the profile somehow. This cl also make sure all public APIs are asynchronous by making sure all requests are posted on the UI thread and handled later. Before this change - there were code paths that posted on the UI thread and others that did not that could potentially happen after a request was cancelled. This also make it easier to fail a request based on the input arguments. BUG=269139 Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=232766

Patch Set 1 #

Patch Set 2 : Reviewed my self #

Patch Set 3 : Fix failing VideoCaptureHost tests. Fix failing tests when there is no available audio input device. #

Patch Set 4 : Clean up unneccessary test setup that just caused confusion. #

Total comments: 21

Patch Set 5 : Addressed review comments from xians and merged with jois content::GetHMACForMediaDeviceID #

Patch Set 6 : Fix policy build error. Fix tab capture #

Total comments: 4

Patch Set 7 : Fix broken video_capture_host unittests. Addressed justinlinlins comments. #

Total comments: 43

Patch Set 8 : Addressed review comments. Added MediaStreamManager::WillDestroyCurrentMessageLoopForTest to fix fl… #

Patch Set 9 : Fix screen capture. #

Total comments: 29

Patch Set 10 : Rebased + Addressed Tommis comments except WillDestroyCurrentMessageLoop. #

Total comments: 2

Patch Set 11 : Only do translate to source id if we open an audio and video capturer. #

Patch Set 12 : Reverted the change of making WillDestroyCurrentMessageLoop private. #

Patch Set 13 : Change TranslateDeviceIdToSourceId to check for the request type instead of device type. #

Total comments: 6

Patch Set 14 : Addressed code review comments from miu #

Patch Set 15 : Use MockAudioManager. #

Patch Set 16 : Rebased to latest code base. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+666 lines, -414 lines) Patch
M chrome/browser/policy/policy_browsertest.cc View 1 2 3 4 5 6 7 8 9 2 chunks +2 lines, -2 lines 0 comments Download
M content/browser/renderer_host/media/device_request_message_filter.h View 1 2 3 4 1 chunk +0 lines, -3 lines 0 comments Download
M content/browser/renderer_host/media/device_request_message_filter.cc View 1 2 3 4 3 chunks +2 lines, -20 lines 0 comments Download
M content/browser/renderer_host/media/device_request_message_filter_unittest.cc View 1 2 3 4 3 chunks +0 lines, -48 lines 0 comments Download
M content/browser/renderer_host/media/media_stream_dispatcher_host.cc View 1 2 3 4 1 chunk +2 lines, -6 lines 0 comments Download
M content/browser/renderer_host/media/media_stream_dispatcher_host_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 20 chunks +241 lines, -44 lines 0 comments Download
M content/browser/renderer_host/media/media_stream_manager.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 5 chunks +52 lines, -22 lines 0 comments Download
M content/browser/renderer_host/media/media_stream_manager.cc View 1 2 3 4 5 6 7 8 9 10 11 12 30 chunks +342 lines, -236 lines 0 comments Download
M content/browser/renderer_host/media/media_stream_manager_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 2 chunks +2 lines, -1 line 0 comments Download
M content/browser/renderer_host/media/media_stream_provider.h View 1 chunk +0 lines, -5 lines 0 comments Download
M content/browser/renderer_host/media/media_stream_ui_proxy.cc View 1 2 3 4 5 6 7 8 9 1 chunk +6 lines, -2 lines 0 comments Download
M content/browser/renderer_host/media/media_stream_ui_proxy_unittest.cc View 1 2 3 4 4 chunks +4 lines, -4 lines 0 comments Download
M content/browser/renderer_host/media/video_capture_host_unittest.cc View 1 2 3 4 5 6 1 chunk +1 line, -3 lines 0 comments Download
M content/public/common/media_stream_request.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 2 chunks +0 lines, -4 lines 0 comments Download
M content/public/common/media_stream_request.cc View 1 2 3 4 5 6 7 2 chunks +0 lines, -2 lines 0 comments Download
M content/renderer/media/media_stream_impl.cc View 1 3 chunks +2 lines, -8 lines 0 comments Download
M content/renderer/media/mock_media_stream_dispatcher.cc View 1 2 3 4 5 6 7 8 9 3 chunks +4 lines, -4 lines 0 comments Download
M media/audio/mock_audio_manager.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 chunk +1 line, -0 lines 0 comments Download
M media/audio/mock_audio_manager.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +5 lines, -0 lines 0 comments Download

Messages

Total messages: 28 (0 generated)
perkj_chrome
Hej Here is the first step of changing source ids to be persistent and used ...
7 years, 1 month ago (2013-10-22 16:48:02 UTC) #1
perkj_chrome
Anyone wants to be the first one to take a look?
7 years, 1 month ago (2013-10-23 13:23:43 UTC) #2
no longer working on chromium
On 2013/10/23 13:23:43, perkj wrote: > Anyone wants to be the first one to take ...
7 years, 1 month ago (2013-10-23 13:27:04 UTC) #3
no longer working on chromium
This CL is changing the thread model of MediaStreamManager from sync to be async, I ...
7 years, 1 month ago (2013-10-25 08:16:38 UTC) #4
no longer working on chromium
Per explained to me offline on why he needed to make all the media stream ...
7 years, 1 month ago (2013-10-25 11:45:17 UTC) #5
no longer working on chromium
https://codereview.chromium.org/34393006/diff/180001/content/browser/renderer_host/media/media_stream_manager.cc File content/browser/renderer_host/media/media_stream_manager.cc (right): https://codereview.chromium.org/34393006/diff/180001/content/browser/renderer_host/media/media_stream_manager.cc#newcode208 content/browser/renderer_host/media/media_stream_manager.cc:208: std::string MediaStreamManager::GenerateStream( make remove the code in the dispatcher ...
7 years, 1 month ago (2013-10-25 12:00:06 UTC) #6
perkj_chrome
https://codereview.chromium.org/34393006/diff/180001/content/browser/renderer_host/media/media_stream_manager.cc File content/browser/renderer_host/media/media_stream_manager.cc (right): https://codereview.chromium.org/34393006/diff/180001/content/browser/renderer_host/media/media_stream_manager.cc#newcode203 content/browser/renderer_host/media/media_stream_manager.cc:203: base::Bind(&MediaStreamManager::HandleRequest, On 2013/10/25 08:16:39, xians1 wrote: > I don't ...
7 years, 1 month ago (2013-10-25 13:33:49 UTC) #7
perkj_chrome
7 years, 1 month ago (2013-10-25 16:16:32 UTC) #8
justinlin
I mostly only looked at the tabCapture parts, and they look good to me! No ...
7 years, 1 month ago (2013-10-25 20:54:12 UTC) #9
perkj_chrome
Thanks Justin. Adding Joi as well. Please review as much as you want but at ...
7 years, 1 month ago (2013-10-27 14:26:35 UTC) #10
no longer working on chromium
I only have some more nits, but this change is substantial since it changes the ...
7 years, 1 month ago (2013-10-28 09:13:29 UTC) #11
Jói
//content/public LGTM. Skimmed the rest of the change, see comments below. Cheers, Jói https://codereview.chromium.org/34393006/diff/450001/content/browser/renderer_host/media/media_stream_manager.cc File ...
7 years, 1 month ago (2013-10-28 11:48:17 UTC) #12
tommi (sloooow) - chröme
https://codereview.chromium.org/34393006/diff/450001/content/browser/renderer_host/media/media_stream_dispatcher_host_unittest.cc File content/browser/renderer_host/media/media_stream_dispatcher_host_unittest.cc (right): https://codereview.chromium.org/34393006/diff/450001/content/browser/renderer_host/media/media_stream_dispatcher_host_unittest.cc#newcode366 content/browser/renderer_host/media/media_stream_dispatcher_host_unittest.cc:366: for (size_t i = 0; i < devices.size(); i++) ...
7 years, 1 month ago (2013-10-28 13:48:22 UTC) #13
perkj_chrome
PTAL https://codereview.chromium.org/34393006/diff/450001/content/browser/renderer_host/media/media_stream_dispatcher_host_unittest.cc File content/browser/renderer_host/media/media_stream_dispatcher_host_unittest.cc (right): https://codereview.chromium.org/34393006/diff/450001/content/browser/renderer_host/media/media_stream_dispatcher_host_unittest.cc#newcode366 content/browser/renderer_host/media/media_stream_dispatcher_host_unittest.cc:366: for (size_t i = 0; i < devices.size(); ...
7 years, 1 month ago (2013-10-29 08:52:16 UTC) #14
tommi (sloooow) - chröme
https://codereview.chromium.org/34393006/diff/450001/content/browser/renderer_host/media/media_stream_manager.cc File content/browser/renderer_host/media/media_stream_manager.cc (right): https://codereview.chromium.org/34393006/diff/450001/content/browser/renderer_host/media/media_stream_manager.cc#newcode447 content/browser/renderer_host/media/media_stream_manager.cc:447: request->request.audio_type == MEDIA_DEVICE_AUDIO_CAPTURE ? On 2013/10/29 08:52:17, perkj wrote: ...
7 years, 1 month ago (2013-10-29 17:21:15 UTC) #15
perkj_chrome
Done except for the WillDestroyCurrentMessageLoop. Maybe I should revert those changes in this cl.. https://codereview.chromium.org/34393006/diff/740001/content/browser/renderer_host/media/media_stream_manager.cc ...
7 years, 1 month ago (2013-10-30 08:59:28 UTC) #16
tommi (sloooow) - chröme
https://codereview.chromium.org/34393006/diff/740001/content/browser/renderer_host/media/media_stream_manager.cc File content/browser/renderer_host/media/media_stream_manager.cc (right): https://codereview.chromium.org/34393006/diff/740001/content/browser/renderer_host/media/media_stream_manager.cc#newcode1176 content/browser/renderer_host/media/media_stream_manager.cc:1176: device_info.device.id = content::GetHMACForMediaDeviceID( as discussed do the same checks ...
7 years, 1 month ago (2013-10-30 14:47:29 UTC) #17
perkj_chrome
bartfab - can you help me with owners approval of the little cleanup in policy_browsertest.cc ...
7 years, 1 month ago (2013-10-30 16:57:07 UTC) #18
perkj_chrome
And actually add bartfab to the list of reviewers.... barfab- can you please help look ...
7 years, 1 month ago (2013-10-31 16:11:06 UTC) #19
bartfab (slow)
chrome/browser/policy/policy_browsertest.cc lgtm
7 years, 1 month ago (2013-10-31 16:41:14 UTC) #20
miu
FYI--Removed justinlin@ and added myself as reviewer. Justin had to take an unexpected and sudden ...
7 years, 1 month ago (2013-11-02 03:21:36 UTC) #21
miu
lgtm (for tab capture stuff), but please consider these items: https://codereview.chromium.org/34393006/diff/1150001/content/browser/renderer_host/media/media_stream_dispatcher_host_unittest.cc File content/browser/renderer_host/media/media_stream_dispatcher_host_unittest.cc (right): https://codereview.chromium.org/34393006/diff/1150001/content/browser/renderer_host/media/media_stream_dispatcher_host_unittest.cc#newcode53 ...
7 years, 1 month ago (2013-11-02 03:22:41 UTC) #22
perkj_chrome
Thanks I have addressed Yuris comments as well. https://codereview.chromium.org/34393006/diff/1150001/content/browser/renderer_host/media/media_stream_dispatcher_host_unittest.cc File content/browser/renderer_host/media/media_stream_dispatcher_host_unittest.cc (right): https://codereview.chromium.org/34393006/diff/1150001/content/browser/renderer_host/media/media_stream_dispatcher_host_unittest.cc#newcode53 content/browser/renderer_host/media/media_stream_dispatcher_host_unittest.cc:53: typedef ...
7 years, 1 month ago (2013-11-04 09:32:02 UTC) #23
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/perkj@chromium.org/34393006/1290001
7 years, 1 month ago (2013-11-04 15:26:57 UTC) #24
commit-bot: I haz the power
Failed to apply patch for media/audio/mock_audio_manager.h: While running patch -p1 --forward --force --no-backup-if-mismatch; patching file ...
7 years, 1 month ago (2013-11-04 15:27:04 UTC) #25
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/perkj@chromium.org/34393006/1370001
7 years, 1 month ago (2013-11-04 15:37:31 UTC) #26
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/perkj@chromium.org/34393006/1370001
7 years, 1 month ago (2013-11-04 17:38:45 UTC) #27
commit-bot: I haz the power
7 years, 1 month ago (2013-11-04 19:55:05 UTC) #28
Message was sent while issue was closed.
Change committed as 232766

Powered by Google App Engine
This is Rietveld 408576698