Bug 1550633 - part15 : return error when we failed to create channel. r=jya

The channel might not be created correctly if we pass invaild url (eg. "invalid://url"), we should handle this error.

Differential Revision: https://phabricator.services.mozilla.com/D32038
This commit is contained in:
alwu
2019-05-24 00:40:58 +00:00
parent 59bd69da13
commit 6a7028ad36

View File

@@ -358,7 +358,11 @@ void HTMLTrackElement::LoadResource(RefPtr<WebVTTListener>&& aWebVTTListener) {
nullptr, // PerformanceStorage
loadGroup);
NS_ENSURE_TRUE_VOID(NS_SUCCEEDED(rv));
if (NS_FAILED(rv)) {
LOG("create channel failed.");
SetReadyState(TextTrackReadyState::FailedToLoad);
return;
}
channel->SetNotificationCallbacks(mListener);