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

Issue 2125143003: Add back RenderFrameHost sanity-check to AudioRendererHost. (Closed)

Created:
4 years, 5 months ago by miu
Modified:
4 years, 5 months ago
Reviewers:
DaleCurtis, o1ka
CC:
chromium-reviews, darin-cc_chromium.org, feature-media-reviews_chromium.org, jam, miu+watch_chromium.org, posciak+watch_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Add back RenderFrameHost sanity-check to AudioRendererHost. A render frame should always provide a valid render frame routing ID whenever creating any audio outputs. There was once a simple DCHECK to confirm a valid routing ID was specified in the CreateStream message; but, this got dropped accidentally at some point. This change adds back the sanity-checking and takes it one step further: Now, the routing ID is validated by using it to do a look-up for a RenderFrameHost instance. Only when the look-up succeeds is stream creation allowed to proceed. This is designed to be a more-robust protection for several critical browser features such as: tab OOM killer, tab audio indicator, tab muting, tab audio capture, etc. Committed: https://crrev.com/b2e49f2820c5696bb52118e1be84fdaf1049d2ed Cr-Commit-Position: refs/heads/master@{#406499}

Patch Set 1 #

Patch Set 2 : Only when DCHECKs are on. #

Total comments: 11

Patch Set 3 : Conditionally compile on DCHECK_IS_ON(). #

Total comments: 4

Patch Set 4 : REBASE #

Patch Set 5 : REBASE again #

Unified diffs Side-by-side diffs Delta from patch set Stats (+132 lines, -16 lines) Patch
M content/browser/renderer_host/media/audio_renderer_host.h View 1 2 3 5 chunks +27 lines, -1 line 0 comments Download
M content/browser/renderer_host/media/audio_renderer_host.cc View 1 2 3 4 chunks +57 lines, -12 lines 0 comments Download
M content/browser/renderer_host/media/audio_renderer_host_unittest.cc View 1 2 5 chunks +48 lines, -3 lines 0 comments Download

Messages

Total messages: 32 (11 generated)
miu
olka: PTAL. Given recent discussion, I'd like to make sure there's a robust check in ...
4 years, 5 months ago (2016-07-07 21:59:42 UTC) #2
DaleCurtis
Do we want this validation in the general case? We're now blocking audio creation on ...
4 years, 5 months ago (2016-07-07 22:03:56 UTC) #4
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2125143003/1
4 years, 5 months ago (2016-07-07 22:30:13 UTC) #6
miu
On 2016/07/07 22:03:56, DaleCurtis wrote: > Do we want this validation in the general case? ...
4 years, 5 months ago (2016-07-07 22:56:10 UTC) #7
DaleCurtis
release build bots run with dchecks enabled last I heard.
4 years, 5 months ago (2016-07-07 23:00:38 UTC) #8
DaleCurtis
Yup, "dcheck_always_on=1" https://build.chromium.org/p/tryserver.chromium.mac/builders/mac_chromium_rel_ng/builds/255730/steps/gclient%20runhooks%20%28with%20patch%29/logs/stdio
4 years, 5 months ago (2016-07-07 23:01:14 UTC) #9
commit-bot: I haz the power
Dry run: Try jobs failed on following builders: linux_chromium_rel_ng on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_rel_ng/builds/258928)
4 years, 5 months ago (2016-07-08 00:11:20 UTC) #11
miu
On 2016/07/07 23:01:14, DaleCurtis wrote: > Yup, "dcheck_always_on=1" > > https://build.chromium.org/p/tryserver.chromium.mac/builders/mac_chromium_rel_ng/builds/255730/steps/gclient%20runhooks%20%28with%20patch%29/logs/stdio So it is! Done ...
4 years, 5 months ago (2016-07-08 00:42:48 UTC) #12
o1ka
https://codereview.chromium.org/2125143003/diff/20001/content/browser/renderer_host/media/audio_renderer_host.cc File content/browser/renderer_host/media/audio_renderer_host.cc (right): https://codereview.chromium.org/2125143003/diff/20001/content/browser/renderer_host/media/audio_renderer_host.cc#newcode554 content/browser/renderer_host/media/audio_renderer_host.cc:554: if (DCHECK_IS_ON()) { #if DCHECK_IS_ON() ? https://codereview.chromium.org/2125143003/diff/20001/content/browser/renderer_host/media/audio_renderer_host.cc#newcode558 content/browser/renderer_host/media/audio_renderer_host.cc:558: validate_render_frame_id_function_, ...
4 years, 5 months ago (2016-07-08 14:09:38 UTC) #13
DaleCurtis
https://codereview.chromium.org/2125143003/diff/20001/content/browser/renderer_host/media/audio_renderer_host.cc File content/browser/renderer_host/media/audio_renderer_host.cc (right): https://codereview.chromium.org/2125143003/diff/20001/content/browser/renderer_host/media/audio_renderer_host.cc#newcode554 content/browser/renderer_host/media/audio_renderer_host.cc:554: if (DCHECK_IS_ON()) { Hmm, I think we want #if ...
4 years, 5 months ago (2016-07-08 18:44:33 UTC) #14
miu
Thanks Dale and Olga for taking a look. I've basically made everything conditionally compile behind ...
4 years, 5 months ago (2016-07-08 21:21:37 UTC) #16
o1ka
https://codereview.chromium.org/2125143003/diff/20001/content/browser/renderer_host/media/audio_renderer_host.cc File content/browser/renderer_host/media/audio_renderer_host.cc (right): https://codereview.chromium.org/2125143003/diff/20001/content/browser/renderer_host/media/audio_renderer_host.cc#newcode558 content/browser/renderer_host/media/audio_renderer_host.cc:558: validate_render_frame_id_function_, render_process_id_, On 2016/07/08 21:21:37, miu wrote: > On ...
4 years, 5 months ago (2016-07-11 10:35:50 UTC) #17
DaleCurtis
lgtm
4 years, 5 months ago (2016-07-11 18:46:46 UTC) #18
o1ka
On 2016/07/11 10:35:50, o1ka wrote: > https://codereview.chromium.org/2125143003/diff/20001/content/browser/renderer_host/media/audio_renderer_host.cc > File content/browser/renderer_host/media/audio_renderer_host.cc (right): > > https://codereview.chromium.org/2125143003/diff/20001/content/browser/renderer_host/media/audio_renderer_host.cc#newcode558 > ...
4 years, 5 months ago (2016-07-13 12:18:21 UTC) #19
miu
Thanks for the code review. Replied to your last round of comments (did not result ...
4 years, 5 months ago (2016-07-14 21:36:12 UTC) #20
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/2125143003/80001
4 years, 5 months ago (2016-07-14 21:37:38 UTC) #23
commit-bot: I haz the power
Try jobs failed on following builders: mac_chromium_rel_ng on master.tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/mac_chromium_rel_ng/builds/260390)
4 years, 5 months ago (2016-07-14 23:03:46 UTC) #25
miu
FYI--Waiting for https://codereview.chromium.org/2168463003/ to land (to disable flaky tests). Then, will retry landing this patch.
4 years, 5 months ago (2016-07-19 23:35:14 UTC) #26
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/2125143003/100001
4 years, 5 months ago (2016-07-20 04:14:54 UTC) #29
commit-bot: I haz the power
Committed patchset #5 (id:100001)
4 years, 5 months ago (2016-07-20 04:57:51 UTC) #30
commit-bot: I haz the power
4 years, 5 months ago (2016-07-20 05:01:01 UTC) #32
Message was sent while issue was closed.
Patchset 5 (id:??) landed as
https://crrev.com/b2e49f2820c5696bb52118e1be84fdaf1049d2ed
Cr-Commit-Position: refs/heads/master@{#406499}

Powered by Google App Engine
This is Rietveld 408576698