Bug 1015662: Drop the edge from <track> to its channel once the load is completed. r=bz

This commit is contained in:
Kyle Huey 2014-06-18 13:10:24 -07:00
parent 24f9ca420b
commit cd8ab396a0
5 changed files with 18 additions and 2 deletions

View File

@ -95,8 +95,7 @@ NS_IMPL_ADDREF_INHERITED(HTMLTrackElement, Element)
NS_IMPL_RELEASE_INHERITED(HTMLTrackElement, Element)
NS_IMPL_CYCLE_COLLECTION_INHERITED(HTMLTrackElement, nsGenericHTMLElement,
mTrack, mChannel, mMediaParent,
mListener)
mTrack, mMediaParent, mListener)
NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION_INHERITED(HTMLTrackElement)
NS_INTERFACE_MAP_END_INHERITING(nsGenericHTMLElement)
@ -370,5 +369,11 @@ HTMLTrackElement::DispatchTrustedEvent(const nsAString& aName)
aName, false, false);
}
void
HTMLTrackElement::DropChannel()
{
mChannel = nullptr;
}
} // namespace dom
} // namespace mozilla

View File

@ -124,6 +124,9 @@ public:
void DispatchTrackRunnable(const nsString& aEventName);
void DispatchTrustedEvent(const nsAString& aName);
void DropChannel();
protected:
virtual JSObject* WrapNode(JSContext* aCx) MOZ_OVERRIDE;
void OnChannelRedirect(nsIChannel* aChannel, nsIChannel* aNewChannel,

View File

@ -114,6 +114,9 @@ WebVTTListener::OnStopRequest(nsIRequest* aRequest,
if (mElement->ReadyState() != TextTrackReadyState::FailedToLoad) {
mElement->SetReadyState(TextTrackReadyState::Loaded);
}
mElement->DropChannel();
return aStatus;
}

View File

@ -0,0 +1,4 @@
<!DOCTYPE html>
<body>
<video><track src="javascript:5"></track></video>
</body>

View File

@ -70,4 +70,5 @@ load offline-buffer-source-ended-1.html
HTTP load media-element-source-seek-1.html
skip-if(B2G) load oscillator-ended-1.html # intermittent B2G timeouts, bug 920338
skip-if(B2G) load oscillator-ended-2.html # intermittent B2G timeouts, bug 920338
load 1015662.html
include ../../mediasource/test/crashtests/crashtests.list