Unreviewed, rolling out r244773.
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 30 Apr 2019 20:21:11 +0000 (20:21 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 30 Apr 2019 20:21:11 +0000 (20:21 +0000)
https://bugs.webkit.org/show_bug.cgi?id=197436

Causing assertion failures on debug queues (Requested by
ShawnRoberts on #webkit).

Reverted changeset:

"Make Document audio producers use WeakPtr"
https://bugs.webkit.org/show_bug.cgi?id=197382
https://trac.webkit.org/changeset/244773

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@244801 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

index 96192bc..e01866d 100644 (file)
@@ -1,3 +1,17 @@
+2019-04-30  Commit Queue  <commit-queue@webkit.org>
+
+        Unreviewed, rolling out r244773.
+        https://bugs.webkit.org/show_bug.cgi?id=197436
+
+        Causing assertion failures on debug queues (Requested by
+        ShawnRoberts on #webkit).
+
+        Reverted changeset:
+
+        "Make Document audio producers use WeakPtr"
+        https://bugs.webkit.org/show_bug.cgi?id=197382
+        https://trac.webkit.org/changeset/244773
+
 2019-04-30  Youenn Fablet  <youenn@apple.com>
 
         Make Document audio producers use WeakPtr
index 092011c..8c8987b 100644 (file)
@@ -25,7 +25,6 @@
 
 #pragma once
 
-#include <wtf/Algorithms.h>
 #include <wtf/HashSet.h>
 #include <wtf/HashTraits.h>
 #include <wtf/WeakPtr.h>
@@ -124,11 +123,6 @@ public:
         return true;
     }
 
-    bool hasNullReferences() const
-    {
-        return WTF::anyOf(m_set, [] (auto& value) { return !value->get(); });
-    }
-
     unsigned computeSize() const
     {
         const_cast<WeakReferenceSet&>(m_set).removeIf([] (auto& value) { return !value->get(); });
index ed574c0..c1ca7a2 100644 (file)
@@ -1,5 +1,19 @@
 2019-04-30  Commit Queue  <commit-queue@webkit.org>
 
+        Unreviewed, rolling out r244773.
+        https://bugs.webkit.org/show_bug.cgi?id=197436
+
+        Causing assertion failures on debug queues (Requested by
+        ShawnRoberts on #webkit).
+
+        Reverted changeset:
+
+        "Make Document audio producers use WeakPtr"
+        https://bugs.webkit.org/show_bug.cgi?id=197382
+        https://trac.webkit.org/changeset/244773
+
+2019-04-30  Commit Queue  <commit-queue@webkit.org>
+
         Unreviewed, rolling out r244774.
         https://bugs.webkit.org/show_bug.cgi?id=197431
 
index de8b5a6..7c11f3f 100644 (file)
@@ -51,7 +51,8 @@ class MediaStreamTrack
     : public RefCounted<MediaStreamTrack>
     , public ActiveDOMObject
     , public EventTargetWithInlineData
-    , public MediaProducer
+    , public CanMakeWeakPtr<MediaStreamTrack>
+    , private MediaProducer
     , private MediaStreamTrackPrivate::Observer
 #if !RELEASE_LOG_DISABLED
     , private LoggerHelper
index 224ea10..1794bed 100644 (file)
@@ -3902,13 +3902,13 @@ void Document::updateViewportUnitsOnResize()
 
 void Document::addAudioProducer(MediaProducer& audioProducer)
 {
-    m_audioProducers.add(audioProducer);
+    m_audioProducers.add(&audioProducer);
     updateIsPlayingMedia();
 }
 
 void Document::removeAudioProducer(MediaProducer& audioProducer)
 {
-    m_audioProducers.remove(audioProducer);
+    m_audioProducers.remove(&audioProducer);
     updateIsPlayingMedia();
 }
 
@@ -3926,11 +3926,9 @@ void Document::noteUserInteractionWithMediaElement()
 
 void Document::updateIsPlayingMedia(uint64_t sourceElementID)
 {
-    ASSERT(!m_audioProducers.hasNullReferences());
-
     MediaProducer::MediaStateFlags state = MediaProducer::IsNotPlaying;
-    for (auto& audioProducer : m_audioProducers)
-        state |= audioProducer.mediaState();
+    for (auto* audioProducer : m_audioProducers)
+        state |= audioProducer->mediaState();
 
 #if ENABLE(MEDIA_SESSION)
     if (HTMLMediaElement* sourceElement = HTMLMediaElement::elementWithID(sourceElementID)) {
@@ -3971,8 +3969,8 @@ void Document::updateIsPlayingMedia(uint64_t sourceElementID)
 
 void Document::pageMutedStateDidChange()
 {
-    for (auto& audioProducer : m_audioProducers)
-        audioProducer.pageMutedStateDidChange();
+    for (auto* audioProducer : m_audioProducers)
+        audioProducer->pageMutedStateDidChange();
 }
 
 static bool isNodeInSubtree(Node& node, Node& container, Document::NodeRemoval nodeRemoval)
index 45f8598..1417c2e 100644 (file)
@@ -66,7 +66,6 @@
 #include <wtf/Logger.h>
 #include <wtf/ObjectIdentifier.h>
 #include <wtf/UniqueRef.h>
-#include <wtf/WeakHashSet.h>
 #include <wtf/WeakPtr.h>
 #include <wtf/text/AtomicStringHash.h>
 
@@ -1892,7 +1891,7 @@ private:
 
     Ref<CSSFontSelector> m_fontSelector;
 
-    WeakHashSet<MediaProducer> m_audioProducers;
+    HashSet<MediaProducer*> m_audioProducers;
 
     HashSet<ShadowRoot*> m_inDocumentShadowRoots;
 
index e3093f2..6b0f42f 100644 (file)
@@ -1768,9 +1768,9 @@ void HTMLMediaElement::updateActiveTextTrackCues(const MediaTime& movieTime)
             if (!weakThis)
                 return;
 
-            auto currentMediaTime = this->currentMediaTime();
+            auto currentMediaTime = weakThis->currentMediaTime();
             INFO_LOG(LOGIDENTIFIER, " lambda, currentMediaTime: ", currentMediaTime);
-            this->updateActiveTextTrackCues(currentMediaTime);
+            weakThis->updateActiveTextTrackCues(currentMediaTime);
         }, nextInterestingTime);
     }
 
index 2296c66..576c7dc 100644 (file)
@@ -573,8 +573,6 @@ public:
 
     enum class AutoplayEventPlaybackState { None, PreventedAutoplay, StartedWithUserGesture, StartedWithoutUserGesture };
 
-    using HTMLElement::weakPtrFactory;
-
 protected:
     HTMLMediaElement(const QualifiedName&, Document&, bool createdByParser);
     virtual void finishInitialization();
index 92c19e8..b01ab94 100644 (file)
 
 #pragma once
 
-#include <wtf/WeakPtr.h>
-
 namespace WebCore {
 
-class MediaProducer : public CanMakeWeakPtr<MediaProducer> {
+class MediaProducer {
 public:
     enum MediaState {
         IsNotPlaying = 0,