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

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

Issue 1406183003: Reset readystates when webmediaplayer is cleared (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: update as per review Created 5 years, 2 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 | « third_party/WebKit/LayoutTests/media/video-move-to-new-document-crash.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/html/HTMLMediaElement.cpp
diff --git a/third_party/WebKit/Source/core/html/HTMLMediaElement.cpp b/third_party/WebKit/Source/core/html/HTMLMediaElement.cpp
index 614c6ce029563ab390b6395af1f1e283eed2f81d..2bbbc1a21aa3ded9c5363e69e7b5de1d81c79352 100644
--- a/third_party/WebKit/Source/core/html/HTMLMediaElement.cpp
+++ b/third_party/WebKit/Source/core/html/HTMLMediaElement.cpp
@@ -3043,7 +3043,12 @@ void HTMLMediaElement::userCancelledLoad()
// 1 - The user agent should cancel the fetching process.
clearMediaPlayer(-1);
+ // Reset m_readyState and m_readyStateMaximum since m_webMediaPlayer is gone.
+ ReadyState readyState = m_readyState;
+ m_readyState = HAVE_NOTHING;
+ m_readyStateMaximum = HAVE_NOTHING;
+ // TODO(srirama.m): Investigate if this condition can be dropped entirely without any issues.
if (m_networkState == NETWORK_EMPTY || m_completelyLoaded || m_isFinalizing)
return;
@@ -3057,7 +3062,7 @@ void HTMLMediaElement::userCancelledLoad()
// element's networkState attribute to the NETWORK_EMPTY value and queue a task to fire a
// simple event named emptied at the element. Otherwise, set the element's networkState
// attribute to the NETWORK_IDLE value.
- if (m_readyState == HAVE_NOTHING) {
+ if (readyState == HAVE_NOTHING) {
m_networkState = NETWORK_EMPTY;
scheduleEvent(EventTypeNames::emptied);
} else {
@@ -3070,8 +3075,6 @@ void HTMLMediaElement::userCancelledLoad()
// 6 - Abort the overall resource selection algorithm.
m_currentSourceNode = nullptr;
- // Reset m_readyState since m_webMediaPlayer is gone.
- m_readyState = HAVE_NOTHING;
invalidateCachedTime();
updateMediaController();
cueTimeline().updateActiveCues(0);
« no previous file with comments | « third_party/WebKit/LayoutTests/media/video-move-to-new-document-crash.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698