Summary: | Add support for MediaError.message | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Chris Dumez <cdumez> | ||||||||
Component: | Media | Assignee: | Chris Dumez <cdumez> | ||||||||
Status: | RESOLVED FIXED | ||||||||||
Severity: | Normal | CC: | achristensen, calvaris, changseok, darin, eric.carlson, esprehn+autocc, ews-watchlist, glenn, gyuyoung.kim, jer.noble, kondapallykalyan, peng.liu6, philip, philipj, sam, sergio, webkit-bug-importer | ||||||||
Priority: | P2 | Keywords: | InRadar | ||||||||
Version: | WebKit Nightly Build | ||||||||||
Hardware: | Unspecified | ||||||||||
OS: | Unspecified | ||||||||||
Attachments: |
|
Description
Chris Dumez
2021-07-15 16:11:52 PDT
Created attachment 433634 [details]
Patch
Comment on attachment 433634 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=433634&action=review > Source/WebCore/html/HTMLMediaElement.cpp:2072 > + m_error = MediaError::create(MediaError::MEDIA_ERR_SRC_NOT_SUPPORTED, "Unsupported source type"_s); Do Chrome and Firefox use these same strings? Comment on attachment 433634 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=433634&action=review >> Source/WebCore/html/HTMLMediaElement.cpp:2072 >> + m_error = MediaError::create(MediaError::MEDIA_ERR_SRC_NOT_SUPPORTED, "Unsupported source type"_s); > > Do Chrome and Firefox use these same strings? Can these strings be derived from m_code instead of storing an additional String an increasing the size of MediaError? (In reply to Alex Christensen from comment #3) > Comment on attachment 433634 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=433634&action=review > > >> Source/WebCore/html/HTMLMediaElement.cpp:2072 > >> + m_error = MediaError::create(MediaError::MEDIA_ERR_SRC_NOT_SUPPORTED, "Unsupported source type"_s); > > > > Do Chrome and Firefox use these same strings? > > Can these strings be derived from m_code instead of storing an additional > String an increasing the size of MediaError? While I did the strict minimum in this patch, you could imagine providing more useful error messages in the future. What's the point of having a message attribute if it brings nothing more than the error code attribute? Comment on attachment 433634 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=433634&action=review > Source/WebCore/html/MediaError.h:46 > + static Ref<MediaError> create(Code code, const String& message) This could at least be an r-value then. (In reply to Alex Christensen from comment #5) > Comment on attachment 433634 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=433634&action=review > > > Source/WebCore/html/MediaError.h:46 > > + static Ref<MediaError> create(Code code, const String& message) > > This could at least be an r-value then. Sure. Created attachment 433644 [details]
Patch
Created attachment 433658 [details]
Patch
Committed r279978 (239721@main): <https://commits.webkit.org/239721@main> All reviewed patches have been landed. Closing bug and clearing flags on attachment 433658 [details]. *** Bug 170761 has been marked as a duplicate of this bug. *** |