Changeset 244815 in webkit
- Timestamp:
- Apr 30, 2019, 5:13:08 PM (7 years ago)
- Location:
- trunk/Source
- Files:
-
- 9 edited
-
WTF/ChangeLog (modified) (1 diff)
-
WTF/wtf/WeakHashSet.h (modified) (2 diffs)
-
WebCore/ChangeLog (modified) (1 diff)
-
WebCore/Modules/mediastream/MediaStreamTrack.h (modified) (1 diff)
-
WebCore/dom/Document.cpp (modified) (4 diffs)
-
WebCore/dom/Document.h (modified) (2 diffs)
-
WebCore/html/HTMLMediaElement.cpp (modified) (1 diff)
-
WebCore/html/HTMLMediaElement.h (modified) (1 diff)
-
WebCore/page/MediaProducer.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WTF/ChangeLog
r244801 r244815 1 2019-04-30 Youenn Fablet <youenn@apple.com> 2 3 Make Document audio producers use WeakPtr 4 https://bugs.webkit.org/show_bug.cgi?id=197382 5 6 Reviewed by Eric Carlson. 7 8 * wtf/WeakHashSet.h: 9 (WTF::WeakHashSet::hasNullReferences const): 10 1 11 2019-04-30 Commit Queue <commit-queue@webkit.org> 2 12 -
trunk/Source/WTF/wtf/WeakHashSet.h
r244801 r244815 26 26 #pragma once 27 27 28 #include <wtf/Algorithms.h> 28 29 #include <wtf/HashSet.h> 29 30 #include <wtf/HashTraits.h> … … 124 125 } 125 126 127 bool hasNullReferences() const 128 { 129 return WTF::anyOf(m_set, [] (auto& value) { return !value->get(); }); 130 } 131 126 132 unsigned computeSize() const 127 133 { -
trunk/Source/WebCore/ChangeLog
r244813 r244815 1 2019-04-30 Youenn Fablet <youenn@apple.com> 2 3 Make Document audio producers use WeakPtr 4 https://bugs.webkit.org/show_bug.cgi?id=197382 5 6 Reviewed by Eric Carlson. 7 8 Move from a hash set of raw pointers to a hash set of weak pointers. 9 This helps make the code cleaner. 10 No observable change of behavior. 11 12 * Modules/mediastream/MediaStreamTrack.h: 13 * dom/Document.cpp: 14 (WebCore::Document::addAudioProducer): 15 (WebCore::Document::removeAudioProducer): 16 (WebCore::Document::updateIsPlayingMedia): 17 (WebCore::Document::pageMutedStateDidChange): 18 * dom/Document.h: 19 * html/HTMLMediaElement.cpp: 20 (WebCore::HTMLMediaElement::updateActiveTextTrackCues): 21 * html/HTMLMediaElement.h: 22 * page/MediaProducer.h: 23 1 24 2019-04-30 Youenn Fablet <youenn@apple.com> 2 25 -
trunk/Source/WebCore/Modules/mediastream/MediaStreamTrack.h
r244801 r244815 52 52 , public ActiveDOMObject 53 53 , public EventTargetWithInlineData 54 , public CanMakeWeakPtr<MediaStreamTrack> 55 , private MediaProducer 54 , public MediaProducer 56 55 , private MediaStreamTrackPrivate::Observer 57 56 #if !RELEASE_LOG_DISABLED -
trunk/Source/WebCore/dom/Document.cpp
r244801 r244815 3903 3903 void Document::addAudioProducer(MediaProducer& audioProducer) 3904 3904 { 3905 m_audioProducers.add( &audioProducer);3905 m_audioProducers.add(audioProducer); 3906 3906 updateIsPlayingMedia(); 3907 3907 } … … 3909 3909 void Document::removeAudioProducer(MediaProducer& audioProducer) 3910 3910 { 3911 m_audioProducers.remove( &audioProducer);3911 m_audioProducers.remove(audioProducer); 3912 3912 updateIsPlayingMedia(); 3913 3913 } … … 3928 3928 { 3929 3929 MediaProducer::MediaStateFlags state = MediaProducer::IsNotPlaying; 3930 for (auto *audioProducer : m_audioProducers)3931 state |= audioProducer ->mediaState();3930 for (auto& audioProducer : m_audioProducers) 3931 state |= audioProducer.mediaState(); 3932 3932 3933 3933 #if ENABLE(MEDIA_SESSION) … … 3970 3970 void Document::pageMutedStateDidChange() 3971 3971 { 3972 for (auto *audioProducer : m_audioProducers)3973 audioProducer ->pageMutedStateDidChange();3972 for (auto& audioProducer : m_audioProducers) 3973 audioProducer.pageMutedStateDidChange(); 3974 3974 } 3975 3975 -
trunk/Source/WebCore/dom/Document.h
r244801 r244815 67 67 #include <wtf/ObjectIdentifier.h> 68 68 #include <wtf/UniqueRef.h> 69 #include <wtf/WeakHashSet.h> 69 70 #include <wtf/WeakPtr.h> 70 71 #include <wtf/text/AtomicStringHash.h> … … 1892 1893 Ref<CSSFontSelector> m_fontSelector; 1893 1894 1894 HashSet<MediaProducer*> m_audioProducers;1895 WeakHashSet<MediaProducer> m_audioProducers; 1895 1896 1896 1897 HashSet<ShadowRoot*> m_inDocumentShadowRoots; -
trunk/Source/WebCore/html/HTMLMediaElement.cpp
r244801 r244815 1769 1769 return; 1770 1770 1771 auto currentMediaTime = weakThis->currentMediaTime();1771 auto currentMediaTime = this->currentMediaTime(); 1772 1772 INFO_LOG(LOGIDENTIFIER, " lambda, currentMediaTime: ", currentMediaTime); 1773 weakThis->updateActiveTextTrackCues(currentMediaTime);1773 this->updateActiveTextTrackCues(currentMediaTime); 1774 1774 }, nextInterestingTime); 1775 1775 } -
trunk/Source/WebCore/html/HTMLMediaElement.h
r244801 r244815 574 574 enum class AutoplayEventPlaybackState { None, PreventedAutoplay, StartedWithUserGesture, StartedWithoutUserGesture }; 575 575 576 using HTMLElement::weakPtrFactory; 577 576 578 protected: 577 579 HTMLMediaElement(const QualifiedName&, Document&, bool createdByParser); -
trunk/Source/WebCore/page/MediaProducer.h
r244801 r244815 26 26 #pragma once 27 27 28 #include <wtf/WeakPtr.h> 29 28 30 namespace WebCore { 29 31 30 class MediaProducer {32 class MediaProducer : public CanMakeWeakPtr<MediaProducer> { 31 33 public: 32 34 enum MediaState {
Note:
See TracChangeset
for help on using the changeset viewer.