⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 245889 in webkit


Ignore:
Timestamp:
May 30, 2019, 9:49:29 AM (7 years ago)
Author:
jer.noble@apple.com
Message:

ASSERTION FAILED: m_scriptExecutionContext under WebCore::AudioContext::isPlayingAudioDidChange()
https://bugs.webkit.org/show_bug.cgi?id=181597
<rdar://problem/36474088>

Reviewed by Eric Carlson.

Because document() is usually null-checked before using (and we can add null-checks where missing),
there's no good reason to debug-assert that m_scriptExecutionContext is non-null before downcast<>ing
to Document*.

  • Modules/webaudio/AudioContext.cpp:

(WebCore::AudioContext::constructCommon):
(WebCore::AudioContext::stop):
(WebCore::AudioContext::document const):
(WebCore::AudioContext::visibilityStateChanged):
(WebCore::AudioContext::willBeginPlayback):
(WebCore::AudioContext::willPausePlayback):
(WebCore::AudioContext::pageMutedStateDidChange):

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r245887 r245889  
     12019-05-30  Jer Noble  <jer.noble@apple.com>
     2
     3        ASSERTION FAILED: m_scriptExecutionContext under WebCore::AudioContext::isPlayingAudioDidChange()
     4        https://bugs.webkit.org/show_bug.cgi?id=181597
     5        <rdar://problem/36474088>
     6
     7        Reviewed by Eric Carlson.
     8
     9        Because document() is usually null-checked before using (and we can add null-checks where missing),
     10        there's no good reason to debug-assert that m_scriptExecutionContext is non-null before downcast<>ing
     11        to Document*.
     12
     13        * Modules/webaudio/AudioContext.cpp:
     14        (WebCore::AudioContext::constructCommon):
     15        (WebCore::AudioContext::stop):
     16        (WebCore::AudioContext::document const):
     17        (WebCore::AudioContext::visibilityStateChanged):
     18        (WebCore::AudioContext::willBeginPlayback):
     19        (WebCore::AudioContext::willPausePlayback):
     20        (WebCore::AudioContext::pageMutedStateDidChange):
     21
    1222019-05-30  Jer Noble  <jer.noble@apple.com>
    223
  • trunk/Source/WebCore/Modules/webaudio/AudioContext.cpp

    r244899 r245889  
    108108WTF_MAKE_ISO_ALLOCATED_IMPL(AudioContext);
    109109
    110 #define RELEASE_LOG_IF_ALLOWED(fmt, ...) RELEASE_LOG_IF(document()->page() && document()->page()->isAlwaysOnLoggingAllowed(), Media, "%p - AudioContext::" fmt, this, ##__VA_ARGS__)
     110#define RELEASE_LOG_IF_ALLOWED(fmt, ...) RELEASE_LOG_IF(document() && document()->page() && document()->page()->isAlwaysOnLoggingAllowed(), Media, "%p - AudioContext::" fmt, this, ##__VA_ARGS__)
    111111   
    112112bool AudioContext::isSampleRateRangeGood(float sampleRate)
     
    181181    m_listener = AudioListener::create();
    182182
     183    ASSERT(document());
    183184    if (document()->audioPlaybackRequiresUserGesture())
    184185        addBehaviorRestriction(RequireUserGestureForAudioStartRestriction);
     
    330331    m_isStopScheduled = true;
    331332
     333    ASSERT(document());
    332334    document()->updateIsPlayingMedia();
    333335
     
    351353Document* AudioContext::document() const
    352354{
    353     ASSERT(m_scriptExecutionContext);
    354355    return downcast<Document>(m_scriptExecutionContext);
    355356}
     
    383384{
    384385    // Do not suspend if audio is audible.
    385     if (mediaState() == MediaProducer::IsPlayingAudio || m_isStopScheduled)
     386    if (!document() || mediaState() == MediaProducer::IsPlayingAudio || m_isStopScheduled)
    386387        return;
    387388
     
    10841085bool AudioContext::willBeginPlayback()
    10851086{
     1087    if (!document())
     1088        return false;
     1089
    10861090    if (userGestureRequiredForAudioStart()) {
    10871091        if (!processingUserGestureForMedia() && !document()->isCapturing()) {
     
    11101114bool AudioContext::willPausePlayback()
    11111115{
     1116    if (!document())
     1117        return false;
     1118
    11121119    if (userGestureRequiredForAudioStart()) {
    11131120        if (!processingUserGestureForMedia())
     
    11551162void AudioContext::pageMutedStateDidChange()
    11561163{
    1157     if (m_destinationNode && document()->page())
     1164    if (m_destinationNode && document() && document()->page())
    11581165        m_destinationNode->setMuted(document()->page()->isAudioMuted());
    11591166}
Note: See TracChangeset for help on using the changeset viewer.