Title: [234200] branches/safari-606-branch
Revision
234200
Author
bshaf...@apple.com
Date
2018-07-25 10:00:43 -0700 (Wed, 25 Jul 2018)

Log Message

Cherry-pick r234177. rdar://problem/42586717

    Unreviewed, rolling out r233496 and r233571.

    Likely cause of <rdar://problem/42160890> and
    <rdar://problem/42329658> as ActiveDOMObjects can now be
    constructed / destroyed while we are iterating over them.

    Reverted changesets:

    "Nullptr crash accessing Document in
    GenericEventQueue::dispatchOneEvent()"
    https://bugs.webkit.org/show_bug.cgi?id=187284
    https://trac.webkit.org/changeset/233496

    "REGRESSION(r233496): macOS Sierra hits debug assertions in
    TrackListBase::suspend"
    https://bugs.webkit.org/show_bug.cgi?id=187378
    https://trac.webkit.org/changeset/233571

    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@234177 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Modified Paths

Removed Paths

Diff

Modified: branches/safari-606-branch/LayoutTests/ChangeLog (234199 => 234200)


--- branches/safari-606-branch/LayoutTests/ChangeLog	2018-07-25 16:59:12 UTC (rev 234199)
+++ branches/safari-606-branch/LayoutTests/ChangeLog	2018-07-25 17:00:43 UTC (rev 234200)
@@ -1,3 +1,47 @@
+2018-07-25  Babak Shafiei  <bshaf...@apple.com>
+
+        Cherry-pick r234177. rdar://problem/42586717
+
+    Unreviewed, rolling out r233496 and r233571.
+    
+    Likely cause of <rdar://problem/42160890> and
+    <rdar://problem/42329658> as ActiveDOMObjects can now be
+    constructed / destroyed while we are iterating over them.
+    
+    Reverted changesets:
+    
+    "Nullptr crash accessing Document in
+    GenericEventQueue::dispatchOneEvent()"
+    https://bugs.webkit.org/show_bug.cgi?id=187284
+    https://trac.webkit.org/changeset/233496
+    
+    "REGRESSION(r233496): macOS Sierra hits debug assertions in
+    TrackListBase::suspend"
+    https://bugs.webkit.org/show_bug.cgi?id=187378
+    https://trac.webkit.org/changeset/233571
+    
+    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@234177 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+    2018-07-24  Chris Dumez  <cdu...@apple.com>
+
+            Unreviewed, rolling out r233496 and r233571.
+
+            Likely cause of <rdar://problem/42160890> and
+            <rdar://problem/42329658> as ActiveDOMObjects can now be
+            constructed / destroyed while we are iterating over them.
+
+            Reverted changesets:
+
+            "Nullptr crash accessing Document in
+            GenericEventQueue::dispatchOneEvent()"
+            https://bugs.webkit.org/show_bug.cgi?id=187284
+            https://trac.webkit.org/changeset/233496
+
+            "REGRESSION(r233496): macOS Sierra hits debug assertions in
+            TrackListBase::suspend"
+            https://bugs.webkit.org/show_bug.cgi?id=187378
+            https://trac.webkit.org/changeset/233571
+
 2018-07-23  Babak Shafiei  <bshaf...@apple.com>
 
         Cherry-pick r234073. rdar://problem/42451644

Deleted: branches/safari-606-branch/LayoutTests/media/track/video-track-addition-and-frame-removal-expected.txt (234199 => 234200)


--- branches/safari-606-branch/LayoutTests/media/track/video-track-addition-and-frame-removal-expected.txt	2018-07-25 16:59:12 UTC (rev 234199)
+++ branches/safari-606-branch/LayoutTests/media/track/video-track-addition-and-frame-removal-expected.txt	2018-07-25 17:00:43 UTC (rev 234200)
@@ -1,4 +0,0 @@
-This tests removing a frame immediately after inserting a new track element.
-WebKit should not hit any assertions.
-
-

Deleted: branches/safari-606-branch/LayoutTests/media/track/video-track-addition-and-frame-removal.html (234199 => 234200)


--- branches/safari-606-branch/LayoutTests/media/track/video-track-addition-and-frame-removal.html	2018-07-25 16:59:12 UTC (rev 234199)
+++ branches/safari-606-branch/LayoutTests/media/track/video-track-addition-and-frame-removal.html	2018-07-25 17:00:43 UTC (rev 234200)
@@ -1,29 +0,0 @@
-<!DOCTYPE html>
-<html>
-<body>
-<p>This tests removing a frame immediately after inserting a new track element.<br>
-WebKit should not hit any assertions.</p>
-<script src=""
-<script>
-
-if (window.testRunner)
-    testRunner.waitUntilDone();
-
-function startTest()
-{
-    const doc = frame.contentDocument;
-    const trackElement = doc.createElement('track');
-    doc.querySelector('video').appendChild(trackElement);
-
-    frame.remove();
-    gc();
-    setTimeout(() => {
-        if (window.testRunner)
-            testRunner.notifyDone();        
-    }, 100);
-}
-
-</script>
-<iframe id="frame" src=""
-</body>
-</html>

Modified: branches/safari-606-branch/Source/WebCore/ChangeLog (234199 => 234200)


--- branches/safari-606-branch/Source/WebCore/ChangeLog	2018-07-25 16:59:12 UTC (rev 234199)
+++ branches/safari-606-branch/Source/WebCore/ChangeLog	2018-07-25 17:00:43 UTC (rev 234200)
@@ -1,3 +1,47 @@
+2018-07-25  Babak Shafiei  <bshaf...@apple.com>
+
+        Cherry-pick r234177. rdar://problem/42586717
+
+    Unreviewed, rolling out r233496 and r233571.
+    
+    Likely cause of <rdar://problem/42160890> and
+    <rdar://problem/42329658> as ActiveDOMObjects can now be
+    constructed / destroyed while we are iterating over them.
+    
+    Reverted changesets:
+    
+    "Nullptr crash accessing Document in
+    GenericEventQueue::dispatchOneEvent()"
+    https://bugs.webkit.org/show_bug.cgi?id=187284
+    https://trac.webkit.org/changeset/233496
+    
+    "REGRESSION(r233496): macOS Sierra hits debug assertions in
+    TrackListBase::suspend"
+    https://bugs.webkit.org/show_bug.cgi?id=187378
+    https://trac.webkit.org/changeset/233571
+    
+    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@234177 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+    2018-07-24  Chris Dumez  <cdu...@apple.com>
+
+            Unreviewed, rolling out r233496 and r233571.
+
+            Likely cause of <rdar://problem/42160890> and
+            <rdar://problem/42329658> as ActiveDOMObjects can now be
+            constructed / destroyed while we are iterating over them.
+
+            Reverted changesets:
+
+            "Nullptr crash accessing Document in
+            GenericEventQueue::dispatchOneEvent()"
+            https://bugs.webkit.org/show_bug.cgi?id=187284
+            https://trac.webkit.org/changeset/233496
+
+            "REGRESSION(r233496): macOS Sierra hits debug assertions in
+            TrackListBase::suspend"
+            https://bugs.webkit.org/show_bug.cgi?id=187378
+            https://trac.webkit.org/changeset/233571
+
 2018-07-24  Babak Shafiei  <bshaf...@apple.com>
 
         Cherry-pick r234158. rdar://problem/42551556

Modified: branches/safari-606-branch/Source/WebCore/Modules/encryptedmedia/legacy/WebKitMediaKeySession.cpp (234199 => 234200)


--- branches/safari-606-branch/Source/WebCore/Modules/encryptedmedia/legacy/WebKitMediaKeySession.cpp	2018-07-25 16:59:12 UTC (rev 234199)
+++ branches/safari-606-branch/Source/WebCore/Modules/encryptedmedia/legacy/WebKitMediaKeySession.cpp	2018-07-25 17:00:43 UTC (rev 234200)
@@ -239,19 +239,8 @@
     return (m_keys && m_session) || m_asyncEventQueue.hasPendingEvents();
 }
 
-void WebKitMediaKeySession::suspend(ReasonForSuspension)
-{
-    ASSERT_NOT_REACHED();
-}
-
-void WebKitMediaKeySession::resume()
-{
-    ASSERT_NOT_REACHED();
-}
-
 void WebKitMediaKeySession::stop()
 {
-    m_asyncEventQueue.close();
     close();
 }
 

Modified: branches/safari-606-branch/Source/WebCore/Modules/encryptedmedia/legacy/WebKitMediaKeySession.h (234199 => 234200)


--- branches/safari-606-branch/Source/WebCore/Modules/encryptedmedia/legacy/WebKitMediaKeySession.h	2018-07-25 16:59:12 UTC (rev 234199)
+++ branches/safari-606-branch/Source/WebCore/Modules/encryptedmedia/legacy/WebKitMediaKeySession.h	2018-07-25 17:00:43 UTC (rev 234200)
@@ -76,8 +76,6 @@
     void refEventTarget() final { ref(); }
     void derefEventTarget() final { deref(); }
 
-    void suspend(ReasonForSuspension) final;
-    void resume() final;
     void stop() final;
     bool canSuspendForDocumentSuspension() const final;
     const char* activeDOMObjectName() const final;

Modified: branches/safari-606-branch/Source/WebCore/Modules/mediasource/MediaSource.cpp (234199 => 234200)


--- branches/safari-606-branch/Source/WebCore/Modules/mediasource/MediaSource.cpp	2018-07-25 16:59:12 UTC (rev 234199)
+++ branches/safari-606-branch/Source/WebCore/Modules/mediasource/MediaSource.cpp	2018-07-25 17:00:43 UTC (rev 234200)
@@ -692,127 +692,124 @@
     // 3. If the sourceBuffer.updating attribute equals true, then run the following steps: ...
     buffer.abortIfUpdating();
 
-    ASSERT(scriptExecutionContext());
-    if (!scriptExecutionContext()->activeDOMObjectsAreStopped()) {
-        // 4. Let SourceBuffer audioTracks list equal the AudioTrackList object returned by sourceBuffer.audioTracks.
-        auto& audioTracks = buffer.audioTracks();
+    // 4. Let SourceBuffer audioTracks list equal the AudioTrackList object returned by sourceBuffer.audioTracks.
+    auto& audioTracks = buffer.audioTracks();
 
-        // 5. If the SourceBuffer audioTracks list is not empty, then run the following steps:
-        if (audioTracks.length()) {
-            // 5.1 Let HTMLMediaElement audioTracks list equal the AudioTrackList object returned by the audioTracks
-            // attribute on the HTMLMediaElement.
-            // 5.2 Let the removed enabled audio track flag equal false.
-            bool removedEnabledAudioTrack = false;
+    // 5. If the SourceBuffer audioTracks list is not empty, then run the following steps:
+    if (audioTracks.length()) {
+        // 5.1 Let HTMLMediaElement audioTracks list equal the AudioTrackList object returned by the audioTracks
+        // attribute on the HTMLMediaElement.
+        // 5.2 Let the removed enabled audio track flag equal false.
+        bool removedEnabledAudioTrack = false;
 
-            // 5.3 For each AudioTrack object in the SourceBuffer audioTracks list, run the following steps:
-            while (audioTracks.length()) {
-                auto& track = *audioTracks.lastItem();
+        // 5.3 For each AudioTrack object in the SourceBuffer audioTracks list, run the following steps:
+        while (audioTracks.length()) {
+            auto& track = *audioTracks.lastItem();
 
-                // 5.3.1 Set the sourceBuffer attribute on the AudioTrack object to null.
-                track.setSourceBuffer(nullptr);
+            // 5.3.1 Set the sourceBuffer attribute on the AudioTrack object to null.
+            track.setSourceBuffer(nullptr);
 
-                // 5.3.2 If the enabled attribute on the AudioTrack object is true, then set the removed enabled
-                // audio track flag to true.
-                if (track.enabled())
-                    removedEnabledAudioTrack = true;
+            // 5.3.2 If the enabled attribute on the AudioTrack object is true, then set the removed enabled
+            // audio track flag to true.
+            if (track.enabled())
+                removedEnabledAudioTrack = true;
 
-                // 5.3.3 Remove the AudioTrack object from the HTMLMediaElement audioTracks list.
-                // 5.3.4 Queue a task to fire a trusted event named removetrack, that does not bubble and is not
-                // cancelable, and that uses the TrackEvent interface, at the HTMLMediaElement audioTracks list.
-                if (mediaElement())
-                    mediaElement()->removeAudioTrack(track);
+            // 5.3.3 Remove the AudioTrack object from the HTMLMediaElement audioTracks list.
+            // 5.3.4 Queue a task to fire a trusted event named removetrack, that does not bubble and is not
+            // cancelable, and that uses the TrackEvent interface, at the HTMLMediaElement audioTracks list.
+            if (mediaElement())
+                mediaElement()->removeAudioTrack(track);
 
-                // 5.3.5 Remove the AudioTrack object from the SourceBuffer audioTracks list.
-                // 5.3.6 Queue a task to fire a trusted event named removetrack, that does not bubble and is not
-                // cancelable, and that uses the TrackEvent interface, at the SourceBuffer audioTracks list.
-                audioTracks.remove(track);
-            }
-
-            // 5.4 If the removed enabled audio track flag equals true, then queue a task to fire a simple event
-            // named change at the HTMLMediaElement audioTracks list.
-            if (removedEnabledAudioTrack)
-                mediaElement()->audioTracks().scheduleChangeEvent();
+            // 5.3.5 Remove the AudioTrack object from the SourceBuffer audioTracks list.
+            // 5.3.6 Queue a task to fire a trusted event named removetrack, that does not bubble and is not
+            // cancelable, and that uses the TrackEvent interface, at the SourceBuffer audioTracks list.
+            audioTracks.remove(track);
         }
 
-        // 6. Let SourceBuffer videoTracks list equal the VideoTrackList object returned by sourceBuffer.videoTracks.
-        auto& videoTracks = buffer.videoTracks();
+        // 5.4 If the removed enabled audio track flag equals true, then queue a task to fire a simple event
+        // named change at the HTMLMediaElement audioTracks list.
+        if (removedEnabledAudioTrack)
+            mediaElement()->audioTracks().scheduleChangeEvent();
+    }
 
-        // 7. If the SourceBuffer videoTracks list is not empty, then run the following steps:
-        if (videoTracks.length()) {
-            // 7.1 Let HTMLMediaElement videoTracks list equal the VideoTrackList object returned by the videoTracks
-            // attribute on the HTMLMediaElement.
-            // 7.2 Let the removed selected video track flag equal false.
-            bool removedSelectedVideoTrack = false;
+    // 6. Let SourceBuffer videoTracks list equal the VideoTrackList object returned by sourceBuffer.videoTracks.
+    auto& videoTracks = buffer.videoTracks();
 
-            // 7.3 For each VideoTrack object in the SourceBuffer videoTracks list, run the following steps:
-            while (videoTracks.length()) {
-                auto& track = *videoTracks.lastItem();
+    // 7. If the SourceBuffer videoTracks list is not empty, then run the following steps:
+    if (videoTracks.length()) {
+        // 7.1 Let HTMLMediaElement videoTracks list equal the VideoTrackList object returned by the videoTracks
+        // attribute on the HTMLMediaElement.
+        // 7.2 Let the removed selected video track flag equal false.
+        bool removedSelectedVideoTrack = false;
 
-                // 7.3.1 Set the sourceBuffer attribute on the VideoTrack object to null.
-                track.setSourceBuffer(nullptr);
+        // 7.3 For each VideoTrack object in the SourceBuffer videoTracks list, run the following steps:
+        while (videoTracks.length()) {
+            auto& track = *videoTracks.lastItem();
 
-                // 7.3.2 If the selected attribute on the VideoTrack object is true, then set the removed selected
-                // video track flag to true.
-                if (track.selected())
-                    removedSelectedVideoTrack = true;
+            // 7.3.1 Set the sourceBuffer attribute on the VideoTrack object to null.
+            track.setSourceBuffer(nullptr);
 
-                // 7.3.3 Remove the VideoTrack object from the HTMLMediaElement videoTracks list.
-                // 7.3.4 Queue a task to fire a trusted event named removetrack, that does not bubble and is not
-                // cancelable, and that uses the TrackEvent interface, at the HTMLMediaElement videoTracks list.
-                if (mediaElement())
-                    mediaElement()->removeVideoTrack(track);
+            // 7.3.2 If the selected attribute on the VideoTrack object is true, then set the removed selected
+            // video track flag to true.
+            if (track.selected())
+                removedSelectedVideoTrack = true;
 
-                // 7.3.5 Remove the VideoTrack object from the SourceBuffer videoTracks list.
-                // 7.3.6 Queue a task to fire a trusted event named removetrack, that does not bubble and is not
-                // cancelable, and that uses the TrackEvent interface, at the SourceBuffer videoTracks list.
-                videoTracks.remove(track);
-            }
+            // 7.3.3 Remove the VideoTrack object from the HTMLMediaElement videoTracks list.
+            // 7.3.4 Queue a task to fire a trusted event named removetrack, that does not bubble and is not
+            // cancelable, and that uses the TrackEvent interface, at the HTMLMediaElement videoTracks list.
+            if (mediaElement())
+                mediaElement()->removeVideoTrack(track);
 
-            // 7.4 If the removed selected video track flag equals true, then queue a task to fire a simple event
-            // named change at the HTMLMediaElement videoTracks list.
-            if (removedSelectedVideoTrack)
-                mediaElement()->videoTracks().scheduleChangeEvent();
+            // 7.3.5 Remove the VideoTrack object from the SourceBuffer videoTracks list.
+            // 7.3.6 Queue a task to fire a trusted event named removetrack, that does not bubble and is not
+            // cancelable, and that uses the TrackEvent interface, at the SourceBuffer videoTracks list.
+            videoTracks.remove(track);
         }
 
-        // 8. Let SourceBuffer textTracks list equal the TextTrackList object returned by sourceBuffer.textTracks.
-        auto& textTracks = buffer.textTracks();
+        // 7.4 If the removed selected video track flag equals true, then queue a task to fire a simple event
+        // named change at the HTMLMediaElement videoTracks list.
+        if (removedSelectedVideoTrack)
+            mediaElement()->videoTracks().scheduleChangeEvent();
+    }
 
-        // 9. If the SourceBuffer textTracks list is not empty, then run the following steps:
-        if (textTracks.length()) {
-            // 9.1 Let HTMLMediaElement textTracks list equal the TextTrackList object returned by the textTracks
-            // attribute on the HTMLMediaElement.
-            // 9.2 Let the removed enabled text track flag equal false.
-            bool removedEnabledTextTrack = false;
+    // 8. Let SourceBuffer textTracks list equal the TextTrackList object returned by sourceBuffer.textTracks.
+    auto& textTracks = buffer.textTracks();
 
-            // 9.3 For each TextTrack object in the SourceBuffer textTracks list, run the following steps:
-            while (textTracks.length()) {
-                auto& track = *textTracks.lastItem();
+    // 9. If the SourceBuffer textTracks list is not empty, then run the following steps:
+    if (textTracks.length()) {
+        // 9.1 Let HTMLMediaElement textTracks list equal the TextTrackList object returned by the textTracks
+        // attribute on the HTMLMediaElement.
+        // 9.2 Let the removed enabled text track flag equal false.
+        bool removedEnabledTextTrack = false;
 
-                // 9.3.1 Set the sourceBuffer attribute on the TextTrack object to null.
-                track.setSourceBuffer(nullptr);
+        // 9.3 For each TextTrack object in the SourceBuffer textTracks list, run the following steps:
+        while (textTracks.length()) {
+            auto& track = *textTracks.lastItem();
 
-                // 9.3.2 If the mode attribute on the TextTrack object is set to "showing" or "hidden", then
-                // set the removed enabled text track flag to true.
-                if (track.mode() == TextTrack::Mode::Showing || track.mode() == TextTrack::Mode::Hidden)
-                    removedEnabledTextTrack = true;
+            // 9.3.1 Set the sourceBuffer attribute on the TextTrack object to null.
+            track.setSourceBuffer(nullptr);
 
-                // 9.3.3 Remove the TextTrack object from the HTMLMediaElement textTracks list.
-                // 9.3.4 Queue a task to fire a trusted event named removetrack, that does not bubble and is not
-                // cancelable, and that uses the TrackEvent interface, at the HTMLMediaElement textTracks list.
-                if (mediaElement())
-                    mediaElement()->removeTextTrack(track);
+            // 9.3.2 If the mode attribute on the TextTrack object is set to "showing" or "hidden", then
+            // set the removed enabled text track flag to true.
+            if (track.mode() == TextTrack::Mode::Showing || track.mode() == TextTrack::Mode::Hidden)
+                removedEnabledTextTrack = true;
 
-                // 9.3.5 Remove the TextTrack object from the SourceBuffer textTracks list.
-                // 9.3.6 Queue a task to fire a trusted event named removetrack, that does not bubble and is not
-                // cancelable, and that uses the TrackEvent interface, at the SourceBuffer textTracks list.
-                textTracks.remove(track);
-            }
+            // 9.3.3 Remove the TextTrack object from the HTMLMediaElement textTracks list.
+            // 9.3.4 Queue a task to fire a trusted event named removetrack, that does not bubble and is not
+            // cancelable, and that uses the TrackEvent interface, at the HTMLMediaElement textTracks list.
+            if (mediaElement())
+                mediaElement()->removeTextTrack(track);
 
-            // 9.4 If the removed enabled text track flag equals true, then queue a task to fire a simple event
-            // named change at the HTMLMediaElement textTracks list.
-            if (removedEnabledTextTrack)
-                mediaElement()->textTracks().scheduleChangeEvent();
+            // 9.3.5 Remove the TextTrack object from the SourceBuffer textTracks list.
+            // 9.3.6 Queue a task to fire a trusted event named removetrack, that does not bubble and is not
+            // cancelable, and that uses the TrackEvent interface, at the SourceBuffer textTracks list.
+            textTracks.remove(track);
         }
+
+        // 9.4 If the removed enabled text track flag equals true, then queue a task to fire a simple event
+        // named change at the HTMLMediaElement textTracks list.
+        if (removedEnabledTextTrack)
+            mediaElement()->textTracks().scheduleChangeEvent();
     }
 
     // 10. If sourceBuffer is in activeSourceBuffers, then remove sourceBuffer from activeSourceBuffers ...
@@ -935,25 +932,6 @@
         || ActiveDOMObject::hasPendingActivity();
 }
 
-void MediaSource::suspend(ReasonForSuspension reason)
-{
-    switch (reason) {
-    case ReasonForSuspension::PageCache:
-    case ReasonForSuspension::PageWillBeSuspended:
-        m_asyncEventQueue.suspend();
-        break;
-    case ReasonForSuspension::_javascript_DebuggerPaused:
-    case ReasonForSuspension::WillDeferLoading:
-        // Do nothing, we don't pause media playback in these cases.
-        break;
-    }
-}
-
-void MediaSource::resume()
-{
-    m_asyncEventQueue.resume();
-}
-
 void MediaSource::stop()
 {
     m_asyncEventQueue.close();

Modified: branches/safari-606-branch/Source/WebCore/Modules/mediasource/MediaSource.h (234199 => 234200)


--- branches/safari-606-branch/Source/WebCore/Modules/mediasource/MediaSource.h	2018-07-25 16:59:12 UTC (rev 234199)
+++ branches/safari-606-branch/Source/WebCore/Modules/mediasource/MediaSource.h	2018-07-25 17:00:43 UTC (rev 234200)
@@ -107,8 +107,6 @@
 private:
     explicit MediaSource(ScriptExecutionContext&);
 
-    void suspend(ReasonForSuspension) final;
-    void resume() final;
     void stop() final;
     bool canSuspendForDocumentSuspension() const final;
     const char* activeDOMObjectName() const final;

Modified: branches/safari-606-branch/Source/WebCore/Modules/mediasource/SourceBuffer.cpp (234199 => 234200)


--- branches/safari-606-branch/Source/WebCore/Modules/mediasource/SourceBuffer.cpp	2018-07-25 16:59:12 UTC (rev 234199)
+++ branches/safari-606-branch/Source/WebCore/Modules/mediasource/SourceBuffer.cpp	2018-07-25 17:00:43 UTC (rev 234200)
@@ -458,28 +458,8 @@
     return m_source || m_asyncEventQueue.hasPendingEvents();
 }
 
-void SourceBuffer::suspend(ReasonForSuspension reason)
-{
-    switch (reason) {
-    case ReasonForSuspension::PageCache:
-    case ReasonForSuspension::PageWillBeSuspended:
-        m_asyncEventQueue.suspend();
-        break;
-    case ReasonForSuspension::_javascript_DebuggerPaused:
-    case ReasonForSuspension::WillDeferLoading:
-        // Do nothing, we don't pause media playback in these cases.
-        break;
-    }
-}
-
-void SourceBuffer::resume()
-{
-    m_asyncEventQueue.resume();
-}
-
 void SourceBuffer::stop()
 {
-    m_asyncEventQueue.close();
     m_appendBufferTimer.stop();
     m_removeTimer.stop();
 }

Modified: branches/safari-606-branch/Source/WebCore/Modules/mediasource/SourceBuffer.h (234199 => 234200)


--- branches/safari-606-branch/Source/WebCore/Modules/mediasource/SourceBuffer.h	2018-07-25 16:59:12 UTC (rev 234199)
+++ branches/safari-606-branch/Source/WebCore/Modules/mediasource/SourceBuffer.h	2018-07-25 17:00:43 UTC (rev 234200)
@@ -123,8 +123,6 @@
     void refEventTarget() final { ref(); }
     void derefEventTarget() final { deref(); }
 
-    void suspend(ReasonForSuspension) final;
-    void resume() final;
     void stop() final;
     const char* activeDOMObjectName() const final;
     bool canSuspendForDocumentSuspension() const final;

Modified: branches/safari-606-branch/Source/WebCore/Modules/mediasource/SourceBufferList.cpp (234199 => 234200)


--- branches/safari-606-branch/Source/WebCore/Modules/mediasource/SourceBufferList.cpp	2018-07-25 16:59:12 UTC (rev 234199)
+++ branches/safari-606-branch/Source/WebCore/Modules/mediasource/SourceBufferList.cpp	2018-07-25 17:00:43 UTC (rev 234200)
@@ -40,10 +40,9 @@
 namespace WebCore {
 
 SourceBufferList::SourceBufferList(ScriptExecutionContext* context)
-    : ActiveDOMObject(context)
+    : ContextDestructionObserver(context)
     , m_asyncEventQueue(*this)
 {
-    suspendIfNeeded();
 }
 
 SourceBufferList::~SourceBufferList()
@@ -98,40 +97,7 @@
     m_asyncEventQueue.enqueueEvent(WTFMove(event));
 }
 
-bool SourceBufferList::canSuspendForDocumentSuspension() const
-{
-    return !m_asyncEventQueue.hasPendingEvents();
-}
 
-void SourceBufferList::suspend(ReasonForSuspension reason)
-{
-    switch (reason) {
-    case ReasonForSuspension::PageCache:
-    case ReasonForSuspension::PageWillBeSuspended:
-        m_asyncEventQueue.suspend();
-        break;
-    case ReasonForSuspension::_javascript_DebuggerPaused:
-    case ReasonForSuspension::WillDeferLoading:
-        // Do nothing, we don't pause media playback in these cases.
-        break;
-    }
-}
-
-void SourceBufferList::resume()
-{
-    m_asyncEventQueue.resume();
-}
-
-void SourceBufferList::stop()
-{
-    m_asyncEventQueue.close();
-}
-
-const char* SourceBufferList::activeDOMObjectName() const
-{
-    return "SourceBufferList";
-}
-
 } // namespace WebCore
 
 #endif

Modified: branches/safari-606-branch/Source/WebCore/Modules/mediasource/SourceBufferList.h (234199 => 234200)


--- branches/safari-606-branch/Source/WebCore/Modules/mediasource/SourceBufferList.h	2018-07-25 16:59:12 UTC (rev 234199)
+++ branches/safari-606-branch/Source/WebCore/Modules/mediasource/SourceBufferList.h	2018-07-25 17:00:43 UTC (rev 234200)
@@ -32,7 +32,7 @@
 
 #if ENABLE(MEDIA_SOURCE)
 
-#include "ActiveDOMObject.h"
+#include "ContextDestructionObserver.h"
 #include "EventTarget.h"
 #include "GenericEventQueue.h"
 #include <wtf/RefCounted.h>
@@ -42,7 +42,7 @@
 
 class SourceBuffer;
 
-class SourceBufferList final : public RefCounted<SourceBufferList>, public EventTargetWithInlineData, public ActiveDOMObject {
+class SourceBufferList final : public RefCounted<SourceBufferList>, public EventTargetWithInlineData, public ContextDestructionObserver {
 public:
     static Ref<SourceBufferList> create(ScriptExecutionContext* context)
     {
@@ -77,12 +77,6 @@
     void refEventTarget() override { ref(); }
     void derefEventTarget() override { deref(); }
 
-    bool canSuspendForDocumentSuspension() const final;
-    void suspend(ReasonForSuspension) final;
-    void resume() final;
-    void stop() final;
-    const char* activeDOMObjectName() const final;
-
     GenericEventQueue m_asyncEventQueue;
 
     Vector<RefPtr<SourceBuffer>> m_list;

Modified: branches/safari-606-branch/Source/WebCore/Modules/mediasource/SourceBufferList.idl (234199 => 234200)


--- branches/safari-606-branch/Source/WebCore/Modules/mediasource/SourceBufferList.idl	2018-07-25 16:59:12 UTC (rev 234199)
+++ branches/safari-606-branch/Source/WebCore/Modules/mediasource/SourceBufferList.idl	2018-07-25 17:00:43 UTC (rev 234200)
@@ -29,7 +29,6 @@
  */
  
 [
-    ActiveDOMObject,
     Conditional=MEDIA_SOURCE,
     GenerateIsReachable=Impl,
 ] interface SourceBufferList : EventTarget {

Modified: branches/safari-606-branch/Source/WebCore/dom/Document.h (234199 => 234200)


--- branches/safari-606-branch/Source/WebCore/dom/Document.h	2018-07-25 16:59:12 UTC (rev 234199)
+++ branches/safari-606-branch/Source/WebCore/dom/Document.h	2018-07-25 17:00:43 UTC (rev 234200)
@@ -813,8 +813,6 @@
     // In DOM Level 2, the Document's DOMWindow is called the defaultView.
     WEBCORE_EXPORT WindowProxy* windowProxy() const;
 
-    bool hasBrowsingContext() const { return !!frame(); }
-
     Document& contextDocument() const;
     void setContextDocument(Document& document) { m_contextDocument = makeWeakPtr(document); }
 

Modified: branches/safari-606-branch/Source/WebCore/dom/GenericEventQueue.cpp (234199 => 234200)


--- branches/safari-606-branch/Source/WebCore/dom/GenericEventQueue.cpp	2018-07-25 16:59:12 UTC (rev 234199)
+++ branches/safari-606-branch/Source/WebCore/dom/GenericEventQueue.cpp	2018-07-25 17:00:43 UTC (rev 234200)
@@ -26,10 +26,8 @@
 #include "config.h"
 #include "GenericEventQueue.h"
 
-#include "Document.h"
 #include "Event.h"
 #include "EventTarget.h"
-#include "Node.h"
 #include "ScriptExecutionContext.h"
 #include "Timer.h"
 #include <wtf/MainThread.h>
@@ -67,9 +65,6 @@
     Ref<EventTarget> protect(m_owner);
     RefPtr<Event> event = m_pendingEvents.takeFirst();
     EventTarget& target = event->target() ? *event->target() : m_owner;
-    ASSERT_WITH_MESSAGE(!target.scriptExecutionContext()->activeDOMObjectsAreStopped(),
-        "An attempt to dispatch an event on a stopped target by EventTargetInterface=%d (nodeName=%s target=%p owner=%p)",
-        m_owner.eventTargetInterface(), m_owner.isNode() ? static_cast<Node&>(m_owner).nodeName().ascii().data() : "", &target, &m_owner);
     target.dispatchEvent(*event);
 }
 

Modified: branches/safari-606-branch/Source/WebCore/html/HTMLMediaElement.cpp (234199 => 234200)


--- branches/safari-606-branch/Source/WebCore/html/HTMLMediaElement.cpp	2018-07-25 16:59:12 UTC (rev 234199)
+++ branches/safari-606-branch/Source/WebCore/html/HTMLMediaElement.cpp	2018-07-25 17:00:43 UTC (rev 234200)
@@ -1299,9 +1299,6 @@
     m_loadState = WaitingForSource;
     m_currentSourceNode = nullptr;
 
-    if (!document().hasBrowsingContext())
-        return;
-
     createMediaPlayer();
 
     // 2 - Let pending tasks be a list of all tasks from the media element's media element event task source in one of the task queues.
@@ -1419,6 +1416,7 @@
     // put into the background.
     m_mediaSession->removeBehaviorRestriction(MediaElementSession::RequirePageConsentToLoadMedia);
 
+
     m_resourceSelectionTaskQueue.enqueueTask([this]  {
         // 5. If the media element’s blocked-on-parser flag is false, then populate the list of pending text tracks.
 #if ENABLE(VIDEO_TRACK)
@@ -2895,7 +2893,7 @@
 void HTMLMediaElement::prepareToPlay()
 {
     INFO_LOG(LOGIDENTIFIER);
-    if (m_havePreparedToPlay || !document().hasBrowsingContext())
+    if (m_havePreparedToPlay)
         return;
     m_havePreparedToPlay = true;
     if (m_player)
@@ -3490,11 +3488,6 @@
         return;
     }
 
-    if (!document().hasBrowsingContext()) {
-        INFO_LOG(LOGIDENTIFIER, "  returning because there is no browsing context");
-        return;
-    }
-
     if (!m_mediaSession->clientWillBeginPlayback()) {
         ALWAYS_LOG(LOGIDENTIFIER, "  returning because of interruption");
         return;
@@ -3586,11 +3579,6 @@
         return;
     }
 
-    if (!document().hasBrowsingContext()) {
-        INFO_LOG(LOGIDENTIFIER, "  returning because there is no browsing context");
-        return;
-    }
-
     if (!m_mediaSession->clientWillPausePlayback()) {
         ALWAYS_LOG(LOGIDENTIFIER, "  returning because of interruption");
         return;
@@ -4653,11 +4641,6 @@
         INFO_LOG(LOGIDENTIFIER, "'src' is ", url);
     }
 
-    if (!document().hasBrowsingContext()) {
-        INFO_LOG(LOGIDENTIFIER, "<source> inserted inside a document without a browsing context is not loaded");
-        return;
-    }
-
     // We should only consider a <source> element when there is not src attribute at all.
     if (hasAttributeWithoutSynchronization(srcAttr))
         return;

Modified: branches/safari-606-branch/Source/WebCore/html/track/AudioTrackList.cpp (234199 => 234200)


--- branches/safari-606-branch/Source/WebCore/html/track/AudioTrackList.cpp	2018-07-25 16:59:12 UTC (rev 234199)
+++ branches/safari-606-branch/Source/WebCore/html/track/AudioTrackList.cpp	2018-07-25 17:00:43 UTC (rev 234200)
@@ -81,9 +81,4 @@
     return AudioTrackListEventTargetInterfaceType;
 }
 
-const char* AudioTrackList::activeDOMObjectName() const
-{
-    return "AudioTrackList";
-}
-
 #endif

Modified: branches/safari-606-branch/Source/WebCore/html/track/AudioTrackList.h (234199 => 234200)


--- branches/safari-606-branch/Source/WebCore/html/track/AudioTrackList.h	2018-07-25 16:59:12 UTC (rev 234199)
+++ branches/safari-606-branch/Source/WebCore/html/track/AudioTrackList.h	2018-07-25 17:00:43 UTC (rev 234200)
@@ -52,7 +52,6 @@
 
 private:
     AudioTrackList(HTMLMediaElement*, ScriptExecutionContext*);
-    const char* activeDOMObjectName() const final;
 };
 
 } // namespace WebCore

Modified: branches/safari-606-branch/Source/WebCore/html/track/AudioTrackList.idl (234199 => 234200)


--- branches/safari-606-branch/Source/WebCore/html/track/AudioTrackList.idl	2018-07-25 16:59:12 UTC (rev 234199)
+++ branches/safari-606-branch/Source/WebCore/html/track/AudioTrackList.idl	2018-07-25 17:00:43 UTC (rev 234200)
@@ -24,7 +24,6 @@
  */
 
 [
-    ActiveDOMObject,
     Conditional=VIDEO_TRACK,
     GenerateIsReachable=ImplElementRoot,
     JSCustomMarkFunction,

Modified: branches/safari-606-branch/Source/WebCore/html/track/TextTrackList.cpp (234199 => 234200)


--- branches/safari-606-branch/Source/WebCore/html/track/TextTrackList.cpp	2018-07-25 16:59:12 UTC (rev 234199)
+++ branches/safari-606-branch/Source/WebCore/html/track/TextTrackList.cpp	2018-07-25 17:00:43 UTC (rev 234200)
@@ -265,9 +265,4 @@
     return TextTrackListEventTargetInterfaceType;
 }
 
-const char* TextTrackList::activeDOMObjectName() const
-{
-    return "TextTrackList";
-}
-
 #endif

Modified: branches/safari-606-branch/Source/WebCore/html/track/TextTrackList.h (234199 => 234200)


--- branches/safari-606-branch/Source/WebCore/html/track/TextTrackList.h	2018-07-25 16:59:12 UTC (rev 234199)
+++ branches/safari-606-branch/Source/WebCore/html/track/TextTrackList.h	2018-07-25 17:00:43 UTC (rev 234200)
@@ -62,7 +62,6 @@
     TextTrackList(HTMLMediaElement*, ScriptExecutionContext*);
 
     void invalidateTrackIndexesAfterTrack(TextTrack&);
-    const char* activeDOMObjectName() const final;
 
     Vector<RefPtr<TrackBase>> m_addTrackTracks;
     Vector<RefPtr<TrackBase>> m_elementTracks;

Modified: branches/safari-606-branch/Source/WebCore/html/track/TextTrackList.idl (234199 => 234200)


--- branches/safari-606-branch/Source/WebCore/html/track/TextTrackList.idl	2018-07-25 16:59:12 UTC (rev 234199)
+++ branches/safari-606-branch/Source/WebCore/html/track/TextTrackList.idl	2018-07-25 17:00:43 UTC (rev 234200)
@@ -24,7 +24,6 @@
  */
 
 [
-    ActiveDOMObject,
     Conditional=VIDEO_TRACK,
     GenerateIsReachable=ImplElementRoot,
     JSCustomMarkFunction,

Modified: branches/safari-606-branch/Source/WebCore/html/track/TrackListBase.cpp (234199 => 234200)


--- branches/safari-606-branch/Source/WebCore/html/track/TrackListBase.cpp	2018-07-25 16:59:12 UTC (rev 234199)
+++ branches/safari-606-branch/Source/WebCore/html/track/TrackListBase.cpp	2018-07-25 17:00:43 UTC (rev 234200)
@@ -34,15 +34,14 @@
 #include "ScriptExecutionContext.h"
 #include "TrackEvent.h"
 
-namespace WebCore {
+using namespace WebCore;
 
 TrackListBase::TrackListBase(HTMLMediaElement* element, ScriptExecutionContext* context)
-    : ActiveDOMObject(context)
+    : ContextDestructionObserver(context)
     , m_element(element)
     , m_asyncEventQueue(*this)
 {
-    ASSERT(!context || is<Document>(context));
-    suspendIfNeeded();
+    ASSERT(is<Document>(context));
 }
 
 TrackListBase::~TrackListBase()
@@ -175,35 +174,4 @@
     return false;
 }
 
-bool TrackListBase::canSuspendForDocumentSuspension() const
-{
-    return !m_asyncEventQueue.hasPendingEvents();
-}
-
-void TrackListBase::suspend(ReasonForSuspension reason)
-{
-    switch (reason) {
-    case ReasonForSuspension::PageCache:
-    case ReasonForSuspension::PageWillBeSuspended:
-        m_asyncEventQueue.suspend();
-        break;
-    case ReasonForSuspension::_javascript_DebuggerPaused:
-    case ReasonForSuspension::WillDeferLoading:
-        // Do nothing, we don't pause media playback in these cases.
-        break;
-    }
-}
-
-void TrackListBase::resume()
-{
-    m_asyncEventQueue.resume();
-}
-
-void TrackListBase::stop()
-{
-    m_asyncEventQueue.close();
-}
-
-} // namespace WebCore
-
 #endif

Modified: branches/safari-606-branch/Source/WebCore/html/track/TrackListBase.h (234199 => 234200)


--- branches/safari-606-branch/Source/WebCore/html/track/TrackListBase.h	2018-07-25 16:59:12 UTC (rev 234199)
+++ branches/safari-606-branch/Source/WebCore/html/track/TrackListBase.h	2018-07-25 17:00:43 UTC (rev 234200)
@@ -27,7 +27,7 @@
 
 #if ENABLE(VIDEO_TRACK)
 
-#include "ActiveDOMObject.h"
+#include "ContextDestructionObserver.h"
 #include "EventTarget.h"
 #include "GenericEventQueue.h"
 #include <wtf/RefCounted.h>
@@ -39,7 +39,7 @@
 class Element;
 class TrackBase;
 
-class TrackListBase : public RefCounted<TrackListBase>, public EventTargetWithInlineData, public ActiveDOMObject {
+class TrackListBase : public RefCounted<TrackListBase>, public EventTargetWithInlineData, public ContextDestructionObserver {
 public:
     virtual ~TrackListBase();
 
@@ -74,11 +74,6 @@
 private:
     void scheduleTrackEvent(const AtomicString& eventName, Ref<TrackBase>&&);
 
-    bool canSuspendForDocumentSuspension() const final;
-    void suspend(ReasonForSuspension) final;
-    void resume() final;
-    void stop() final;
-
     // EventTarget
     void refEventTarget() final { ref(); }
     void derefEventTarget() final { deref(); }

Modified: branches/safari-606-branch/Source/WebCore/html/track/VideoTrackList.cpp (234199 => 234200)


--- branches/safari-606-branch/Source/WebCore/html/track/VideoTrackList.cpp	2018-07-25 16:59:12 UTC (rev 234199)
+++ branches/safari-606-branch/Source/WebCore/html/track/VideoTrackList.cpp	2018-07-25 17:00:43 UTC (rev 234200)
@@ -94,9 +94,4 @@
     return VideoTrackListEventTargetInterfaceType;
 }
 
-const char* VideoTrackList::activeDOMObjectName() const
-{
-    return "VideoTrackList";
-}
-
 #endif

Modified: branches/safari-606-branch/Source/WebCore/html/track/VideoTrackList.h (234199 => 234200)


--- branches/safari-606-branch/Source/WebCore/html/track/VideoTrackList.h	2018-07-25 16:59:12 UTC (rev 234199)
+++ branches/safari-606-branch/Source/WebCore/html/track/VideoTrackList.h	2018-07-25 17:00:43 UTC (rev 234200)
@@ -53,7 +53,6 @@
 
 private:
     VideoTrackList(HTMLMediaElement*, ScriptExecutionContext*);
-    const char* activeDOMObjectName() const final;
 };
 
 } // namespace WebCore

Modified: branches/safari-606-branch/Source/WebCore/html/track/VideoTrackList.idl (234199 => 234200)


--- branches/safari-606-branch/Source/WebCore/html/track/VideoTrackList.idl	2018-07-25 16:59:12 UTC (rev 234199)
+++ branches/safari-606-branch/Source/WebCore/html/track/VideoTrackList.idl	2018-07-25 17:00:43 UTC (rev 234200)
@@ -24,7 +24,6 @@
  */
 
 [
-    ActiveDOMObject,
     Conditional=VIDEO_TRACK,
     GenerateIsReachable=ImplElementRoot,
     JSCustomMarkFunction,
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to