Make Document audio producers use WeakPtr
authoryouenn@apple.com <youenn@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 30 Apr 2019 15:16:11 +0000 (15:16 +0000)
committeryouenn@apple.com <youenn@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 30 Apr 2019 15:16:11 +0000 (15:16 +0000)
commit3916e3c6670208e8fc3f700cc2067e8b47e161e8
tree5d29f68632137e7ed28735fc53dc8aaec5fe5726
parent98091d78105a424ddfe725de2945a53cf59c3ce0
Make Document audio producers use WeakPtr
https://bugs.webkit.org/show_bug.cgi?id=197382

Reviewed by Eric Carlson.

Source/WebCore:

Move from a hash set of raw pointers to a hash set of weak pointers.
This helps make the code cleaner.
No observable change of behavior.

* Modules/mediastream/MediaStreamTrack.h:
* dom/Document.cpp:
(WebCore::Document::addAudioProducer):
(WebCore::Document::removeAudioProducer):
(WebCore::Document::updateIsPlayingMedia):
(WebCore::Document::pageMutedStateDidChange):
* dom/Document.h:
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::updateActiveTextTrackCues):
* html/HTMLMediaElement.h:
* page/MediaProducer.h:

Source/WTF:

* wtf/WeakHashSet.h:
(WTF::WeakHashSet::hasNullReferences const):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@244773 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WTF/ChangeLog
Source/WTF/wtf/WeakHashSet.h
Source/WebCore/ChangeLog
Source/WebCore/Modules/mediastream/MediaStreamTrack.h
Source/WebCore/dom/Document.cpp
Source/WebCore/dom/Document.h
Source/WebCore/html/HTMLMediaElement.cpp
Source/WebCore/html/HTMLMediaElement.h
Source/WebCore/page/MediaProducer.h