New issue
Advanced search Search tips

Issue 883329 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Sep 20
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug



Sign in to add a comment

Check WebAudio code base to see that Document exists before using it

Project Member Reported by rtoy@chromium.org, Sep 12

Issue description

From https://chromium-review.googlesource.com/c/chromium/src/+/1220688#message-52bea4b097ee6ae227d2e237fd0abe0b46862219 we need to look over the code base and check the document is alive before using it.
 
Cc: mlamouri@chromium.org
Owner: hongchan@chromium.org
Status: Assigned (was: Available)
A quick grep for GetDocument() shows that there are really only a few places where we don't check to see if the result is valid:

probe::didSuspendAudioContext(GetDocument());
probe::didResumeAudioContext(GetDocument());
probe::didCloseAudioContext(GetDocument());

All the remaining uses are related to AutoPlay.  I have no idea if the autoplay methods support a null Document.

So assign to hongchan to look at the probe issue, and have mlamouri look at the autoplay uses.
Owner: ----
Status: Available (was: Assigned)
Methods for probing are a part of JS interface calls. (AudioContext's resume, suspend, close) So there is no way for the document to go away when this call happens.

In other words, there is no cross-thread activity here.
Owner: mlamouri@chromium.org
Status: Assigned (was: Available)
Assigning to mlamouri to take a look if this matters for the autoplay stuff.
Project Member

Comment 4 by bugdroid1@chromium.org, Sep 20

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/724697cd3cc1d5e248e9054fb1896bef878f17f7

commit 724697cd3cc1d5e248e9054fb1896bef878f17f7
Author: Mounir Lamouri <mlamouri@chromium.org>
Date: Thu Sep 20 15:53:01 2018

WebAudio: some checks around GetDocument() calls.

Adding a DCHECK() and a null check.

Bug:  883329 
Change-Id: I56efb844c7cc6788ac04e9f494608ef18e94cd78
Reviewed-on: https://chromium-review.googlesource.com/1236454
Reviewed-by: Hongchan Choi <hongchan@chromium.org>
Commit-Queue: Mounir Lamouri <mlamouri@chromium.org>
Cr-Commit-Position: refs/heads/master@{#592817}
[modify] https://crrev.com/724697cd3cc1d5e248e9054fb1896bef878f17f7/third_party/blink/renderer/modules/webaudio/audio_context.cc

Status: Fixed (was: Assigned)

Sign in to add a comment