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

Issue 483523006: Check all settings when checking mic and camera access (Closed)

Created:
6 years, 4 months ago by Henrik Grunell
Modified:
6 years, 2 months ago
CC:
chromium-reviews, creis+watch_chromium.org, posciak+watch_chromium.org, nasko+codewatch_chromium.org, jam, mcasas+watch_chromium.org, feature-media-reviews_chromium.org, darin-cc_chromium.org, wjia+watch_chromium.org
Project:
chromium
Visibility:
Public.

Description

Check all settings when checking mic and camera access. We check if we have camera or mic access when devices are enumerated to determine if labels should be visible or not. We must ensure all settings are checked when doing this. * Add interface to ContentBrowserClient for checking media access permission. Add implementation in //chrome. * Refactor permission checking in MediaStreamDevicesController to be able to use them from elsewhere. * Add checking policy and app permission to the existing content settings check. * Remove old interfaces on ResourceContext and its implementations. * Move the permission check from MediaStreamDispatcherHost to MediaStreamManager. * Refactor MediaStreamManager to be able to mock the check function and update unit test to mock it. TBR=jochen@chromium.org (for a few trivial changes) BUG=406094 Committed: https://crrev.com/72dc4829a2a5bd7cbf42c956ac9ba6e8e744b004 Cr-Commit-Position: refs/heads/master@{#292868}

Patch Set 1 #

Total comments: 8

Patch Set 2 : Implementation. #

Patch Set 3 : Changed path so that we query through content client. Updated unit tests. #

Patch Set 4 : Rebase. #

Total comments: 16

Patch Set 5 : Code review fixes. #

Total comments: 6

Patch Set 6 : Code review. #

Patch Set 7 : Rebase #

Patch Set 8 : Build fix for Android. #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+369 lines, -244 lines) Patch
M android_webview/browser/aw_resource_context.h View 1 2 1 chunk +0 lines, -2 lines 0 comments Download
M android_webview/browser/aw_resource_context.cc View 1 2 1 chunk +0 lines, -8 lines 0 comments Download
M chrome/browser/chrome_content_browser_client.h View 1 2 1 chunk +4 lines, -0 lines 0 comments Download
M chrome/browser/chrome_content_browser_client.cc View 1 2 3 4 5 6 1 chunk +9 lines, -0 lines 0 comments Download
M chrome/browser/media/media_capture_devices_dispatcher.h View 1 2 3 4 1 chunk +6 lines, -0 lines 0 comments Download
M chrome/browser/media/media_capture_devices_dispatcher.cc View 1 2 3 4 5 6 7 4 chunks +73 lines, -0 lines 0 comments Download
A chrome/browser/media/media_stream_device_permissions.h View 1 2 3 4 5 1 chunk +28 lines, -0 lines 0 comments Download
A chrome/browser/media/media_stream_device_permissions.cc View 1 2 3 4 5 1 chunk +87 lines, -0 lines 0 comments Download
M chrome/browser/media/media_stream_devices_controller.h View 1 2 chunks +0 lines, -15 lines 0 comments Download
M chrome/browser/media/media_stream_devices_controller.cc View 1 2 3 4 5 9 chunks +15 lines, -75 lines 0 comments Download
M chrome/browser/profiles/profile_io_data.h View 1 2 3 1 chunk +0 lines, -6 lines 0 comments Download
M chrome/browser/profiles/profile_io_data.cc View 1 2 3 1 chunk +0 lines, -17 lines 0 comments Download
M chrome/chrome_browser.gypi View 1 2 3 4 5 6 1 chunk +2 lines, -0 lines 0 comments Download
M chromecast/shell/browser/cast_browser_context.cc View 1 2 2 chunks +2 lines, -9 lines 0 comments Download
M content/browser/loader/resource_scheduler_unittest.cc View 1 2 1 chunk +0 lines, -2 lines 0 comments Download
M content/browser/renderer_host/media/device_request_message_filter.cc View 1 2 1 chunk +4 lines, -6 lines 0 comments Download
M content/browser/renderer_host/media/device_request_message_filter_unittest.cc View 1 2 4 chunks +6 lines, -8 lines 0 comments Download
M content/browser/renderer_host/media/media_stream_dispatcher_host.h View 1 2 2 chunks +1 line, -5 lines 0 comments Download
M content/browser/renderer_host/media/media_stream_dispatcher_host.cc View 1 2 2 chunks +3 lines, -13 lines 0 comments Download
M content/browser/renderer_host/media/media_stream_dispatcher_host_unittest.cc View 1 2 3 4 5 6 chunks +41 lines, -16 lines 0 comments Download
M content/browser/renderer_host/media/media_stream_manager.h View 1 2 3 4 5 3 chunks +9 lines, -3 lines 0 comments Download
M content/browser/renderer_host/media/media_stream_manager.cc View 1 2 3 4 5 11 chunks +61 lines, -13 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, -2 lines 0 comments Download
M content/browser/renderer_host/render_process_host_impl.cc View 1 2 3 4 5 6 1 chunk +1 line, -2 lines 0 comments Download
M content/public/browser/content_browser_client.h View 1 2 3 4 2 chunks +8 lines, -0 lines 1 comment Download
M content/public/browser/content_browser_client.cc View 1 2 1 chunk +7 lines, -0 lines 0 comments Download
M content/public/browser/resource_context.h View 1 2 1 chunk +0 lines, -10 lines 0 comments Download
M content/public/test/mock_resource_context.h View 1 2 1 chunk +0 lines, -15 lines 0 comments Download
M content/public/test/mock_resource_context.cc View 1 2 2 chunks +1 line, -11 lines 0 comments Download
M content/shell/browser/shell_browser_context.cc View 1 2 1 chunk +0 lines, -6 lines 0 comments Download

Messages

Total messages: 39 (4 generated)
Henrik Grunell
This is a draft of the interface I plan to add. If OK, I'll proceed ...
6 years, 4 months ago (2014-08-25 12:23:53 UTC) #1
Henrik Grunell
Oh, and this CL would make the CL https://codereview.chromium.org/502483002/ tommi@ have reviewed obsolete.
6 years, 4 months ago (2014-08-25 12:24:44 UTC) #2
Charlie Reis
creis@chromium.org changed reviewers: + jam@chromium.org
6 years, 4 months ago (2014-08-25 18:35:43 UTC) #3
Charlie Reis
I don't see any big concerns given the similarity to RequestMediaAccessPermission. One naming nit and ...
6 years, 4 months ago (2014-08-25 18:35:44 UTC) #4
Henrik Grunell
https://codereview.chromium.org/483523006/diff/1/content/browser/frame_host/render_frame_host_delegate.h File content/browser/frame_host/render_frame_host_delegate.h (right): https://codereview.chromium.org/483523006/diff/1/content/browser/frame_host/render_frame_host_delegate.h#newcode136 content/browser/frame_host/render_frame_host_delegate.h:136: virtual void AllowMicAccessBasedOnPolicyAndAppPermissions( On 2014/08/25 18:35:44, Charlie Reis wrote: ...
6 years, 4 months ago (2014-08-25 19:14:14 UTC) #5
jam
looks like this cl isn't ready for review yet? https://codereview.chromium.org/483523006/diff/1/content/public/browser/web_contents_delegate.h File content/public/browser/web_contents_delegate.h (right): https://codereview.chromium.org/483523006/diff/1/content/public/browser/web_contents_delegate.h#newcode451 content/public/browser/web_contents_delegate.h:451: ...
6 years, 4 months ago (2014-08-25 19:18:24 UTC) #6
Charlie Reis
SGTM, if you want to proceed with it. https://codereview.chromium.org/483523006/diff/1/content/browser/frame_host/render_frame_host_delegate.h File content/browser/frame_host/render_frame_host_delegate.h (right): https://codereview.chromium.org/483523006/diff/1/content/browser/frame_host/render_frame_host_delegate.h#newcode137 content/browser/frame_host/render_frame_host_delegate.h:137: const ...
6 years, 4 months ago (2014-08-25 20:30:11 UTC) #7
Henrik Grunell
PTAL. getSources path through MediaStreamCenter (renderer) and DeviceRequestMessageFilter (browser) doesn't work at the moment due ...
6 years, 3 months ago (2014-08-26 16:56:32 UTC) #8
Charlie Reis
content/ looks ok to me so far. Let us know once it's working. (One lament: ...
6 years, 3 months ago (2014-08-26 21:52:40 UTC) #9
Henrik Grunell
On 2014/08/26 21:52:40, Charlie Reis wrote: > content/ looks ok to me so far. Let ...
6 years, 3 months ago (2014-08-27 05:36:03 UTC) #10
Henrik Grunell
grunell@chromium.org changed reviewers: + lcwu@chromium.org, michaelbai@chromium.org, perkj@chromium.org
6 years, 3 months ago (2014-08-28 12:51:31 UTC) #11
Henrik Grunell
Adding reviewers: perkj@: Please do a general review, but particularly the */media/* parts. michaelbai@: android_webview/* ...
6 years, 3 months ago (2014-08-28 12:57:15 UTC) #12
perkj_chrome
As far as I got today... https://codereview.chromium.org/483523006/diff/60001/chrome/browser/media/media_capture_devices_dispatcher.cc File chrome/browser/media/media_capture_devices_dispatcher.cc (right): https://codereview.chromium.org/483523006/diff/60001/chrome/browser/media/media_capture_devices_dispatcher.cc#newcode261 chrome/browser/media/media_capture_devices_dispatcher.cc:261: if (!security_origin.SchemeIs(extensions::kExtensionScheme)) Should ...
6 years, 3 months ago (2014-08-28 15:09:40 UTC) #13
lcwu1
lgtm on chromecast/*.
6 years, 3 months ago (2014-08-28 17:03:45 UTC) #14
Charlie Reis
This is much nicer than going through all the RFH->WebContents->Browser layers! Moving it from ResourceContext ...
6 years, 3 months ago (2014-08-28 17:27:48 UTC) #15
Henrik Grunell
https://codereview.chromium.org/483523006/diff/60001/chrome/browser/media/media_capture_devices_dispatcher.cc File chrome/browser/media/media_capture_devices_dispatcher.cc (right): https://codereview.chromium.org/483523006/diff/60001/chrome/browser/media/media_capture_devices_dispatcher.cc#newcode261 chrome/browser/media/media_capture_devices_dispatcher.cc:261: if (!security_origin.SchemeIs(extensions::kExtensionScheme)) On 2014/08/28 15:09:40, perkj wrote: > Should ...
6 years, 3 months ago (2014-08-29 07:59:10 UTC) #16
perkj_chrome
Looks good. https://codereview.chromium.org/483523006/diff/80001/chrome/browser/media/media_stream_devices_util.h File chrome/browser/media/media_stream_devices_util.h (right): https://codereview.chromium.org/483523006/diff/80001/chrome/browser/media/media_stream_devices_util.h#newcode6 chrome/browser/media/media_stream_devices_util.h:6: #define CHROME_BROWSER_MEDIA_MEDIA_STREAM_DEVICES_UTIL_H_ CHROME_BROWSER_MEDIA_MEDIA_STREAM_DEVICE_PERMISSIONS_? We have so many ...
6 years, 3 months ago (2014-08-29 09:38:10 UTC) #17
Henrik Grunell
https://codereview.chromium.org/483523006/diff/80001/chrome/browser/media/media_stream_devices_util.h File chrome/browser/media/media_stream_devices_util.h (right): https://codereview.chromium.org/483523006/diff/80001/chrome/browser/media/media_stream_devices_util.h#newcode6 chrome/browser/media/media_stream_devices_util.h:6: #define CHROME_BROWSER_MEDIA_MEDIA_STREAM_DEVICES_UTIL_H_ On 2014/08/29 09:38:10, perkj wrote: > CHROME_BROWSER_MEDIA_MEDIA_STREAM_DEVICE_PERMISSIONS_? ...
6 years, 3 months ago (2014-08-29 11:20:08 UTC) #18
perkj_chrome
lgtm on content/renderer/media.
6 years, 3 months ago (2014-08-29 11:42:50 UTC) #19
Henrik Grunell
On 2014/08/29 11:42:50, perkj wrote: > lgtm on content/renderer/media. You mean content/browser/renderer_host/media? Did you review ...
6 years, 3 months ago (2014-08-29 11:44:31 UTC) #20
Henrik Grunell
On 2014/08/29 11:44:31, Henrik Grunell wrote: > On 2014/08/29 11:42:50, perkj wrote: > > lgtm ...
6 years, 3 months ago (2014-08-29 13:35:25 UTC) #21
Henrik Grunell
grunell@chromium.org changed reviewers: - sky@chromium.org
6 years, 3 months ago (2014-08-29 13:42:13 UTC) #22
Henrik Grunell
Remaining reviewers, ptal: michaelbai@: android/webview/* tommi@: chrome/browser/media/* jam@: (At least) chrome/browser/chrome_content_browser_client.h/cc content/browser/loader/resource_scheduler_unittest.cc content/browser/renderer_host/render_process_host_impl.cc content/shell/browser/shell_browser_context.cc
6 years, 3 months ago (2014-08-29 13:42:13 UTC) #23
michaelbai
lgtm android_webview
6 years, 3 months ago (2014-08-29 16:06:02 UTC) #24
tommi (sloooow) - chröme
lgtm
6 years, 3 months ago (2014-08-30 13:57:16 UTC) #26
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/grunell@chromium.org/483523006/100001
6 years, 3 months ago (2014-08-30 13:58:11 UTC) #27
commit-bot: I haz the power
FYI, CQ is re-trying this CL (attempt #1). The failing builders are: linux_gpu on tryserver.chromium.gpu ...
6 years, 3 months ago (2014-08-30 14:10:37 UTC) #28
commit-bot: I haz the power
Try jobs failed on following builders: ios_rel_device on tryserver.chromium.mac (http://build.chromium.org/p/tryserver.chromium.mac/builders/ios_rel_device/builds/10671) ios_rel_device_ninja on tryserver.chromium.mac (http://build.chromium.org/p/tryserver.chromium.mac/builders/ios_rel_device_ninja/builds/7251)
6 years, 3 months ago (2014-08-30 14:11:59 UTC) #30
Henrik Grunell
Adding jochen@ as reviewer, please review: chrome/browser/chrome_content_browser_client.h/cc chrome/browser/profiles/profile_io_data.h/cc content/browser/loader/resource_scheduler_unittest.cc content/browser/renderer_host/render_process_host_impl.cc content/shell/browser/shell_browser_context.cc
6 years, 3 months ago (2014-09-01 06:01:46 UTC) #32
Henrik Grunell
On 2014/09/01 06:01:46, Henrik Grunell wrote: > Adding jochen@ as reviewer, please review: > > ...
6 years, 3 months ago (2014-09-01 11:26:55 UTC) #33
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/grunell@chromium.org/483523006/140001
6 years, 3 months ago (2014-09-01 11:27:39 UTC) #35
commit-bot: I haz the power
Committed patchset #8 (id:140001) as b4a527348ab1b0e410f9da29b1a6d886205c9c69
6 years, 3 months ago (2014-09-01 12:30:40 UTC) #36
jam
https://codereview.chromium.org/483523006/diff/140001/content/public/browser/content_browser_client.h File content/public/browser/content_browser_client.h (right): https://codereview.chromium.org/483523006/diff/140001/content/public/browser/content_browser_client.h#newcode645 content/public/browser/content_browser_client.h:645: virtual bool CheckMediaAccessPermission(BrowserContext* browser_context, this should be on BrowserContext, ...
6 years, 3 months ago (2014-09-02 19:56:43 UTC) #37
commit-bot: I haz the power
Patchset 8 (id:??) landed as https://crrev.com/72dc4829a2a5bd7cbf42c956ac9ba6e8e744b004 Cr-Commit-Position: refs/heads/master@{#292868}
6 years, 3 months ago (2014-09-10 03:16:46 UTC) #38
Henrik Grunell
6 years, 2 months ago (2014-10-06 09:01:02 UTC) #39
Message was sent while issue was closed.
On 2014/09/02 19:56:43, jam wrote:
>
https://codereview.chromium.org/483523006/diff/140001/content/public/browser/...
> File content/public/browser/content_browser_client.h (right):
> 
>
https://codereview.chromium.org/483523006/diff/140001/content/public/browser/...
> content/public/browser/content_browser_client.h:645: virtual bool
> CheckMediaAccessPermission(BrowserContext* browser_context,
> this should be on BrowserContext, since it's a method that is
per-BrowserContext
> 
> ContentBrowserClient is a last-resort when a callback from content has no
other
> delegate interface

To close this: The check has been moved to RenderFrameHostDelegate and
WebContentsDelegate in https://codereview.chromium.org/562263002/.

Powered by Google App Engine
This is Rietveld 408576698