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.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@184001
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2015-05-08 Eric Carlson <eric.carlson@apple.com>
+
+ [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.
+
2015-05-08 Chris Dumez <cdumez@apple.com>
Throttle RequestAnimationFrame in subframes that are outside the viewport
if (m_mediaQueryMatcher)
m_mediaQueryMatcher->documentDestroyed();
+#if ENABLE(WIRELESS_PLAYBACK_TARGET)
+ if (!m_clientToIDMap.isEmpty() && page()) {
+ Vector<WebCore::MediaPlaybackTargetClient*> clients;
+ copyKeysToVector(m_clientToIDMap, clients);
+ for (auto client : clients)
+ removePlaybackTargetPickerClient(*client);
+ }
+#endif
+
disconnectFromFrame();
m_hasPreparedForDestruction = true;
document.registerForPageScaleFactorChangedCallbacks(this);
#endif
+#if ENABLE(WIRELESS_PLAYBACK_TARGET)
+ document.registerForPageCacheSuspensionCallbacks(this);
+#endif
+
document.addAudioProducer(this);
addElementToDocumentMap(*this, document);
}
document.unregisterForPageScaleFactorChangedCallbacks(this);
#endif
+#if ENABLE(WIRELESS_PLAYBACK_TARGET)
+ document.unregisterForPageCacheSuspensionCallbacks(this);
+#endif
+
document.removeAudioProducer(this);
removeElementFromDocumentMap(*this, document);
}
HTMLElement::didMoveToNewDocument(oldDocument);
}
+#if ENABLE(WIRELESS_PLAYBACK_TARGET)
+void HTMLMediaElement::documentWillSuspendForPageCache()
+{
+ m_mediaSession->unregisterWithDocument(*this);
+}
+
+void HTMLMediaElement::documentDidResumeFromPageCache()
+{
+ m_mediaSession->registerWithDocument(*this);
+}
+#endif
+
bool HTMLMediaElement::hasCustomFocusLogic() const
{
return true;
void updateCaptionContainer();
+#if ENABLE(WIRELESS_PLAYBACK_TARGET)
+ virtual void documentWillSuspendForPageCache() override final;
+ virtual void documentDidResumeFromPageCache() override final;
+#endif
+
Timer m_pendingActionTimer;
Timer m_progressEventTimer;
Timer m_playbackProgressTimer;