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

Changeset 184001 in webkit


Ignore:
Timestamp:
May 8, 2015, 11:45:40 AM (11 years ago)
Author:
eric.carlson@apple.com
Message:

[Mac] Playback target clients do not unregister on page reload
https://bugs.webkit.org/show_bug.cgi?id=144761

Reviewed by Brady Eidson.

  • dom/Document.cpp:

(WebCore::Document::prepareForDestruction): Unregister all target picker clients.

  • html/HTMLMediaElement.cpp:

(WebCore::HTMLMediaElement::registerWithDocument): Register for page cache callback.
(WebCore::HTMLMediaElement::unregisterWithDocument): Unregister for page cache callback.
(WebCore::HTMLMediaElement::documentWillSuspendForPageCache): New.
(WebCore::HTMLMediaElement::documentDidResumeFromPageCache): New.

Location:
trunk/Source/WebCore
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r183998 r184001  
     12015-05-08  Eric Carlson  <eric.carlson@apple.com>
     2
     3        [Mac] Playback target clients do not unregister on page reload
     4        https://bugs.webkit.org/show_bug.cgi?id=144761
     5
     6        Reviewed by Brady Eidson.
     7
     8        * dom/Document.cpp:
     9        (WebCore::Document::prepareForDestruction): Unregister all target picker clients.
     10
     11        * html/HTMLMediaElement.cpp:
     12        (WebCore::HTMLMediaElement::registerWithDocument): Register for page cache callback.
     13        (WebCore::HTMLMediaElement::unregisterWithDocument): Unregister for page cache callback.
     14        (WebCore::HTMLMediaElement::documentWillSuspendForPageCache): New.
     15        (WebCore::HTMLMediaElement::documentDidResumeFromPageCache): New.
     16
    1172015-05-08  Chris Dumez  <cdumez@apple.com>
    218
  • trunk/Source/WebCore/dom/Document.cpp

    r183967 r184001  
    22532253        m_mediaQueryMatcher->documentDestroyed();
    22542254
     2255#if ENABLE(WIRELESS_PLAYBACK_TARGET)
     2256    if (!m_clientToIDMap.isEmpty() && page()) {
     2257        Vector<WebCore::MediaPlaybackTargetClient*> clients;
     2258        copyKeysToVector(m_clientToIDMap, clients);
     2259        for (auto client : clients)
     2260            removePlaybackTargetPickerClient(*client);
     2261    }
     2262#endif
     2263
    22552264    disconnectFromFrame();
    22562265
  • trunk/Source/WebCore/html/HTMLMediaElement.cpp

    r183826 r184001  
    461461#endif
    462462
     463#if ENABLE(WIRELESS_PLAYBACK_TARGET)
     464    document.registerForPageCacheSuspensionCallbacks(this);
     465#endif
     466
    463467    document.addAudioProducer(this);
    464468    addElementToDocumentMap(*this, document);
     
    487491    if (m_mediaControlsDependOnPageScaleFactor)
    488492        document.unregisterForPageScaleFactorChangedCallbacks(this);
     493#endif
     494
     495#if ENABLE(WIRELESS_PLAYBACK_TARGET)
     496    document.unregisterForPageCacheSuspensionCallbacks(this);
    489497#endif
    490498
     
    509517    HTMLElement::didMoveToNewDocument(oldDocument);
    510518}
     519
     520#if ENABLE(WIRELESS_PLAYBACK_TARGET)
     521void HTMLMediaElement::documentWillSuspendForPageCache()
     522{
     523    m_mediaSession->unregisterWithDocument(*this);
     524}
     525
     526void HTMLMediaElement::documentDidResumeFromPageCache()
     527{
     528    m_mediaSession->registerWithDocument(*this);
     529}
     530#endif
    511531
    512532bool HTMLMediaElement::hasCustomFocusLogic() const
  • trunk/Source/WebCore/html/HTMLMediaElement.h

    r183735 r184001  
    738738    void updateCaptionContainer();
    739739
     740#if ENABLE(WIRELESS_PLAYBACK_TARGET)
     741    virtual void documentWillSuspendForPageCache() override final;
     742    virtual void documentDidResumeFromPageCache() override final;
     743#endif
     744
    740745    Timer m_pendingActionTimer;
    741746    Timer m_progressEventTimer;
Note: See TracChangeset for help on using the changeset viewer.