Bug 1450853 - Use Generic Error for 3rdparty MediaElement r=ckerschb,smaug
*** Add test Differential Revision: https://phabricator.services.mozilla.com/D80080
This commit is contained in:
@@ -2354,7 +2354,24 @@ void HTMLMediaElement::NoSupportedMediaSourceError(
|
||||
if (mDecoder) {
|
||||
ShutdownDecoder();
|
||||
}
|
||||
mErrorSink->SetError(MEDIA_ERR_SRC_NOT_SUPPORTED, aErrorDetails);
|
||||
|
||||
bool isThirdPartyLoad = false;
|
||||
nsresult rv = NS_ERROR_NOT_AVAILABLE;
|
||||
if (mSrcAttrTriggeringPrincipal) {
|
||||
rv = mSrcAttrTriggeringPrincipal->IsThirdPartyURI(mLoadingSrc,
|
||||
&isThirdPartyLoad);
|
||||
}
|
||||
|
||||
if (NS_SUCCEEDED(rv) && isThirdPartyLoad) {
|
||||
// aErrorDetails can include sensitive details like MimeType or HTTP Status
|
||||
// Code. In case we're loading a 3rd party resource we should not leak this
|
||||
// and pass a Generic Error Message
|
||||
mErrorSink->SetError(MEDIA_ERR_SRC_NOT_SUPPORTED,
|
||||
"Failed to open media"_ns);
|
||||
} else {
|
||||
mErrorSink->SetError(MEDIA_ERR_SRC_NOT_SUPPORTED, aErrorDetails);
|
||||
}
|
||||
|
||||
RemoveMediaTracks();
|
||||
ChangeDelayLoadStatus(false);
|
||||
UpdateAudioChannelPlayingState();
|
||||
|
||||
Reference in New Issue
Block a user