Remove MediaStreamTrack event queue
authoryouenn@apple.com <youenn@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 2 Dec 2019 13:20:51 +0000 (13:20 +0000)
committeryouenn@apple.com <youenn@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 2 Dec 2019 13:20:51 +0000 (13:20 +0000)
https://bugs.webkit.org/show_bug.cgi?id=204603

Reviewed by Eric Carlson.

Small refactoring to remove the track event queue and use ActiveDOMObject::queueTaskToDispatchEvent instead.
Updated some #include as some include fixes were needed.
No change of behavior.

* Modules/mediastream/MediaStreamTrack.cpp:
(WebCore::MediaStreamTrack::trackMutedChanged):
* Modules/mediastream/MediaStreamTrack.h:
* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.h:
* platform/mediastream/MediaStreamPrivate.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@252981 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/Modules/mediastream/MediaStreamTrack.cpp
Source/WebCore/Modules/mediastream/MediaStreamTrack.h
Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.h
Source/WebCore/platform/mediastream/MediaStreamPrivate.h

index 629dbf4..2410c27 100644 (file)
@@ -1,3 +1,20 @@
+2019-12-02  youenn fablet  <youenn@apple.com>
+
+        Remove MediaStreamTrack event queue
+        https://bugs.webkit.org/show_bug.cgi?id=204603
+
+        Reviewed by Eric Carlson.
+
+        Small refactoring to remove the track event queue and use ActiveDOMObject::queueTaskToDispatchEvent instead.
+        Updated some #include as some include fixes were needed.
+        No change of behavior.
+
+        * Modules/mediastream/MediaStreamTrack.cpp:
+        (WebCore::MediaStreamTrack::trackMutedChanged):
+        * Modules/mediastream/MediaStreamTrack.h:
+        * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.h:
+        * platform/mediastream/MediaStreamPrivate.h:
+
 2019-12-02  Antti Koivisto  <antti@apple.com>
 
         [LFC][Render tree] Support LFC in LineLayoutTraversal
index 773a1dd..8ae3d15 100644 (file)
@@ -511,13 +511,11 @@ void MediaStreamTrack::trackEnded(MediaStreamTrackPrivate&)
     
 void MediaStreamTrack::trackMutedChanged(MediaStreamTrackPrivate&)
 {
-    if (scriptExecutionContext()->activeDOMObjectsAreSuspended() || scriptExecutionContext()->activeDOMObjectsAreStopped() || m_ended)
+    if (scriptExecutionContext()->activeDOMObjectsAreStopped() || m_ended)
         return;
 
-    m_eventTaskQueue.enqueueTask([this, muted = this->muted()] {
-        AtomString eventType = muted ? eventNames().muteEvent : eventNames().unmuteEvent;
-        dispatchEvent(Event::create(eventType, Event::CanBubble::No, Event::IsCancelable::No));
-    });
+    AtomString eventType = muted() ? eventNames().muteEvent : eventNames().unmuteEvent;
+    queueTaskToDispatchEvent(*this, TaskSource::Networking, Event::create(eventType, Event::CanBubble::No, Event::IsCancelable::No));
 
     configureTrackRendering();
 }
index 337b8f7..564f9cc 100644 (file)
@@ -32,7 +32,6 @@
 #include "ActiveDOMObject.h"
 #include "DoubleRange.h"
 #include "EventTarget.h"
-#include "GenericTaskQueue.h"
 #include "LongRange.h"
 #include "MediaProducer.h"
 #include "MediaStreamTrackPrivate.h"
@@ -216,7 +215,6 @@ private:
 
     MediaTrackConstraints m_constraints;
     std::unique_ptr<DOMPromiseDeferred<void>> m_promise;
-    GenericTaskQueue<Timer> m_eventTaskQueue;
 
     bool m_ended { false };
     const bool m_isCaptureTrack { false };
index c5f260a..740e96c 100644 (file)
@@ -32,6 +32,7 @@
 #include "MediaSample.h"
 #include "MediaStreamPrivate.h"
 #include <CoreGraphics/CGAffineTransform.h>
+#include <wtf/Deque.h>
 #include <wtf/Function.h>
 #include <wtf/LoggerHelper.h>
 #include <wtf/MediaTime.h>
index 7dffdb4..4a06844 100644 (file)
 #if ENABLE(MEDIA_STREAM)
 
 #include "FloatSize.h"
-#include "MediaStreamTrack.h"
 #include "MediaStreamTrackPrivate.h"
 #include <wtf/Function.h>
 #include <wtf/HashMap.h>
-#include <wtf/LoggerHelper.h>
 #include <wtf/MediaTime.h>
-#include <wtf/RefCounted.h>
 #include <wtf/RefPtr.h>
 #include <wtf/UUID.h>
 #include <wtf/Vector.h>