New issue
Advanced search Search tips

Issue 626446 link

Starred by 2 users

Issue metadata

Status: Duplicate
Merged: issue 707643
Owner: ----
Closed: Apr 2017
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug



Sign in to add a comment

Replace ASSERT(isGraphOwner()) with DCHECK in WebAudio

Project Member Reported by rtoy@chromium.org, Jul 7 2016

Issue description

There are a few places in WebAudio where we currently cannot replace ASSERT with DCHECK such as

    ASSERT(isGraphOwner())

isGraphOwner() is defined only if ENABLE(ASSERT) is true, so we can't just replace ASSERT with DCHECK.

Perhaps we can just remove the ENABLE(ASSERT) so isGraphOwner is always defined?
 
I think I can solve this issue.
Could you assign this issue to me?
I've replaced ASSERT with DCHECK without ASSERT(isGraphOwner()) first as followed.

https://codereview.chromium.org/2159403002/

In my investigation, RecursiveMutex do not have locked() API anymore.
Hence we can't remove ENABLE(ASSERT) for isGraphOwner() without solving 
RecursiveMutex API issue.


Comment 3 by rtoy@chromium.org, Jul 20 2016

I didn't follow your comment on isGraphOwner and RecursiveMutex.  These ASSERTs are enabled when doing a debug build.
I got compilation error as following when I remove remove ENABLE(ASSERT) for isGraphOwner().

../../third_party/WebKit/Source/modules/webaudio/DeferredTaskHandler.cpp:74:32: error: no member named 'locked' in 'WTF::RecursiveMutex'; did you mean 'lock'?
    return m_contextGraphMutex.locked();

Comment 5 by rtoy@chromium.org, Jul 25 2016

This is strange. These are supposed to be enabled for a debug build and I have no problems building a debug build.  This configuration is tested by the trybots as well.

I just tried this on my linux machine.  Debug builds work fine.
hyungwook.lee@

What platform are you using for the development? OSX works fine with the removal of ENABLE(ASSERT).
I'm using gcc version 4.9.3 (Ubuntu 4.9.3-8ubuntu2~14.04) on Ubuntu 14.04
My first investigation seems wrong, I can see MutexBase has locked() API.

class WTF_EXPORT MutexBase {
    WTF_MAKE_NONCOPYABLE(MutexBase); USING_FAST_MALLOC(MutexBase);
public:
#if ENABLE(ASSERT)
    bool locked() { return m_mutex.m_recursionCount > 0; }
#endif

I'm testing it on release build not debug build.

Comment 9 by rtoy@chromium.org, Jul 26 2016

Status: Started (was: Available)
Ah, that explains it.  I think you should ask on the blink-dev mailing list on whether it's ok to remove the #if ENABLE(ASSERT) there. That should fix the problem.
How is this issue different from the  issue 637509 ? Perhaps we can mark this as a dupe and close?

Comment 11 by rtoy@chromium.org, Aug 23 2016

No,  issue 637509  is for replacing ASSERT with DCHECK, except for the isGraphOwner case, which is what this is about.

Comment 12 by rtoy@chromium.org, Aug 23 2016

Summary: Replace ASSERT(isGraphOwner()) with DCHECK in WebAudio (was: Replace ASSERT with DCHECK in WebAudio)
Better summary.

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

Mergedinto: 707643
Status: Duplicate (was: Started)

Sign in to add a comment