New issue
Advanced search Search tips

Issue 707643 link

Starred by 3 users

Issue metadata

Status: Verified
Owner:
Closed: Apr 2017
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug

Blocking:
issue 707642



Sign in to add a comment

Replace ASSERT, RELEASE_ASSERT, and ASSERT_NOT_REACHED in modules/webaudio

Project Member Reported by tkent@chromium.org, Apr 3 2017

Issue description

Replace ASSERT, RELEASE_ASSERT, and ASSERT_NOT_REACHED with DCHECK_op, CHECK_op, and NOTREACHED respectively in third_party/WebKit/Source/modules/webaudio.
 

Comment 1 by rtoy@chromium.org, Apr 5 2017

Owner: hongchan@chromium.org
Status: Assigned (was: Untriaged)
Since you're doing the ones in platform/audio, might as well do these too.
Status: Started (was: Assigned)
tkent@

I found ASSERT_NO_EXCEPTION in many places. I believe this is related to DCHECK() and will leave them alone.
tkent@ haraken@

Why does .locked() method is wrapped with DCHECK_IS_ON here?

https://cs.chromium.org/chromium/src/third_party/WebKit/Source/platform/wtf/ThreadingPrimitives.h?q=ThreadingPrimitives.h+package:%5Echromium$&dr=CSs&l=88

If we can lift it off, ASSERT() on DeferredTaskHandler.isGraphOwner() can be simplified.

Comment 5 by tkent@chromium.org, Apr 7 2017

> I found ASSERT_NO_EXCEPTION in many places. I believe this is related to DCHECK() and will leave them alone.

Yes, we don't need to touch ASSERT_NO_EXCEPTION now.

> Why does .locked() method is wrapped with DCHECK_IS_ON here?

Because m_recursionCount is defined only if DCHECK_IS_ON.  It's unnecessary in production.

If we do NOT have ASSERT(!isGraphOwner()) or DCHECK(!isGraphOwner()), we can define isGraphOwner even if !DCHEK_IS_ON, like:

bool DeferredTaskHandler::isGraphOwner() {
#if DCHECK_IS_ON()
  return m_contextGraphMutex.locked();
#else
  return true;
#endif
}

@tkent

Yes, that what rtoy@ and I discussed offline, except that we decided to return false so we can catch when anything bad happens.
Project Member

Comment 7 by bugdroid1@chromium.org, Apr 7 2017

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

commit 5041c078af8f65707d859754396d887d780a7e04
Author: hongchan <hongchan@chromium.org>
Date: Fri Apr 07 18:46:55 2017

Remove DCHECK_IS_ON() condition check around *.isGraphOwner() method

As a first step of ASSERT removal from modules/webaudio, this CL
removes all DCHECK_IS_ON() condition check from isGraphOwner() and put
the check inside of the method.

The method is only used inside of DCHECK() so it must be no-op in the
release build. That is why it returns false, so we can catch the
anomaly when it happens.

BUG= 707643 

Review-Url: https://codereview.chromium.org/2805823003
Cr-Commit-Position: refs/heads/master@{#462940}

[modify] https://crrev.com/5041c078af8f65707d859754396d887d780a7e04/third_party/WebKit/Source/modules/webaudio/AnalyserNode.cpp
[modify] https://crrev.com/5041c078af8f65707d859754396d887d780a7e04/third_party/WebKit/Source/modules/webaudio/BaseAudioContext.h
[modify] https://crrev.com/5041c078af8f65707d859754396d887d780a7e04/third_party/WebKit/Source/modules/webaudio/ConvolverNode.cpp
[modify] https://crrev.com/5041c078af8f65707d859754396d887d780a7e04/third_party/WebKit/Source/modules/webaudio/DeferredTaskHandler.cpp
[modify] https://crrev.com/5041c078af8f65707d859754396d887d780a7e04/third_party/WebKit/Source/modules/webaudio/DeferredTaskHandler.h

Project Member

Comment 8 by bugdroid1@chromium.org, Apr 11 2017

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

commit aab941796e90b42557028feefef8365d493b8651
Author: hongchan <hongchan@chromium.org>
Date: Tue Apr 11 01:19:04 2017

This CL changes ASSERT/ASSERT_NOT_REACHED to DCHECK/NOTREACHED
mechanically, replacing the assertion with a single argument only.

I used the following script:

```
cd ${CHROME_SRC}/third_party/WebKit/Source/modules/webaudio
find . -type f -exec sed -i -E 's:ASSERT_NOT_REACHED:NOTREACHED:g' {} \;
find . -type f -exec sed -i -E 's:(\s)ASSERT\(([^ ]+)\)\;:\1DCHECK\(\2\)\;:g' {} \;
```

With this CL the following script returns 0 result:

```
cd ${CHROME_SRC}/third_party/WebKit/Source/modules/webaudio
grep -rnw . -e 'ASSERT('
```

BUG= 707643 

Review-Url: https://codereview.chromium.org/2809023002
Cr-Commit-Position: refs/heads/master@{#463485}

[modify] https://crrev.com/aab941796e90b42557028feefef8365d493b8651/third_party/WebKit/Source/modules/webaudio/AudioBasicInspectorNode.cpp
[modify] https://crrev.com/aab941796e90b42557028feefef8365d493b8651/third_party/WebKit/Source/modules/webaudio/AudioBasicProcessorHandler.cpp
[modify] https://crrev.com/aab941796e90b42557028feefef8365d493b8651/third_party/WebKit/Source/modules/webaudio/AudioNode.cpp
[modify] https://crrev.com/aab941796e90b42557028feefef8365d493b8651/third_party/WebKit/Source/modules/webaudio/AudioNodeInput.cpp
[modify] https://crrev.com/aab941796e90b42557028feefef8365d493b8651/third_party/WebKit/Source/modules/webaudio/AudioNodeOutput.cpp
[modify] https://crrev.com/aab941796e90b42557028feefef8365d493b8651/third_party/WebKit/Source/modules/webaudio/AudioParam.cpp
[modify] https://crrev.com/aab941796e90b42557028feefef8365d493b8651/third_party/WebKit/Source/modules/webaudio/AudioParamTimeline.cpp
[modify] https://crrev.com/aab941796e90b42557028feefef8365d493b8651/third_party/WebKit/Source/modules/webaudio/AudioSummingJunction.cpp
[modify] https://crrev.com/aab941796e90b42557028feefef8365d493b8651/third_party/WebKit/Source/modules/webaudio/BaseAudioContext.cpp
[modify] https://crrev.com/aab941796e90b42557028feefef8365d493b8651/third_party/WebKit/Source/modules/webaudio/BiquadFilterNode.cpp
[modify] https://crrev.com/aab941796e90b42557028feefef8365d493b8651/third_party/WebKit/Source/modules/webaudio/DeferredTaskHandler.cpp
[modify] https://crrev.com/aab941796e90b42557028feefef8365d493b8651/third_party/WebKit/Source/modules/webaudio/GainNode.cpp
[modify] https://crrev.com/aab941796e90b42557028feefef8365d493b8651/third_party/WebKit/Source/modules/webaudio/OfflineAudioDestinationNode.cpp
[modify] https://crrev.com/aab941796e90b42557028feefef8365d493b8651/third_party/WebKit/Source/modules/webaudio/OscillatorNode.cpp
[modify] https://crrev.com/aab941796e90b42557028feefef8365d493b8651/third_party/WebKit/Source/modules/webaudio/PannerNode.cpp
[modify] https://crrev.com/aab941796e90b42557028feefef8365d493b8651/third_party/WebKit/Source/modules/webaudio/PeriodicWave.cpp
[modify] https://crrev.com/aab941796e90b42557028feefef8365d493b8651/third_party/WebKit/Source/modules/webaudio/WaveShaperDSPKernel.cpp
[modify] https://crrev.com/aab941796e90b42557028feefef8365d493b8651/third_party/WebKit/Source/modules/webaudio/WaveShaperNode.cpp

Status: Verified (was: Started)

Comment 10 by rtoy@chromium.org, Apr 14 2017

 Issue 626446  has been merged into this issue.

Sign in to add a comment