Changeset 250935 in webkit
- Timestamp:
- Oct 9, 2019 3:03:29 PM (5 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r250931 r250935 1 2019-10-09 Chris Dumez <cdumez@apple.com> 2 3 Youtube.com is unable to enter the back/forward cache on macOS 4 https://bugs.webkit.org/show_bug.cgi?id=202754 5 <rdar://problem/56117666> 6 7 Reviewed by Eric Carlson. 8 9 Add layout test coverage. 10 11 * media/media-source/media-source-page-cache-expected.txt: Added. 12 * media/media-source/media-source-page-cache.html: Added. 13 1 14 2019-10-09 Truitt Savell <tsavell@apple.com> 2 15 -
trunk/Source/WebCore/ChangeLog
r250930 r250935 1 2019-10-09 Chris Dumez <cdumez@apple.com> 2 3 Youtube.com is unable to enter the back/forward cache on macOS 4 https://bugs.webkit.org/show_bug.cgi?id=202754 5 <rdar://problem/56117666> 6 7 Reviewed by Eric Carlson. 8 9 As of r250542, the MainThreadGenericEventQueue used by both MediaSource and 10 SourceBuffer to fire event is PageCache-aware. As a result, both these 11 ActiveDOMObjects can now safety suspend without risking running script while 12 in the page cache. I did have to update some logic in MediaSource::removeSourceBuffer() 13 to make sure we do not unnecessarily construct new ActiveDOMObjects while 14 suspending, as this is not allowed. 15 16 Test: media/media-source/media-source-page-cache.html 17 18 * Modules/mediasource/MediaSource.cpp: 19 (WebCore::MediaSource::removeSourceBuffer): 20 (WebCore::MediaSource::canSuspendForDocumentSuspension const): 21 * Modules/mediasource/SourceBuffer.cpp: 22 (WebCore::SourceBuffer::canSuspendForDocumentSuspension const): 23 * Modules/mediasource/SourceBuffer.h: 24 1 25 2019-10-09 Daniel Bates <dabates@apple.com> 2 26 -
trunk/Source/WebCore/Modules/mediasource/MediaSource.cpp
r250542 r250935 737 737 if (!scriptExecutionContext()->activeDOMObjectsAreStopped()) { 738 738 // 4. Let SourceBuffer audioTracks list equal the AudioTrackList object returned by sourceBuffer.audioTracks. 739 auto & audioTracks = buffer.audioTracks();739 auto* audioTracks = buffer.audioTracksIfExists(); 740 740 741 741 // 5. If the SourceBuffer audioTracks list is not empty, then run the following steps: 742 if (audioTracks .length()) {742 if (audioTracks && audioTracks->length()) { 743 743 // 5.1 Let HTMLMediaElement audioTracks list equal the AudioTrackList object returned by the audioTracks 744 744 // attribute on the HTMLMediaElement. … … 747 747 748 748 // 5.3 For each AudioTrack object in the SourceBuffer audioTracks list, run the following steps: 749 while (audioTracks .length()) {750 auto& track = *audioTracks .lastItem();749 while (audioTracks->length()) { 750 auto& track = *audioTracks->lastItem(); 751 751 752 752 // 5.3.1 Set the sourceBuffer attribute on the AudioTrack object to null. … … 767 767 // 5.3.6 Queue a task to fire a trusted event named removetrack, that does not bubble and is not 768 768 // cancelable, and that uses the TrackEvent interface, at the SourceBuffer audioTracks list. 769 audioTracks .remove(track);769 audioTracks->remove(track); 770 770 } 771 771 … … 777 777 778 778 // 6. Let SourceBuffer videoTracks list equal the VideoTrackList object returned by sourceBuffer.videoTracks. 779 auto & videoTracks = buffer.videoTracks();779 auto* videoTracks = buffer.videoTracksIfExists(); 780 780 781 781 // 7. If the SourceBuffer videoTracks list is not empty, then run the following steps: 782 if (videoTracks .length()) {782 if (videoTracks && videoTracks->length()) { 783 783 // 7.1 Let HTMLMediaElement videoTracks list equal the VideoTrackList object returned by the videoTracks 784 784 // attribute on the HTMLMediaElement. … … 787 787 788 788 // 7.3 For each VideoTrack object in the SourceBuffer videoTracks list, run the following steps: 789 while (videoTracks .length()) {790 auto& track = *videoTracks .lastItem();789 while (videoTracks->length()) { 790 auto& track = *videoTracks->lastItem(); 791 791 792 792 // 7.3.1 Set the sourceBuffer attribute on the VideoTrack object to null. … … 807 807 // 7.3.6 Queue a task to fire a trusted event named removetrack, that does not bubble and is not 808 808 // cancelable, and that uses the TrackEvent interface, at the SourceBuffer videoTracks list. 809 videoTracks .remove(track);809 videoTracks->remove(track); 810 810 } 811 811 … … 817 817 818 818 // 8. Let SourceBuffer textTracks list equal the TextTrackList object returned by sourceBuffer.textTracks. 819 auto & textTracks = buffer.textTracks();819 auto* textTracks = buffer.textTracksIfExists(); 820 820 821 821 // 9. If the SourceBuffer textTracks list is not empty, then run the following steps: 822 if (textTracks .length()) {822 if (textTracks && textTracks->length()) { 823 823 // 9.1 Let HTMLMediaElement textTracks list equal the TextTrackList object returned by the textTracks 824 824 // attribute on the HTMLMediaElement. … … 827 827 828 828 // 9.3 For each TextTrack object in the SourceBuffer textTracks list, run the following steps: 829 while (textTracks .length()) {830 auto& track = *textTracks .lastItem();829 while (textTracks->length()) { 830 auto& track = *textTracks->lastItem(); 831 831 832 832 // 9.3.1 Set the sourceBuffer attribute on the TextTrack object to null. … … 847 847 // 9.3.6 Queue a task to fire a trusted event named removetrack, that does not bubble and is not 848 848 // cancelable, and that uses the TrackEvent interface, at the SourceBuffer textTracks list. 849 textTracks .remove(track);849 textTracks->remove(track); 850 850 } 851 851 … … 990 990 bool MediaSource::canSuspendForDocumentSuspension() const 991 991 { 992 // FIXME: Do better. 993 return isClosed(); 992 return true; 994 993 } 995 994 -
trunk/Source/WebCore/Modules/mediasource/SourceBuffer.cpp
r250576 r250935 541 541 bool SourceBuffer::canSuspendForDocumentSuspension() const 542 542 { 543 return !hasPendingActivity();543 return true; 544 544 } 545 545 -
trunk/Source/WebCore/Modules/mediasource/SourceBuffer.h
r250542 r250935 80 80 #if ENABLE(VIDEO_TRACK) 81 81 VideoTrackList& videoTracks(); 82 VideoTrackList* videoTracksIfExists() const { return m_videoTracks.get(); } 82 83 AudioTrackList& audioTracks(); 84 AudioTrackList* audioTracksIfExists() const { return m_audioTracks.get(); } 83 85 TextTrackList& textTracks(); 86 TextTrackList* textTracksIfExists() const { return m_textTracks.get(); } 84 87 #endif 85 88
Note: See TracChangeset
for help on using the changeset viewer.