⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 295178 in webkit


Ignore:
Timestamp:
Jun 2, 2022, 11:45:13 PM (4 years ago)
Author:
Alan Coon
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

Location:
branches/safari-613-branch/Source/WebCore/html
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/safari-613-branch/Source/WebCore/html/MediaController.cpp

    r273895 r295178  
    4848
    4949MediaController::MediaController(ScriptExecutionContext& context)
    50     : m_paused(false)
     50    : ContextDestructionObserver(&context)
     51    , m_paused(false)
    5152    , m_defaultPlaybackRate(1)
    5253    , m_volume(1)
    … …  
    5960    , m_closedCaptionsVisible(false)
    6061    , m_clock(PAL::Clock::create())
    61     , m_scriptExecutionContext(context)
    6262    , m_timeupdateTimer(*this, &MediaController::scheduleTimeupdateEvent)
    6363{
  • branches/safari-613-branch/Source/WebCore/html/MediaController.h

    r246490 r295178  
    2828#if ENABLE(VIDEO)
    2929
     30#include "ContextDestructionObserver.h"
    3031#include "Event.h"
    3132#include "EventTarget.h"
    … …  
    4243class HTMLMediaElement;
    4344
    44 class MediaController final : public RefCounted<MediaController>, public MediaControllerInterface, public EventTargetWithInlineData {
     45class MediaController final
     46    : public RefCounted<MediaController>
     47    , public MediaControllerInterface
     48    , public ContextDestructionObserver
     49    , public EventTargetWithInlineData {
    4550    WTF_MAKE_ISO_ALLOCATED(MediaController);
    4651public:
    … …  
    96101    void derefEventTarget() final { deref(); }
    97102    EventTargetInterface eventTargetInterface() const final { return MediaControllerEventTargetInterfaceType; }
    98     ScriptExecutionContext* scriptExecutionContext() const final { return &m_scriptExecutionContext; };
     103    ScriptExecutionContext* scriptExecutionContext() const final { return ContextDestructionObserver::scriptExecutionContext(); };
    99104
    100105    void addMediaElement(HTMLMediaElement&);
    … …  
    148153    bool m_closedCaptionsVisible;
    149154    std::unique_ptr<PAL::Clock> m_clock;
    150     ScriptExecutionContext& m_scriptExecutionContext;
    151155    Timer m_timeupdateTimer;
    152156    MonotonicTime m_previousTimeupdateTime;
Note: See TracChangeset for help on using the changeset viewer.