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

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: 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
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..17ec562fc62d5d89b961fae1bf738cad10424b5c 100644
--- a/third_party/WebKit/Source/core/html/HTMLMediaElement.cpp
+++ b/third_party/WebKit/Source/core/html/HTMLMediaElement.cpp
@@ -3044,8 +3044,11 @@ void HTMLMediaElement::userCancelledLoad()
// 1 - The user agent should cancel the fetching process.
clearMediaPlayer(-1);
- if (m_networkState == NETWORK_EMPTY || m_completelyLoaded || m_isFinalizing)
+ if (m_networkState == NETWORK_EMPTY || m_completelyLoaded || m_isFinalizing) {
+ m_readyState = HAVE_NOTHING;
philipj_slow 2015/10/20 11:24:53 Shouldn't the readyState be reset unconditionally?
Srirama 2015/10/20 11:31:34 I thought about that, but it will affect step4 in
philipj_slow 2015/10/20 11:52:00 Oh, that's annoying. I think the problem here is t
+ m_readyStateMaximum = HAVE_NOTHING;
return;
+ }
// 2 - Set the error attribute to a new MediaError object whose code attribute is set to MEDIA_ERR_ABORTED.
m_error = MediaError::create(MediaError::MEDIA_ERR_ABORTED);
@@ -3072,6 +3075,7 @@ void HTMLMediaElement::userCancelledLoad()
// Reset m_readyState since m_webMediaPlayer is gone.
m_readyState = HAVE_NOTHING;
+ m_readyStateMaximum = HAVE_NOTHING;
invalidateCachedTime();
updateMediaController();
cueTimeline().updateActiveCues(0);

Powered by Google App Engine
This is Rietveld 408576698