Changeset 272750 in webkit


Ignore:
Timestamp:
Feb 11, 2021 2:05:29 PM (3 years ago)
Author:
Chris Dumez
Message:

[GPUP] <audio> won't load when URL ends with .php causing some tests to time out
https://bugs.webkit.org/show_bug.cgi?id=221695

Reviewed by Eric Carlson.

Source/WebCore:

No new tests, covered by unskipped layout tests.

  • html/HTMLMediaElement.cpp:

(WebCore::HTMLMediaElement::mediaPlayerEngineUpdated):
(WebCore::HTMLMediaElement::mediaPlayerDidInitializeMediaEngine):
We were calling HTMLMediaElement::audioSourceProvider() in mediaPlayerEngineUpdated() which
happens right after we've constructed the MediaPlayerPrivate but before we've called
load() on the MediaPlayerPrivate. The issue was that calling audioSourceProvider() would
initialize the AudioSourceProvider and end up sending the RemoteMediaPlayerProxy::CreateAudioSourceProvider
IPC to the GPUProcess. RemoteMediaPlayerProxy::createAudioSourceProvider() would return early
because m_player->audioSourceProvider() returns null. The reason m_player->audioSourceProvider()
returns null is because it's MediaPlayerPrivate is still a NullMediaPlayerPrivate, because
MediaPlayer::load() has not been called in the GPUProcess yet. For this reason, I moved the
audioSourceProvider() initialization from mediaPlayerEngineUpdated() to
mediaPlayerDidInitializeMediaEngine(). mediaPlayerDidInitializeMediaEngine() happens right
after we've called MediaPlayerPrivate::load() which will end up calling MediaPlayer::load()
in the GPUProcess.

  • platform/graphics/MediaPlayer.cpp:

(WebCore::MediaPlayer::loadWithNextMediaEngine):
Pass an empty ContentType to MediaPlayerPrivate::load() when we did not have a content type
but guessed one based on the extension. This ends up getting passed to the MediaPlayer
in the GPUProcess and it is important it knows it does not have a content type so that
it can guess one from the extension and try the next media engine if it cannot find one.

LayoutTests:

Unskip tests that are no longer timing out.

  • gpu-process/TestExpectations:
Location:
trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r272749 r272750  
     12021-02-11  Chris Dumez  <cdumez@apple.com>
     2
     3        [GPUP] <audio> won't load when URL ends with .php causing some tests to time out
     4        https://bugs.webkit.org/show_bug.cgi?id=221695
     5
     6        Reviewed by Eric Carlson.
     7
     8        Unskip tests that are no longer timing out.
     9
     10        * gpu-process/TestExpectations:
     11
    1122021-02-11  Aditya Keerthi  <akeerthi@apple.com>
    213
  • trunk/LayoutTests/gpu-process/TestExpectations

    r272682 r272750  
    377377imported/w3c/web-platform-tests/webaudio/the-audio-api/the-destinationnode-interface/destination.html [ Failure ]
    378378imported/w3c/web-platform-tests/webaudio/the-audio-api/the-mediaelementaudiosourcenode-interface/no-cors.https.html [ Failure ]
    379 
    380 # webkit.org/b/221695
    381 http/tests/security/webaudio-render-remote-audio-allowed-crossorigin-redirect.html [ Timeout ]
    382 http/tests/security/webaudio-render-remote-audio-allowed-crossorigin.html [ Timeout ]
    383 http/tests/security/webaudio-render-remote-audio-blocked-no-crossorigin-redirect.html [ Timeout ]
    384 http/tests/security/webaudio-render-remote-audio-blocked-no-crossorigin.html [ Timeout ]
    385379
    386380webgl/1.0.3/conformance/canvas/canvas-test.html [ Failure ]
  • trunk/Source/WebCore/ChangeLog

    r272749 r272750  
     12021-02-11  Chris Dumez  <cdumez@apple.com>
     2
     3        [GPUP] <audio> won't load when URL ends with .php causing some tests to time out
     4        https://bugs.webkit.org/show_bug.cgi?id=221695
     5
     6        Reviewed by Eric Carlson.
     7
     8        No new tests, covered by unskipped layout tests.
     9
     10        * html/HTMLMediaElement.cpp:
     11        (WebCore::HTMLMediaElement::mediaPlayerEngineUpdated):
     12        (WebCore::HTMLMediaElement::mediaPlayerDidInitializeMediaEngine):
     13        We were calling HTMLMediaElement::audioSourceProvider() in mediaPlayerEngineUpdated() which
     14        happens right after we've constructed the MediaPlayerPrivate but before we've called
     15        load() on the MediaPlayerPrivate. The issue was that calling audioSourceProvider() would
     16        initialize the AudioSourceProvider and end up sending the RemoteMediaPlayerProxy::CreateAudioSourceProvider
     17        IPC to the GPUProcess. RemoteMediaPlayerProxy::createAudioSourceProvider() would return early
     18        because m_player->audioSourceProvider() returns null. The reason m_player->audioSourceProvider()
     19        returns null is because it's MediaPlayerPrivate is still a NullMediaPlayerPrivate, because
     20        MediaPlayer::load() has not been called in the GPUProcess yet. For this reason, I moved the
     21        audioSourceProvider() initialization from mediaPlayerEngineUpdated() to
     22        mediaPlayerDidInitializeMediaEngine(). mediaPlayerDidInitializeMediaEngine() happens right
     23        after we've called MediaPlayerPrivate::load() which will end up calling MediaPlayer::load()
     24        in the GPUProcess.
     25
     26        * platform/graphics/MediaPlayer.cpp:
     27        (WebCore::MediaPlayer::loadWithNextMediaEngine):
     28        Pass an empty ContentType to MediaPlayerPrivate::load() when we did not have a content type
     29        but guessed one based on the extension. This ends up getting passed to the MediaPlayer
     30        in the GPUProcess and it is important it knows it does not have a content type so that
     31        it can guess one from the extension and try the next media engine if it cannot find one.
     32
    1332021-02-11  Aditya Keerthi  <akeerthi@apple.com>
    234
  • trunk/Source/WebCore/html/HTMLMediaElement.cpp

    r272748 r272750  
    50455045#endif
    50465046
    5047 #if ENABLE(WEB_AUDIO)
    5048     if (m_audioSourceNode) {
    5049         if (auto* provider = audioSourceProvider())
    5050             provider->setClient(m_audioSourceNode);
    5051     }
    5052 #endif
    5053 
    50545047    m_havePreparedToPlay = false;
    50555048
     
    50715064    ASSERT(isMainThread());
    50725065#if ENABLE(WEB_AUDIO)
    5073     if (m_audioSourceNode)
     5066    if (m_audioSourceNode) {
     5067        if (auto* provider = audioSourceProvider())
     5068            provider->setClient(m_audioSourceNode);
     5069
    50745070        m_audioSourceNode->processLock().unlock();
     5071    }
    50755072#endif
    50765073}
  • trunk/Source/WebCore/platform/graphics/MediaPlayer.cpp

    r272414 r272750  
    578578#if ENABLE(MEDIA_SOURCE)
    579579        if (m_mediaSource)
    580             m_private->load(m_url, m_contentType, m_mediaSource.get());
     580            m_private->load(m_url, m_contentMIMETypeWasInferredFromExtension ? ContentType() : m_contentType, m_mediaSource.get());
    581581        else
    582582#endif
     
    586586        else
    587587#endif
    588         m_private->load(m_url, m_contentType, m_keySystem);
     588        m_private->load(m_url, m_contentMIMETypeWasInferredFromExtension ? ContentType() : m_contentType, m_keySystem);
    589589    } else {
    590590        m_private = makeUnique<NullMediaPlayerPrivate>(this);
Note: See TracChangeset for help on using the changeset viewer.