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

Changeset 246001 in webkit


Ignore:
Timestamp:
May 31, 2019, 4:49:14 PM (7 years ago)
Author:
Alan Coon
Message:

Apply patch. rdar://problem/50871594

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

Legend:

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

    r245929 r246001  
     12019-05-31  Alan Coon  <alancoon@apple.com>
     2
     3        Apply patch. rdar://problem/50871594
     4
     5    2019-05-31  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-30  Kocsen Chung  <kocsen_chung@apple.com>
    223
  • branches/safari-607-branch/Source/WebCore/Modules/mediastream/MediaStreamTrack.cpp

    r245463 r246001  
    332332
    333333    auto weakThis = makeWeakPtr(*this);
    334     auto failureHandler = [weakThis, this] (const String& failedConstraint, const String& message) {
    335         if (!weakThis || !m_promise)
     334    auto failureHandler = [weakThis] (const String& failedConstraint, const String& message) {
     335        if (!weakThis || !weakThis->m_promise)
    336336            return;
    337         m_promise->rejectType<IDLInterface<OverconstrainedError>>(OverconstrainedError::create(failedConstraint, message).get());
     337        weakThis->m_promise->rejectType<IDLInterface<OverconstrainedError>>(OverconstrainedError::create(failedConstraint, message).get());
    338338    };
    339     auto successHandler = [weakThis, this, constraints] () {
    340         if (!weakThis || !m_promise)
     339    auto successHandler = [weakThis, constraints] () {
     340        if (!weakThis || !weakThis->m_promise)
    341341            return;
    342         m_promise->resolve();
    343         m_constraints = constraints.valueOr(MediaTrackConstraints { });
     342        weakThis->m_promise->resolve();
     343        weakThis->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

    r245463 r246001  
    127127    , public ActiveDOMObject
    128128    , public MediaControllerInterface
    129     , public CanMakeWeakPtr<HTMLMediaElement>
    130129    , public PlatformMediaSessionClient
    131130    , private MediaCanStartListener
    132131    , private MediaPlayerClient
    133     , private MediaProducer
     132    , public MediaProducer
    134133    , private VisibilityChangeClient
    135134    , private ApplicationStateChangeListener
     
    188187    MediaPlayerEnums::VideoGravity videoFullscreenGravity() const { return m_videoFullscreenGravity; }
    189188#endif
    190 
    191     using CanMakeWeakPtr<HTMLMediaElement>::weakPtrFactory;
    192189
    193190    void scheduleCheckPlaybackTargetCompatability();
Note: See TracChangeset for help on using the changeset viewer.