Title: [295178] branches/safari-613-branch/Source/WebCore/html
Revision
295178
Author
[email protected]
Date
2022-06-02 23:45:13 -0700 (Thu, 02 Jun 2022)

Log Message

Cherry-pick 0062ea642e7f. rdar://problem/93525670

    MediaController should be an ContextDestructionObserver
    https://bugs.webkit.org/show_bug.cgi?id=240749
    <rdar://93525670>

    Reviewed by Youenn Fablet.

    * html/MediaController.cpp:
    (WebCore::MediaController::MediaController):
    * html/MediaController.h:

    Canonical link: https://commits.webkit.org/250882@main
    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@294664 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Modified Paths

Diff

Modified: branches/safari-613-branch/Source/WebCore/html/MediaController.cpp (295177 => 295178)


--- branches/safari-613-branch/Source/WebCore/html/MediaController.cpp	2022-06-03 06:45:11 UTC (rev 295177)
+++ branches/safari-613-branch/Source/WebCore/html/MediaController.cpp	2022-06-03 06:45:13 UTC (rev 295178)
@@ -47,7 +47,8 @@
 }
 
 MediaController::MediaController(ScriptExecutionContext& context)
-    : m_paused(false)
+    : ContextDestructionObserver(&context)
+    , m_paused(false)
     , m_defaultPlaybackRate(1)
     , m_volume(1)
     , m_position(MediaPlayer::invalidTime())
@@ -58,7 +59,6 @@
     , m_clearPositionTimer(*this, &MediaController::clearPositionTimerFired)
     , m_closedCaptionsVisible(false)
     , m_clock(PAL::Clock::create())
-    , m_scriptExecutionContext(context)
     , m_timeupdateTimer(*this, &MediaController::scheduleTimeupdateEvent)
 {
 }

Modified: branches/safari-613-branch/Source/WebCore/html/MediaController.h (295177 => 295178)


--- branches/safari-613-branch/Source/WebCore/html/MediaController.h	2022-06-03 06:45:11 UTC (rev 295177)
+++ branches/safari-613-branch/Source/WebCore/html/MediaController.h	2022-06-03 06:45:13 UTC (rev 295178)
@@ -27,6 +27,7 @@
 
 #if ENABLE(VIDEO)
 
+#include "ContextDestructionObserver.h"
 #include "Event.h"
 #include "EventTarget.h"
 #include "MediaControllerInterface.h"
@@ -41,7 +42,11 @@
 
 class HTMLMediaElement;
 
-class MediaController final : public RefCounted<MediaController>, public MediaControllerInterface, public EventTargetWithInlineData {
+class MediaController final
+    : public RefCounted<MediaController>
+    , public MediaControllerInterface
+    , public ContextDestructionObserver
+    , public EventTargetWithInlineData {
     WTF_MAKE_ISO_ALLOCATED(MediaController);
 public:
     static Ref<MediaController> create(ScriptExecutionContext&);
@@ -95,7 +100,7 @@
     void refEventTarget() final { ref(); }
     void derefEventTarget() final { deref(); }
     EventTargetInterface eventTargetInterface() const final { return MediaControllerEventTargetInterfaceType; }
-    ScriptExecutionContext* scriptExecutionContext() const final { return &m_scriptExecutionContext; };
+    ScriptExecutionContext* scriptExecutionContext() const final { return ContextDestructionObserver::scriptExecutionContext(); };
 
     void addMediaElement(HTMLMediaElement&);
     void removeMediaElement(HTMLMediaElement&);
@@ -147,7 +152,6 @@
     String m_mediaGroup;
     bool m_closedCaptionsVisible;
     std::unique_ptr<PAL::Clock> m_clock;
-    ScriptExecutionContext& m_scriptExecutionContext;
     Timer m_timeupdateTimer;
     MonotonicTime m_previousTimeupdateTime;
     bool m_resetCurrentTimeInNextPlay { false };
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to