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

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

Issue 1858073002: Media: Report HTMLMediaElement player errors to devtools console Base URL: https://chromium.googlesource.com/chromium/src.git@fix_472253_1
Patch Set: Rebase, attempt to fix 1 regressed expectation, temporary logging for investigating 2 other regress… Created 4 years, 8 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/Source/core/html/HTMLMediaElement.h ('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 72b4c7a7d160b5c4fef9ad6a5aed5e573f7eccf8..703773364b11cffccadb65b7c6f82a1210f35b4f 100644
--- a/third_party/WebKit/Source/core/html/HTMLMediaElement.cpp
+++ b/third_party/WebKit/Source/core/html/HTMLMediaElement.cpp
@@ -1317,6 +1317,20 @@ void HTMLMediaElement::waitForSourceChange()
layoutObject()->updateFromElement();
}
+void HTMLMediaElement::reportPlayerErrorToDevToolsConsole()
+{
+ WTF_LOG(Media, "HTMLMediaElement::reportPlayerErrorToDevToolsConsole(%p)", this);
+
+ if (!m_webMediaPlayer)
+ return;
+
+ const WebString& message = m_webMediaPlayer->getErrorMessage();
+ if (message.isEmpty())
+ return;
+
+ document().addConsoleMessage(ConsoleMessage::create(JSMessageSource, ErrorMessageLevel, message));
+}
+
void HTMLMediaElement::noneSupported()
{
WTF_LOG(Media, "HTMLMediaElement::noneSupported(%p)", this);
@@ -1331,6 +1345,7 @@ void HTMLMediaElement::noneSupported()
// 1 - Set the error attribute to a new MediaError object whose code attribute is set to
// MEDIA_ERR_SRC_NOT_SUPPORTED.
m_error = MediaError::create(MediaError::MEDIA_ERR_SRC_NOT_SUPPORTED);
+ reportPlayerErrorToDevToolsConsole();
// 2 - Forget the media element's media-resource-specific text tracks.
forgetResourceSpecificTracks();
@@ -1368,6 +1383,7 @@ void HTMLMediaElement::mediaEngineError(MediaError* err)
// 2 - Set the error attribute to a new MediaError object whose code attribute is
// set to MEDIA_ERR_NETWORK/MEDIA_ERR_DECODE.
m_error = err;
+ reportPlayerErrorToDevToolsConsole();
// 3 - Queue a task to fire a simple event named error at the media element.
scheduleEvent(EventTypeNames::error);
« no previous file with comments | « third_party/WebKit/Source/core/html/HTMLMediaElement.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698