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

Changeset 245463 in webkit


Ignore:
Timestamp:
May 17, 2019, 8:20:22 AM (7 years ago)
Author:
Kocsen Chung
Message:

Apply patch. rdar://problem/50352476

Location:
branches/safari-607-branch/Source/WebCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/safari-607-branch/Source/WebCore/ChangeLog

    r245397 r245463  
     12019-05-17  Alan Coon  <alancoon@apple.com>
     2
     3        Apply patch. rdar://problem/50871594
     4
     5    2019-05-17  youenn fablet  <youennf@gmail.com>
     6
     7            REGRESSION(245357): Netflix, Hulu, Amazon, YouTube Rental video playback crash at com.apple.WebCore: WebCore::WebKitMediaKeys::setMediaElement
     8            rdar://problem/50871594
     9
     10            Do not cast WeakPtr<MediaProducer> into WeakPtr<HTMLMediaElement>.
     11            Instead, make HTMLMediaElement again a CanMakeWeakPtr<HTMLMediaElement>
     12            and directly create WeakPtr<HTMLMediaElement>.
     13
     14            For MediaStreamTrack, rely on weakThis to know whether 'this' is still alive and use 'this' directly.
     15
     16            Manually tested.
     17
     18            * Modules/mediastream/MediaStreamTrack.cpp:
     19            (WebCore::MediaStreamTrack::applyConstraints):
     20            * html/HTMLMediaElement.h:
     21
    1222019-05-16  Kocsen Chung  <kocsen_chung@apple.com>
    223
  • branches/safari-607-branch/Source/WebCore/Modules/mediastream/MediaStreamTrack.cpp

    r239461 r245463  
    332332
    333333    auto weakThis = makeWeakPtr(*this);
    334     auto failureHandler = [weakThis] (const String& failedConstraint, const String& message) {
    335         if (!weakThis || !weakThis->m_promise)
     334    auto failureHandler = [weakThis, this] (const String& failedConstraint, const String& message) {
     335        if (!weakThis || !m_promise)
    336336            return;
    337         weakThis->m_promise->rejectType<IDLInterface<OverconstrainedError>>(OverconstrainedError::create(failedConstraint, message).get());
     337        m_promise->rejectType<IDLInterface<OverconstrainedError>>(OverconstrainedError::create(failedConstraint, message).get());
    338338    };
    339     auto successHandler = [weakThis, constraints] () {
    340         if (!weakThis || !weakThis->m_promise)
     339    auto successHandler = [weakThis, this, constraints] () {
     340        if (!weakThis || !m_promise)
    341341            return;
    342         weakThis->m_promise->resolve();
    343         weakThis->m_constraints = constraints.valueOr(MediaTrackConstraints { });
     342        m_promise->resolve();
     343        m_constraints = constraints.valueOr(MediaTrackConstraints { });
    344344    };
    345345    m_private->applyConstraints(createMediaConstraints(constraints), WTFMove(successHandler), WTFMove(failureHandler));
  • branches/safari-607-branch/Source/WebCore/html/HTMLMediaElement.h

    r245357 r245463  
    127127    , public ActiveDOMObject
    128128    , public MediaControllerInterface
     129    , public CanMakeWeakPtr<HTMLMediaElement>
    129130    , public PlatformMediaSessionClient
    130131    , private MediaCanStartListener
    131132    , private MediaPlayerClient
    132     , public MediaProducer
     133    , private MediaProducer
    133134    , private VisibilityChangeClient
    134135    , private ApplicationStateChangeListener
     
    187188    MediaPlayerEnums::VideoGravity videoFullscreenGravity() const { return m_videoFullscreenGravity; }
    188189#endif
     190
     191    using CanMakeWeakPtr<HTMLMediaElement>::weakPtrFactory;
    189192
    190193    void scheduleCheckPlaybackTargetCompatability();
Note: See TracChangeset for help on using the changeset viewer.