Title: [187025] trunk/Source/WebCore
Revision
187025
Author
adac...@apple.com
Date
2015-07-20 11:05:59 -0700 (Mon, 20 Jul 2015)

Log Message

Fix deadlock between -[AVPlayerItem currentTime] and -[AVPlayer isExternalPlaybackActive]
https://bugs.webkit.org/show_bug.cgi?id=147085
<rdar://problem/21878275>

Reviewed by Jer Noble.

* Modules/webaudio/AudioContext.cpp:
(WebCore::AudioContext::isPlayingAudioDidChange):
Call Document::updateIsPlayingMedia() on the main thread, since we could be on the audio I/O
thread here and the Document::updateIsPlayingMedia() call could block, causing a deadlock.

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (187024 => 187025)


--- trunk/Source/WebCore/ChangeLog	2015-07-20 17:42:01 UTC (rev 187024)
+++ trunk/Source/WebCore/ChangeLog	2015-07-20 18:05:59 UTC (rev 187025)
@@ -1,3 +1,16 @@
+2015-07-18  Ada Chan  <adac...@apple.com>
+
+        Fix deadlock between -[AVPlayerItem currentTime] and -[AVPlayer isExternalPlaybackActive]
+        https://bugs.webkit.org/show_bug.cgi?id=147085
+        <rdar://problem/21878275>
+
+        Reviewed by Jer Noble.
+
+        * Modules/webaudio/AudioContext.cpp:
+        (WebCore::AudioContext::isPlayingAudioDidChange):
+        Call Document::updateIsPlayingMedia() on the main thread, since we could be on the audio I/O
+        thread here and the Document::updateIsPlayingMedia() call could block, causing a deadlock.
+
 2015-07-20  Alex Christensen  <achristen...@webkit.org>
 
         Resurrect CMake build on Windows.

Modified: trunk/Source/WebCore/Modules/webaudio/AudioContext.cpp (187024 => 187025)


--- trunk/Source/WebCore/Modules/webaudio/AudioContext.cpp	2015-07-20 17:42:01 UTC (rev 187024)
+++ trunk/Source/WebCore/Modules/webaudio/AudioContext.cpp	2015-07-20 18:05:59 UTC (rev 187025)
@@ -1069,7 +1069,12 @@
 
 void AudioContext::isPlayingAudioDidChange()
 {
-    document()->updateIsPlayingMedia();
+    // Make sure to call Document::updateIsPlayingMedia() on the main thread, since
+    // we could be on the audio I/O thread here and the call into WebCore could block.
+    RefPtr<AudioContext> strongThis(this);
+    callOnMainThread([strongThis] {
+        strongThis->document()->updateIsPlayingMedia();
+    });
 }
 
 void AudioContext::fireCompletionEvent()
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to