Changeset 244860 in webkit


Ignore:
Timestamp:
May 1, 2019 5:20:38 PM (5 years ago)
Author:
youenn@apple.com
Message:

Add back hasNullReferences() assert in Document::updateIsPlayingMedia
https://bugs.webkit.org/show_bug.cgi?id=197477

Reviewed by Eric Carlson.

AudioContext had a special scriptExecutionContext() getter
that was returning nullptr when AudioContext is stopped.
Instead, make this getter behave as all other scriptExecutionContext() getters
and make sure existing call sites of the getter are fine with the change.

Covered by existing tests.

  • Modules/webaudio/AudioContext.cpp:

(WebCore::AudioContext::AudioContext):
No need to check whether offline since this constructor is for non offline AudioContext.
(WebCore::AudioContext::scriptExecutionContext const):
(WebCore::AudioContext::fireCompletionEvent):

  • dom/Document.cpp:

(WebCore::Document::updateIsPlayingMedia):

Location:
trunk/Source/WebCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r244856 r244860  
     12019-05-01  Youenn Fablet  <youenn@apple.com>
     2
     3        Add back hasNullReferences() assert in Document::updateIsPlayingMedia
     4        https://bugs.webkit.org/show_bug.cgi?id=197477
     5
     6        Reviewed by Eric Carlson.
     7
     8        AudioContext had a special scriptExecutionContext() getter
     9        that was returning nullptr when AudioContext is stopped.
     10        Instead, make this getter behave as all other scriptExecutionContext() getters
     11        and make sure existing call sites of the getter are fine with the change.
     12
     13        Covered by existing tests.
     14
     15        * Modules/webaudio/AudioContext.cpp:
     16        (WebCore::AudioContext::AudioContext):
     17        No need to check whether offline since this constructor is for non offline AudioContext.
     18        (WebCore::AudioContext::scriptExecutionContext const):
     19        (WebCore::AudioContext::fireCompletionEvent):
     20        * dom/Document.cpp:
     21        (WebCore::Document::updateIsPlayingMedia):
     22
    1232019-05-01  Justin Fan  <justin_fan@apple.com>
    224
  • trunk/Source/WebCore/Modules/webaudio/AudioContext.cpp

    r244825 r244860  
    149149    pageMutedStateDidChange();
    150150
    151     if (!isOfflineContext()) {
    152         document.addAudioProducer(*this);
    153         document.registerForVisibilityStateChangedCallbacks(*this);
    154     }
     151    document.addAudioProducer(*this);
     152    document.registerForVisibilityStateChangedCallbacks(*this);
    155153}
    156154
     
    10681066ScriptExecutionContext* AudioContext::scriptExecutionContext() const
    10691067{
    1070     return m_isStopScheduled ? 0 : ActiveDOMObject::scriptExecutionContext();
     1068    return ActiveDOMObject::scriptExecutionContext();
    10711069}
    10721070
     
    11871185
    11881186    // Avoid firing the event if the document has already gone away.
    1189     if (scriptExecutionContext()) {
     1187    if (!m_isStopScheduled) {
    11901188        // Call the offline rendering completion event listener.
    11911189        m_eventQueue->enqueueEvent(OfflineAudioCompletionEvent::create(renderedBuffer));
  • trunk/Source/WebCore/dom/Document.cpp

    r244853 r244860  
    39263926void Document::updateIsPlayingMedia(uint64_t sourceElementID)
    39273927{
     3928    ASSERT(!m_audioProducers.hasNullReferences());
    39283929    MediaProducer::MediaStateFlags state = MediaProducer::IsNotPlaying;
    39293930    for (auto& audioProducer : m_audioProducers)
Note: See TracChangeset for help on using the changeset viewer.