Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(716)

Unified Diff: Source/core/html/HTMLMediaElement.cpp

Issue 19693009: Prevent WebMediaPlayerImpl from dereferencing stale Frame pointers on Document changes. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase Created 7 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/html/HTMLMediaElement.cpp
diff --git a/Source/core/html/HTMLMediaElement.cpp b/Source/core/html/HTMLMediaElement.cpp
index 6440307b61afc4f36bd2e4df3be7da234189fd09..21a10f48eedc1c3f7369d360c2df26f80153144d 100644
--- a/Source/core/html/HTMLMediaElement.cpp
+++ b/Source/core/html/HTMLMediaElement.cpp
@@ -353,6 +353,8 @@ HTMLMediaElement::~HTMLMediaElement()
void HTMLMediaElement::didMoveToNewDocument(Document* oldDocument)
{
+ LOG(Media, "HTMLMediaElement::didMoveToNewDocument");
+
if (m_shouldDelayLoadEvent) {
if (oldDocument)
oldDocument->decrementLoadEventDelayCount();
@@ -364,6 +366,13 @@ void HTMLMediaElement::didMoveToNewDocument(Document* oldDocument)
addElementToDocumentMap(this, document());
+ // FIXME: This is a temporary fix to prevent this object from causing the
+ // MediaPlayer to dereference Frame and FrameLoader pointers from the
+ // previous document. A proper fix would provide a mechanism to allow this
+ // object to refresh the MediaPlayer's Frame and FrameLoader references on
+ // document changes so that playback can be resumed properly.
+ userCancelledLoad();
+
HTMLElement::didMoveToNewDocument(oldDocument);
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698