Changeset 185120 in webkit


Ignore:
Timestamp:
Jun 2, 2015, 2:04:55 PM (11 years ago)
Author:
eric.carlson@apple.com
Message:

[Mac] occasional crash in Document::playbackTargetAvailabilityDidChange
https://bugs.webkit.org/show_bug.cgi?id=145559

Reviewed by Darin Adler.

No new tests, covered by existing tests.

  • html/HTMLMediaElement.cpp:

(WebCore::HTMLMediaElement::registerWithDocument): Pass document to m_mediaSession->registerWithDocument.
(WebCore::HTMLMediaElement::unregisterWithDocument): Pass document to m_mediaSession->unRegisterWithDocument.
(WebCore::HTMLMediaElement::documentWillSuspendForPageCache): Ditto.
(WebCore::HTMLMediaElement::documentDidResumeFromPageCache): Ditto.

  • html/MediaElementSession.cpp:

(WebCore::MediaElementSession::registerWithDocument): Take a document.
(WebCore::MediaElementSession::unregisterWithDocument): Ditto.

  • html/MediaElementSession.h:
Location:
trunk/Source/WebCore
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r185118 r185120  
     12015-06-02  Eric Carlson  <eric.carlson@apple.com>
     2
     3        [Mac] occasional crash in Document::playbackTargetAvailabilityDidChange
     4        https://bugs.webkit.org/show_bug.cgi?id=145559
     5
     6        Reviewed by Darin Adler.
     7
     8        No new tests, covered by existing tests.
     9
     10        * html/HTMLMediaElement.cpp:
     11        (WebCore::HTMLMediaElement::registerWithDocument): Pass document to m_mediaSession->registerWithDocument.
     12        (WebCore::HTMLMediaElement::unregisterWithDocument): Pass document to m_mediaSession->unRegisterWithDocument.
     13        (WebCore::HTMLMediaElement::documentWillSuspendForPageCache): Ditto.
     14        (WebCore::HTMLMediaElement::documentDidResumeFromPageCache): Ditto.
     15
     16        * html/MediaElementSession.cpp:
     17        (WebCore::MediaElementSession::registerWithDocument): Take a document.
     18        (WebCore::MediaElementSession::unregisterWithDocument): Ditto.
     19        * html/MediaElementSession.h:
     20
    1212015-06-02  Chris Dumez  <cdumez@apple.com>
    222
  • trunk/Source/WebCore/html/HTMLMediaElement.cpp

    r185006 r185120  
    461461void HTMLMediaElement::registerWithDocument(Document& document)
    462462{
    463     m_mediaSession->registerWithDocument(*this);
     463    m_mediaSession->registerWithDocument(document);
    464464
    465465    if (m_isWaitingUntilMediaCanStart)
     
    493493void HTMLMediaElement::unregisterWithDocument(Document& document)
    494494{
    495     m_mediaSession->unregisterWithDocument(*this);
     495    m_mediaSession->unregisterWithDocument(document);
    496496
    497497    if (m_isWaitingUntilMediaCanStart)
     
    531531    }
    532532
    533     if (oldDocument) {
     533    if (oldDocument)
    534534        unregisterWithDocument(*oldDocument);
    535     }
    536535
    537536    registerWithDocument(document());
     
    543542void HTMLMediaElement::documentWillSuspendForPageCache()
    544543{
    545     m_mediaSession->unregisterWithDocument(*this);
     544    m_mediaSession->unregisterWithDocument(document());
    546545}
    547546
    548547void HTMLMediaElement::documentDidResumeFromPageCache()
    549548{
    550     m_mediaSession->registerWithDocument(*this);
     549    m_mediaSession->registerWithDocument(document());
    551550}
    552551#endif
  • trunk/Source/WebCore/html/MediaElementSession.cpp

    r185006 r185120  
    8888}
    8989
    90 void MediaElementSession::registerWithDocument(const HTMLMediaElement& element)
    91 {
    92 #if ENABLE(WIRELESS_PLAYBACK_TARGET)
    93     element.document().addPlaybackTargetPickerClient(*this);
     90void MediaElementSession::registerWithDocument(Document& document)
     91{
     92#if ENABLE(WIRELESS_PLAYBACK_TARGET)
     93    document.addPlaybackTargetPickerClient(*this);
    9494#else
    95     UNUSED_PARAM(element);
    96 #endif
    97 }
    98 
    99 void MediaElementSession::unregisterWithDocument(const HTMLMediaElement& element)
    100 {
    101 #if ENABLE(WIRELESS_PLAYBACK_TARGET)
    102     element.document().removePlaybackTargetPickerClient(*this);
     95    UNUSED_PARAM(document);
     96#endif
     97}
     98
     99void MediaElementSession::unregisterWithDocument(Document& document)
     100{
     101#if ENABLE(WIRELESS_PLAYBACK_TARGET)
     102    document.removePlaybackTargetPickerClient(*this);
    103103#else
    104     UNUSED_PARAM(element);
     104    UNUSED_PARAM(document);
    105105#endif
    106106}
  • trunk/Source/WebCore/html/MediaElementSession.h

    r185006 r185120  
    4545    virtual ~MediaElementSession() { }
    4646
    47     void registerWithDocument(const HTMLMediaElement&);
    48     void unregisterWithDocument(const HTMLMediaElement&);
     47    void registerWithDocument(Document&);
     48    void unregisterWithDocument(Document&);
    4949
    5050    bool playbackPermitted(const HTMLMediaElement&) const;
Note: See TracChangeset for help on using the changeset viewer.