Backed out changeset 0c5a4939300c (bug 1454889) for causing frequent Leaks (Bug 1378025). a=backout

This commit is contained in:
Narcis Beleuzu
2018-05-07 12:06:25 +03:00
parent 30bc243af0
commit 8fd26b0fe8
14 changed files with 222 additions and 27 deletions

View File

@@ -2097,7 +2097,8 @@ void HTMLMediaElement::SelectResource()
mMediaSource = mSrcMediaSource;
DDLINKCHILD("mediasource", mMediaSource.get());
UpdatePreloadAction();
if (mPreloadAction == HTMLMediaElement::PRELOAD_NONE && !mMediaSource) {
if (mPreloadAction == HTMLMediaElement::PRELOAD_NONE &&
!IsMediaStreamURI(mLoadingSrc) && !mMediaSource) {
// preload:none media, suspend the load here before we make any
// network requests.
SuspendLoad();
@@ -2426,7 +2427,8 @@ void HTMLMediaElement::LoadFromSourceChildren()
NS_ASSERTION(mNetworkState == NETWORK_LOADING,
"Network state should be loading");
if (mPreloadAction == HTMLMediaElement::PRELOAD_NONE && !mMediaSource) {
if (mPreloadAction == HTMLMediaElement::PRELOAD_NONE &&
!IsMediaStreamURI(mLoadingSrc) && !mMediaSource) {
// preload:none media, suspend the load here before we make any
// network requests.
SuspendLoad();
@@ -2575,6 +2577,20 @@ HTMLMediaElement::LoadResource()
return rv;
}
if (IsMediaStreamURI(mLoadingSrc)) {
RefPtr<DOMMediaStream> stream;
nsresult rv = NS_GetStreamForMediaStreamURI(mLoadingSrc, getter_AddRefs(stream));
if (NS_FAILED(rv)) {
nsAutoString spec;
GetCurrentSrc(spec);
const char16_t* params[] = { spec.get() };
ReportLoadError("MediaLoadInvalidURI", params, ArrayLength(params));
return MediaResult(rv, "MediaLoadInvalidURI");
}
SetupSrcMediaStreamPlayback(stream);
return NS_OK;
}
if (mMediaSource) {
MediaDecoderInit decoderInit(
this,