Changeset 245357 in webkit
- Timestamp:
- May 15, 2019, 2:45:08 PM (7 years ago)
- Location:
- branches/safari-607-branch/Source/WebCore
- Files:
-
- 7 edited
-
ChangeLog (modified) (1 diff)
-
Modules/mediastream/MediaStreamTrack.h (modified) (1 diff)
-
dom/Document.cpp (modified) (3 diffs)
-
dom/Document.h (modified) (1 diff)
-
html/HTMLMediaElement.cpp (modified) (1 diff)
-
html/HTMLMediaElement.h (modified) (1 diff)
-
page/MediaProducer.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
branches/safari-607-branch/Source/WebCore/ChangeLog
r245354 r245357 1 2019-05-15 Kocsen Chung <kocsen_chung@apple.com> 2 3 Apply patch. rdar://problem/50352476 4 5 2019-05-15 Youenn Fablet <youenn@apple.com> 6 7 Make Document audio producers use WeakPtr 8 https://bugs.webkit.org/show_bug.cgi?id=197382 9 10 Reviewed by Eric Carlson. 11 12 Move from a hash set of raw pointers to a hash set of weak pointers. 13 This helps make the code cleaner. 14 No observable change of behavior. 15 16 * Modules/mediastream/MediaStreamTrack.h: 17 * dom/Document.cpp: 18 (WebCore::Document::addAudioProducer): 19 (WebCore::Document::removeAudioProducer): 20 (WebCore::Document::updateIsPlayingMedia): 21 (WebCore::Document::pageMutedStateDidChange): 22 * dom/Document.h: 23 * html/HTMLMediaElement.cpp: 24 (WebCore::HTMLMediaElement::updateActiveTextTrackCues): 25 * html/HTMLMediaElement.h: 26 * page/MediaProducer.h: 27 1 28 2019-05-14 Kocsen Chung <kocsen_chung@apple.com> 2 29 -
branches/safari-607-branch/Source/WebCore/Modules/mediastream/MediaStreamTrack.h
r239427 r245357 51 51 public ActiveDOMObject, 52 52 public EventTargetWithInlineData, 53 public CanMakeWeakPtr<MediaStreamTrack>, 54 private MediaProducer, 53 public MediaProducer, 55 54 private MediaStreamTrackPrivate::Observer { 56 55 public: -
branches/safari-607-branch/Source/WebCore/dom/Document.cpp
r245346 r245357 3981 3981 void Document::addAudioProducer(MediaProducer* audioProducer) 3982 3982 { 3983 m_audioProducers.add(audioProducer );3983 m_audioProducers.add(audioProducer, makeWeakPtr(audioProducer)); 3984 3984 updateIsPlayingMedia(); 3985 3985 } … … 4006 4006 { 4007 4007 MediaProducer::MediaStateFlags state = MediaProducer::IsNotPlaying; 4008 for (auto* audioProducer : m_audioProducers) 4009 state |= audioProducer->mediaState(); 4008 for (auto& audioProducer : m_audioProducers.values()) { 4009 if (audioProducer) 4010 state |= audioProducer.get()->mediaState(); 4011 } 4012 m_audioProducers.removeIf([](auto iterator) { 4013 return !iterator.value; 4014 }); 4010 4015 4011 4016 #if ENABLE(MEDIA_SESSION) … … 4048 4053 void Document::pageMutedStateDidChange() 4049 4054 { 4050 for (auto* audioProducer : m_audioProducers) 4051 audioProducer->pageMutedStateDidChange(); 4055 for (auto& audioProducer : m_audioProducers.values()) { 4056 if (audioProducer) 4057 audioProducer.get()->pageMutedStateDidChange(); 4058 } 4059 m_audioProducers.removeIf([](auto iterator) { 4060 return !iterator.value; 4061 }); 4052 4062 } 4053 4063 -
branches/safari-607-branch/Source/WebCore/dom/Document.h
r245346 r245357 1909 1909 Ref<CSSFontSelector> m_fontSelector; 1910 1910 1911 Hash Set<MediaProducer*> m_audioProducers;1911 HashMap<MediaProducer*, WeakPtr<MediaProducer>> m_audioProducers; 1912 1912 1913 1913 HashSet<ShadowRoot*> m_inDocumentShadowRoots; -
branches/safari-607-branch/Source/WebCore/html/HTMLMediaElement.cpp
r241162 r245357 1773 1773 return; 1774 1774 1775 auto currentMediaTime = weakThis->currentMediaTime();1775 auto currentMediaTime = this->currentMediaTime(); 1776 1776 INFO_LOG(LOGIDENTIFIER, " - lambda, currentMediaTime:", currentMediaTime); 1777 weakThis->updateActiveTextTrackCues(currentMediaTime);1777 this->updateActiveTextTrackCues(currentMediaTime); 1778 1778 }, nextInterestingTime); 1779 1779 } -
branches/safari-607-branch/Source/WebCore/html/HTMLMediaElement.h
r241058 r245357 127 127 , public ActiveDOMObject 128 128 , public MediaControllerInterface 129 , public CanMakeWeakPtr<HTMLMediaElement>130 129 , public PlatformMediaSessionClient 131 130 , private MediaCanStartListener 132 131 , private MediaPlayerClient 133 , p rivateMediaProducer132 , public MediaProducer 134 133 , private VisibilityChangeClient 135 134 , private ApplicationStateChangeListener -
branches/safari-607-branch/Source/WebCore/page/MediaProducer.h
r223728 r245357 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.