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

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

Issue 15739014: Avoid referencing an HTMLMediaElement if is currently being deleted (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fixed build error again Created 7 years, 7 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 | « Source/core/dom/GenericEventQueue.cpp ('k') | 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 15007ba151486fe30206665094af261aae130263..d75609e2b3af348e0261f0ccddac580ce920aff5 100644
--- a/Source/core/html/HTMLMediaElement.cpp
+++ b/Source/core/html/HTMLMediaElement.cpp
@@ -290,6 +290,9 @@ HTMLMediaElement::HTMLMediaElement(const QualifiedName& tagName, Document* docum
HTMLMediaElement::~HTMLMediaElement()
{
LOG(Media, "HTMLMediaElement::~HTMLMediaElement");
+
+ m_asyncEventQueue->close();
+
setShouldDelayLoadEvent(false);
if (m_textTracks)
m_textTracks->clearOwner();
@@ -542,9 +545,8 @@ void HTMLMediaElement::scheduleEvent(const AtomicString& eventName)
#if LOG_MEDIA_EVENTS
LOG(Media, "HTMLMediaElement::scheduleEvent - scheduling '%s'", eventName.string().ascii().data());
#endif
- RefPtr<Event> event = Event::create(eventName, false, true);
- event->setTarget(this);
+ RefPtr<Event> event = Event::create(eventName, false, true);
m_asyncEventQueue->enqueueEvent(event.release());
}
@@ -905,8 +907,6 @@ static bool eventTimeCueCompare(const std::pair<double, TextTrackCue*>& a,
void HTMLMediaElement::updateActiveTextTrackCues(double movieTime)
{
- LOG(Media, "HTMLMediaElement::updateActiveTextTrackCues");
-
// 4.8.10.8 Playing the media resource
// If the current playback position changes while the steps are running,
@@ -915,6 +915,8 @@ void HTMLMediaElement::updateActiveTextTrackCues(double movieTime)
if (ignoreTrackDisplayUpdateRequests())
return;
+ LOG(Media, "HTMLMediaElement::updateActiveTextTrackCues");
+
// 1 - Let current cues be a list of cues, initialized to contain all the
// cues of all the hidden, showing, or showing by default text tracks of the
// media element (not the disabled ones) whose start times are less than or
@@ -3508,6 +3510,8 @@ void HTMLMediaElement::stop()
stopPeriodicTimers();
cancelPendingEventsAndCallbacks();
+
+ m_asyncEventQueue->close();
}
void HTMLMediaElement::suspend(ReasonForSuspension why)
« no previous file with comments | « Source/core/dom/GenericEventQueue.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698