Changeset 234177 in webkit
- Timestamp:
- Jul 24, 2018 4:13:21 PM (6 years ago)
- Location:
- trunk
- Files:
-
- 2 deleted
- 25 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r234173 r234177 1 2018-07-24 Chris Dumez <cdumez@apple.com> 2 3 Unreviewed, rolling out r233496 and r233571. 4 5 Likely cause of <rdar://problem/42160890> and 6 <rdar://problem/42329658> as ActiveDOMObjects can now be 7 constructed / destroyed while we are iterating over them. 8 9 Reverted changesets: 10 11 "Nullptr crash accessing Document in 12 GenericEventQueue::dispatchOneEvent()" 13 https://bugs.webkit.org/show_bug.cgi?id=187284 14 https://trac.webkit.org/changeset/233496 15 16 "REGRESSION(r233496): macOS Sierra hits debug assertions in 17 TrackListBase::suspend" 18 https://bugs.webkit.org/show_bug.cgi?id=187378 19 https://trac.webkit.org/changeset/233571 20 1 21 2018-07-24 Thibault Saunier <tsaunier@igalia.com> 2 22 -
trunk/Source/WebCore/ChangeLog
r234172 r234177 1 2018-07-24 Chris Dumez <cdumez@apple.com> 2 3 Unreviewed, rolling out r233496 and r233571. 4 5 Likely cause of <rdar://problem/42160890> and 6 <rdar://problem/42329658> as ActiveDOMObjects can now be 7 constructed / destroyed while we are iterating over them. 8 9 Reverted changesets: 10 11 "Nullptr crash accessing Document in 12 GenericEventQueue::dispatchOneEvent()" 13 https://bugs.webkit.org/show_bug.cgi?id=187284 14 https://trac.webkit.org/changeset/233496 15 16 "REGRESSION(r233496): macOS Sierra hits debug assertions in 17 TrackListBase::suspend" 18 https://bugs.webkit.org/show_bug.cgi?id=187378 19 https://trac.webkit.org/changeset/233571 20 1 21 2018-07-24 Aditya Keerthi <akeerthi@apple.com> 2 22 -
trunk/Source/WebCore/Modules/encryptedmedia/legacy/WebKitMediaKeySession.cpp
r233496 r234177 240 240 } 241 241 242 void WebKitMediaKeySession::suspend(ReasonForSuspension)243 {244 ASSERT_NOT_REACHED();245 }246 247 void WebKitMediaKeySession::resume()248 {249 ASSERT_NOT_REACHED();250 }251 252 242 void WebKitMediaKeySession::stop() 253 243 { 254 m_asyncEventQueue.close();255 244 close(); 256 245 } -
trunk/Source/WebCore/Modules/encryptedmedia/legacy/WebKitMediaKeySession.h
r233496 r234177 77 77 void derefEventTarget() final { deref(); } 78 78 79 void suspend(ReasonForSuspension) final;80 void resume() final;81 79 void stop() final; 82 80 bool canSuspendForDocumentSuspension() const final; -
trunk/Source/WebCore/Modules/mediasource/MediaSource.cpp
r233571 r234177 693 693 buffer.abortIfUpdating(); 694 694 695 ASSERT(scriptExecutionContext()); 696 if (!scriptExecutionContext()->activeDOMObjectsAreStopped()) { 697 // 4. Let SourceBuffer audioTracks list equal the AudioTrackList object returned by sourceBuffer.audioTracks. 698 auto& audioTracks = buffer.audioTracks(); 699 700 // 5. If the SourceBuffer audioTracks list is not empty, then run the following steps: 701 if (audioTracks.length()) { 702 // 5.1 Let HTMLMediaElement audioTracks list equal the AudioTrackList object returned by the audioTracks 703 // attribute on the HTMLMediaElement. 704 // 5.2 Let the removed enabled audio track flag equal false. 705 bool removedEnabledAudioTrack = false; 706 707 // 5.3 For each AudioTrack object in the SourceBuffer audioTracks list, run the following steps: 708 while (audioTracks.length()) { 709 auto& track = *audioTracks.lastItem(); 710 711 // 5.3.1 Set the sourceBuffer attribute on the AudioTrack object to null. 712 track.setSourceBuffer(nullptr); 713 714 // 5.3.2 If the enabled attribute on the AudioTrack object is true, then set the removed enabled 715 // audio track flag to true. 716 if (track.enabled()) 717 removedEnabledAudioTrack = true; 718 719 // 5.3.3 Remove the AudioTrack object from the HTMLMediaElement audioTracks list. 720 // 5.3.4 Queue a task to fire a trusted event named removetrack, that does not bubble and is not 721 // cancelable, and that uses the TrackEvent interface, at the HTMLMediaElement audioTracks list. 722 if (mediaElement()) 723 mediaElement()->removeAudioTrack(track); 724 725 // 5.3.5 Remove the AudioTrack object from the SourceBuffer audioTracks list. 726 // 5.3.6 Queue a task to fire a trusted event named removetrack, that does not bubble and is not 727 // cancelable, and that uses the TrackEvent interface, at the SourceBuffer audioTracks list. 728 audioTracks.remove(track); 729 } 730 731 // 5.4 If the removed enabled audio track flag equals true, then queue a task to fire a simple event 732 // named change at the HTMLMediaElement audioTracks list. 733 if (removedEnabledAudioTrack) 734 mediaElement()->audioTracks().scheduleChangeEvent(); 695 // 4. Let SourceBuffer audioTracks list equal the AudioTrackList object returned by sourceBuffer.audioTracks. 696 auto& audioTracks = buffer.audioTracks(); 697 698 // 5. If the SourceBuffer audioTracks list is not empty, then run the following steps: 699 if (audioTracks.length()) { 700 // 5.1 Let HTMLMediaElement audioTracks list equal the AudioTrackList object returned by the audioTracks 701 // attribute on the HTMLMediaElement. 702 // 5.2 Let the removed enabled audio track flag equal false. 703 bool removedEnabledAudioTrack = false; 704 705 // 5.3 For each AudioTrack object in the SourceBuffer audioTracks list, run the following steps: 706 while (audioTracks.length()) { 707 auto& track = *audioTracks.lastItem(); 708 709 // 5.3.1 Set the sourceBuffer attribute on the AudioTrack object to null. 710 track.setSourceBuffer(nullptr); 711 712 // 5.3.2 If the enabled attribute on the AudioTrack object is true, then set the removed enabled 713 // audio track flag to true. 714 if (track.enabled()) 715 removedEnabledAudioTrack = true; 716 717 // 5.3.3 Remove the AudioTrack object from the HTMLMediaElement audioTracks list. 718 // 5.3.4 Queue a task to fire a trusted event named removetrack, that does not bubble and is not 719 // cancelable, and that uses the TrackEvent interface, at the HTMLMediaElement audioTracks list. 720 if (mediaElement()) 721 mediaElement()->removeAudioTrack(track); 722 723 // 5.3.5 Remove the AudioTrack object from the SourceBuffer audioTracks list. 724 // 5.3.6 Queue a task to fire a trusted event named removetrack, that does not bubble and is not 725 // cancelable, and that uses the TrackEvent interface, at the SourceBuffer audioTracks list. 726 audioTracks.remove(track); 735 727 } 736 728 737 // 6. Let SourceBuffer videoTracks list equal the VideoTrackList object returned by sourceBuffer.videoTracks.738 auto& videoTracks = buffer.videoTracks();739 740 // 7. If the SourceBuffer videoTracks list is not empty, then run the following steps:741 if (videoTracks.length()) {742 // 7.1 Let HTMLMediaElement videoTracks list equal the VideoTrackList object returned by the videoTracks 743 // attribute on the HTMLMediaElement.744 // 7.2 Let the removed selected video track flag equal false.745 bool removedSelectedVideoTrack = false; 746 747 // 7.3 For each VideoTrack object in the SourceBuffer videoTracks list, run the following steps:748 while (videoTracks.length()) {749 auto& track = *videoTracks.lastItem();750 751 // 7.3.1 Set the sourceBuffer attribute on the VideoTrack object to null.752 track.setSourceBuffer(nullptr); 753 754 // 7.3.2 If the selected attribute on the VideoTrack object is true, then set the removed selected755 // video track flag to true.756 if (track.selected()) 757 removedSelectedVideoTrack = true;758 759 // 7.3.3 Remove the VideoTrack object from the HTMLMediaElement videoTracks list. 760 // 7.3.4 Queue a task to fire a trusted event named removetrack, that does not bubble and is not761 // cancelable, and that uses the TrackEvent interface, at the HTMLMediaElement videoTracks list.762 if (mediaElement())763 mediaElement()->removeVideoTrack(track);764 765 // 7.3.5 Remove the VideoTrack object from the SourceBuffervideoTracks list.766 // 7.3.6Queue a task to fire a trusted event named removetrack, that does not bubble and is not767 // cancelable, and that uses the TrackEvent interface, at the SourceBuffervideoTracks list.768 videoTracks.remove(track);769 }770 771 // 7. 4 If the removed selected video track flag equals true, then queue a task to fire a simple event772 // named change at the HTMLMediaElement videoTracks list.773 if (removedSelectedVideoTrack)774 mediaElement()->videoTracks().scheduleChangeEvent();729 // 5.4 If the removed enabled audio track flag equals true, then queue a task to fire a simple event 730 // named change at the HTMLMediaElement audioTracks list. 731 if (removedEnabledAudioTrack) 732 mediaElement()->audioTracks().scheduleChangeEvent(); 733 } 734 735 // 6. Let SourceBuffer videoTracks list equal the VideoTrackList object returned by sourceBuffer.videoTracks. 736 auto& videoTracks = buffer.videoTracks(); 737 738 // 7. If the SourceBuffer videoTracks list is not empty, then run the following steps: 739 if (videoTracks.length()) { 740 // 7.1 Let HTMLMediaElement videoTracks list equal the VideoTrackList object returned by the videoTracks 741 // attribute on the HTMLMediaElement. 742 // 7.2 Let the removed selected video track flag equal false. 743 bool removedSelectedVideoTrack = false; 744 745 // 7.3 For each VideoTrack object in the SourceBuffer videoTracks list, run the following steps: 746 while (videoTracks.length()) { 747 auto& track = *videoTracks.lastItem(); 748 749 // 7.3.1 Set the sourceBuffer attribute on the VideoTrack object to null. 750 track.setSourceBuffer(nullptr); 751 752 // 7.3.2 If the selected attribute on the VideoTrack object is true, then set the removed selected 753 // video track flag to true. 754 if (track.selected()) 755 removedSelectedVideoTrack = true; 756 757 // 7.3.3 Remove the VideoTrack object from the HTMLMediaElement videoTracks list. 758 // 7.3.4 Queue a task to fire a trusted event named removetrack, that does not bubble and is not 759 // cancelable, and that uses the TrackEvent interface, at the HTMLMediaElement videoTracks list. 760 if (mediaElement()) 761 mediaElement()->removeVideoTrack(track); 762 763 // 7.3.5 Remove the VideoTrack object from the SourceBuffer videoTracks list. 764 // 7.3.6 Queue a task to fire a trusted event named removetrack, that does not bubble and is not 765 // cancelable, and that uses the TrackEvent interface, at the SourceBuffer videoTracks list. 766 videoTracks.remove(track); 775 767 } 776 768 777 // 8. Let SourceBuffer textTracks list equal the TextTrackList object returned by sourceBuffer.textTracks.778 auto& textTracks = buffer.textTracks();779 780 // 9. If the SourceBuffer textTracks list is not empty, then run the following steps:781 if (textTracks.length()) {782 // 9.1 Let HTMLMediaElement textTracks list equal the TextTrackList object returned by the textTracks 783 // attribute on the HTMLMediaElement.784 // 9.2 Let the removed enabled text track flag equal false.785 bool removedEnabledTextTrack = false; 786 787 // 9.3 For each TextTrack object in the SourceBuffer textTracks list, run the following steps:788 while (textTracks.length()) {789 auto& track = *textTracks.lastItem();790 791 // 9.3.1 Set the sourceBuffer attribute on the TextTrack object to null.792 track.setSourceBuffer(nullptr); 793 794 // 9.3.2 If the mode attribute on the TextTrack object is set to "showing" or "hidden", then795 // set the removed enabled text track flag to true.796 if (track.mode() == TextTrack::Mode::Showing || track.mode() == TextTrack::Mode::Hidden) 797 removedEnabledTextTrack = true;798 799 // 9.3.3 Remove the TextTrack object from the HTMLMediaElement textTracks list. 800 // 9.3.4 Queue a task to fire a trusted event named removetrack, that does not bubble and is not801 // cancelable, and that uses the TrackEvent interface, at the HTMLMediaElement textTracks list.802 if (mediaElement())803 mediaElement()->removeTextTrack(track);804 805 // 9.3.5 Remove the TextTrack object from the SourceBuffertextTracks list.806 // 9.3.6Queue a task to fire a trusted event named removetrack, that does not bubble and is not807 // cancelable, and that uses the TrackEvent interface, at the SourceBuffertextTracks list.808 textTracks.remove(track);809 }810 811 // 9. 4 If the removed enabled text track flag equals true, then queue a task to fire a simple event812 // named change at the HTMLMediaElement textTracks list.813 if (removedEnabledTextTrack)814 mediaElement()->textTracks().scheduleChangeEvent();769 // 7.4 If the removed selected video track flag equals true, then queue a task to fire a simple event 770 // named change at the HTMLMediaElement videoTracks list. 771 if (removedSelectedVideoTrack) 772 mediaElement()->videoTracks().scheduleChangeEvent(); 773 } 774 775 // 8. Let SourceBuffer textTracks list equal the TextTrackList object returned by sourceBuffer.textTracks. 776 auto& textTracks = buffer.textTracks(); 777 778 // 9. If the SourceBuffer textTracks list is not empty, then run the following steps: 779 if (textTracks.length()) { 780 // 9.1 Let HTMLMediaElement textTracks list equal the TextTrackList object returned by the textTracks 781 // attribute on the HTMLMediaElement. 782 // 9.2 Let the removed enabled text track flag equal false. 783 bool removedEnabledTextTrack = false; 784 785 // 9.3 For each TextTrack object in the SourceBuffer textTracks list, run the following steps: 786 while (textTracks.length()) { 787 auto& track = *textTracks.lastItem(); 788 789 // 9.3.1 Set the sourceBuffer attribute on the TextTrack object to null. 790 track.setSourceBuffer(nullptr); 791 792 // 9.3.2 If the mode attribute on the TextTrack object is set to "showing" or "hidden", then 793 // set the removed enabled text track flag to true. 794 if (track.mode() == TextTrack::Mode::Showing || track.mode() == TextTrack::Mode::Hidden) 795 removedEnabledTextTrack = true; 796 797 // 9.3.3 Remove the TextTrack object from the HTMLMediaElement textTracks list. 798 // 9.3.4 Queue a task to fire a trusted event named removetrack, that does not bubble and is not 799 // cancelable, and that uses the TrackEvent interface, at the HTMLMediaElement textTracks list. 800 if (mediaElement()) 801 mediaElement()->removeTextTrack(track); 802 803 // 9.3.5 Remove the TextTrack object from the SourceBuffer textTracks list. 804 // 9.3.6 Queue a task to fire a trusted event named removetrack, that does not bubble and is not 805 // cancelable, and that uses the TrackEvent interface, at the SourceBuffer textTracks list. 806 textTracks.remove(track); 815 807 } 808 809 // 9.4 If the removed enabled text track flag equals true, then queue a task to fire a simple event 810 // named change at the HTMLMediaElement textTracks list. 811 if (removedEnabledTextTrack) 812 mediaElement()->textTracks().scheduleChangeEvent(); 816 813 } 817 814 … … 934 931 return m_private || m_asyncEventQueue.hasPendingEvents() 935 932 || ActiveDOMObject::hasPendingActivity(); 936 }937 938 void MediaSource::suspend(ReasonForSuspension reason)939 {940 switch (reason) {941 case ReasonForSuspension::PageCache:942 case ReasonForSuspension::PageWillBeSuspended:943 m_asyncEventQueue.suspend();944 break;945 case ReasonForSuspension::JavaScriptDebuggerPaused:946 case ReasonForSuspension::WillDeferLoading:947 // Do nothing, we don't pause media playback in these cases.948 break;949 }950 }951 952 void MediaSource::resume()953 {954 m_asyncEventQueue.resume();955 933 } 956 934 -
trunk/Source/WebCore/Modules/mediasource/MediaSource.h
r233496 r234177 108 108 explicit MediaSource(ScriptExecutionContext&); 109 109 110 void suspend(ReasonForSuspension) final;111 void resume() final;112 110 void stop() final; 113 111 bool canSuspendForDocumentSuspension() const final; -
trunk/Source/WebCore/Modules/mediasource/SourceBuffer.cpp
r233571 r234177 459 459 } 460 460 461 void SourceBuffer::suspend(ReasonForSuspension reason)462 {463 switch (reason) {464 case ReasonForSuspension::PageCache:465 case ReasonForSuspension::PageWillBeSuspended:466 m_asyncEventQueue.suspend();467 break;468 case ReasonForSuspension::JavaScriptDebuggerPaused:469 case ReasonForSuspension::WillDeferLoading:470 // Do nothing, we don't pause media playback in these cases.471 break;472 }473 }474 475 void SourceBuffer::resume()476 {477 m_asyncEventQueue.resume();478 }479 480 461 void SourceBuffer::stop() 481 462 { 482 m_asyncEventQueue.close();483 463 m_appendBufferTimer.stop(); 484 464 m_removeTimer.stop(); -
trunk/Source/WebCore/Modules/mediasource/SourceBuffer.h
r233496 r234177 124 124 void derefEventTarget() final { deref(); } 125 125 126 void suspend(ReasonForSuspension) final;127 void resume() final;128 126 void stop() final; 129 127 const char* activeDOMObjectName() const final; -
trunk/Source/WebCore/Modules/mediasource/SourceBufferList.cpp
r233571 r234177 41 41 42 42 SourceBufferList::SourceBufferList(ScriptExecutionContext* context) 43 : ActiveDOMObject(context)43 : ContextDestructionObserver(context) 44 44 , m_asyncEventQueue(*this) 45 45 { 46 suspendIfNeeded();47 46 } 48 47 … … 99 98 } 100 99 101 bool SourceBufferList::canSuspendForDocumentSuspension() const102 {103 return !m_asyncEventQueue.hasPendingEvents();104 }105 106 void SourceBufferList::suspend(ReasonForSuspension reason)107 {108 switch (reason) {109 case ReasonForSuspension::PageCache:110 case ReasonForSuspension::PageWillBeSuspended:111 m_asyncEventQueue.suspend();112 break;113 case ReasonForSuspension::JavaScriptDebuggerPaused:114 case ReasonForSuspension::WillDeferLoading:115 // Do nothing, we don't pause media playback in these cases.116 break;117 }118 }119 120 void SourceBufferList::resume()121 {122 m_asyncEventQueue.resume();123 }124 125 void SourceBufferList::stop()126 {127 m_asyncEventQueue.close();128 }129 130 const char* SourceBufferList::activeDOMObjectName() const131 {132 return "SourceBufferList";133 }134 100 135 101 } // namespace WebCore -
trunk/Source/WebCore/Modules/mediasource/SourceBufferList.h
r233496 r234177 33 33 #if ENABLE(MEDIA_SOURCE) 34 34 35 #include " ActiveDOMObject.h"35 #include "ContextDestructionObserver.h" 36 36 #include "EventTarget.h" 37 37 #include "GenericEventQueue.h" … … 43 43 class SourceBuffer; 44 44 45 class SourceBufferList final : public RefCounted<SourceBufferList>, public EventTargetWithInlineData, public ActiveDOMObject{45 class SourceBufferList final : public RefCounted<SourceBufferList>, public EventTargetWithInlineData, public ContextDestructionObserver { 46 46 public: 47 47 static Ref<SourceBufferList> create(ScriptExecutionContext* context) … … 78 78 void derefEventTarget() override { deref(); } 79 79 80 bool canSuspendForDocumentSuspension() const final;81 void suspend(ReasonForSuspension) final;82 void resume() final;83 void stop() final;84 const char* activeDOMObjectName() const final;85 86 80 GenericEventQueue m_asyncEventQueue; 87 81 -
trunk/Source/WebCore/Modules/mediasource/SourceBufferList.idl
r233496 r234177 30 30 31 31 [ 32 ActiveDOMObject,33 32 Conditional=MEDIA_SOURCE, 34 33 GenerateIsReachable=Impl, -
trunk/Source/WebCore/dom/Document.h
r234148 r234177 814 814 WEBCORE_EXPORT WindowProxy* windowProxy() const; 815 815 816 bool hasBrowsingContext() const { return !!frame(); }817 818 816 Document& contextDocument() const; 819 817 void setContextDocument(Document& document) { m_contextDocument = makeWeakPtr(document); } -
trunk/Source/WebCore/dom/GenericEventQueue.cpp
r233496 r234177 27 27 #include "GenericEventQueue.h" 28 28 29 #include "Document.h"30 29 #include "Event.h" 31 30 #include "EventTarget.h" 32 #include "Node.h"33 31 #include "ScriptExecutionContext.h" 34 32 #include "Timer.h" … … 68 66 RefPtr<Event> event = m_pendingEvents.takeFirst(); 69 67 EventTarget& target = event->target() ? *event->target() : m_owner; 70 ASSERT_WITH_MESSAGE(!target.scriptExecutionContext()->activeDOMObjectsAreStopped(),71 "An attempt to dispatch an event on a stopped target by EventTargetInterface=%d (nodeName=%s target=%p owner=%p)",72 m_owner.eventTargetInterface(), m_owner.isNode() ? static_cast<Node&>(m_owner).nodeName().ascii().data() : "", &target, &m_owner);73 68 target.dispatchEvent(*event); 74 69 } -
trunk/Source/WebCore/html/HTMLMediaElement.cpp
r234002 r234177 1300 1300 m_currentSourceNode = nullptr; 1301 1301 1302 if (!document().hasBrowsingContext())1303 return;1304 1305 1302 createMediaPlayer(); 1306 1303 … … 1419 1416 // put into the background. 1420 1417 m_mediaSession->removeBehaviorRestriction(MediaElementSession::RequirePageConsentToLoadMedia); 1418 1421 1419 1422 1420 m_resourceSelectionTaskQueue.enqueueTask([this] { … … 2896 2894 { 2897 2895 INFO_LOG(LOGIDENTIFIER); 2898 if (m_havePreparedToPlay || !document().hasBrowsingContext())2896 if (m_havePreparedToPlay) 2899 2897 return; 2900 2898 m_havePreparedToPlay = true; … … 3488 3486 if (isSuspended()) { 3489 3487 ALWAYS_LOG(LOGIDENTIFIER, " returning because context is suspended"); 3490 return;3491 }3492 3493 if (!document().hasBrowsingContext()) {3494 INFO_LOG(LOGIDENTIFIER, " returning because there is no browsing context");3495 3488 return; 3496 3489 } … … 3584 3577 if (isSuspended()) { 3585 3578 ALWAYS_LOG(LOGIDENTIFIER, " returning because context is suspended"); 3586 return;3587 }3588 3589 if (!document().hasBrowsingContext()) {3590 INFO_LOG(LOGIDENTIFIER, " returning because there is no browsing context");3591 3579 return; 3592 3580 } … … 4652 4640 URL url = source.getNonEmptyURLAttribute(srcAttr); 4653 4641 INFO_LOG(LOGIDENTIFIER, "'src' is ", url); 4654 }4655 4656 if (!document().hasBrowsingContext()) {4657 INFO_LOG(LOGIDENTIFIER, "<source> inserted inside a document without a browsing context is not loaded");4658 return;4659 4642 } 4660 4643 -
trunk/Source/WebCore/html/track/AudioTrackList.cpp
r233496 r234177 82 82 } 83 83 84 const char* AudioTrackList::activeDOMObjectName() const85 {86 return "AudioTrackList";87 }88 89 84 #endif -
trunk/Source/WebCore/html/track/AudioTrackList.h
r233496 r234177 53 53 private: 54 54 AudioTrackList(HTMLMediaElement*, ScriptExecutionContext*); 55 const char* activeDOMObjectName() const final;56 55 }; 57 56 -
trunk/Source/WebCore/html/track/AudioTrackList.idl
r233496 r234177 25 25 26 26 [ 27 ActiveDOMObject,28 27 Conditional=VIDEO_TRACK, 29 28 GenerateIsReachable=ImplElementRoot, -
trunk/Source/WebCore/html/track/TextTrackList.cpp
r233496 r234177 266 266 } 267 267 268 const char* TextTrackList::activeDOMObjectName() const269 {270 return "TextTrackList";271 }272 273 268 #endif -
trunk/Source/WebCore/html/track/TextTrackList.h
r233496 r234177 63 63 64 64 void invalidateTrackIndexesAfterTrack(TextTrack&); 65 const char* activeDOMObjectName() const final;66 65 67 66 Vector<RefPtr<TrackBase>> m_addTrackTracks; -
trunk/Source/WebCore/html/track/TextTrackList.idl
r233496 r234177 25 25 26 26 [ 27 ActiveDOMObject,28 27 Conditional=VIDEO_TRACK, 29 28 GenerateIsReachable=ImplElementRoot, -
trunk/Source/WebCore/html/track/TrackListBase.cpp
r233571 r234177 35 35 #include "TrackEvent.h" 36 36 37 namespace WebCore { 37 using namespace WebCore; 38 38 39 39 TrackListBase::TrackListBase(HTMLMediaElement* element, ScriptExecutionContext* context) 40 : ActiveDOMObject(context)40 : ContextDestructionObserver(context) 41 41 , m_element(element) 42 42 , m_asyncEventQueue(*this) 43 43 { 44 ASSERT(!context || is<Document>(context)); 45 suspendIfNeeded(); 44 ASSERT(is<Document>(context)); 46 45 } 47 46 … … 176 175 } 177 176 178 bool TrackListBase::canSuspendForDocumentSuspension() const179 {180 return !m_asyncEventQueue.hasPendingEvents();181 }182 183 void TrackListBase::suspend(ReasonForSuspension reason)184 {185 switch (reason) {186 case ReasonForSuspension::PageCache:187 case ReasonForSuspension::PageWillBeSuspended:188 m_asyncEventQueue.suspend();189 break;190 case ReasonForSuspension::JavaScriptDebuggerPaused:191 case ReasonForSuspension::WillDeferLoading:192 // Do nothing, we don't pause media playback in these cases.193 break;194 }195 }196 197 void TrackListBase::resume()198 {199 m_asyncEventQueue.resume();200 }201 202 void TrackListBase::stop()203 {204 m_asyncEventQueue.close();205 }206 207 } // namespace WebCore208 209 177 #endif -
trunk/Source/WebCore/html/track/TrackListBase.h
r233496 r234177 28 28 #if ENABLE(VIDEO_TRACK) 29 29 30 #include " ActiveDOMObject.h"30 #include "ContextDestructionObserver.h" 31 31 #include "EventTarget.h" 32 32 #include "GenericEventQueue.h" … … 40 40 class TrackBase; 41 41 42 class TrackListBase : public RefCounted<TrackListBase>, public EventTargetWithInlineData, public ActiveDOMObject{42 class TrackListBase : public RefCounted<TrackListBase>, public EventTargetWithInlineData, public ContextDestructionObserver { 43 43 public: 44 44 virtual ~TrackListBase(); … … 75 75 void scheduleTrackEvent(const AtomicString& eventName, Ref<TrackBase>&&); 76 76 77 bool canSuspendForDocumentSuspension() const final;78 void suspend(ReasonForSuspension) final;79 void resume() final;80 void stop() final;81 82 77 // EventTarget 83 78 void refEventTarget() final { ref(); } -
trunk/Source/WebCore/html/track/VideoTrackList.cpp
r233496 r234177 95 95 } 96 96 97 const char* VideoTrackList::activeDOMObjectName() const98 {99 return "VideoTrackList";100 }101 102 97 #endif -
trunk/Source/WebCore/html/track/VideoTrackList.h
r233496 r234177 54 54 private: 55 55 VideoTrackList(HTMLMediaElement*, ScriptExecutionContext*); 56 const char* activeDOMObjectName() const final;57 56 }; 58 57 -
trunk/Source/WebCore/html/track/VideoTrackList.idl
r233496 r234177 25 25 26 26 [ 27 ActiveDOMObject,28 27 Conditional=VIDEO_TRACK, 29 28 GenerateIsReachable=ImplElementRoot,
Note: See TracChangeset
for help on using the changeset viewer.