Closed Bug 1627275 Opened 5 years ago Closed 5 years ago

ScriptLoader::OnStreamComplete never returns a failure

Categories

(Core :: DOM: Core & HTML, defect, P2)

defect

Tracking

()

RESOLVED FIXED
mozilla77
Tracking Status
firefox77 --- fixed

People

(Reporter: mayhemer, Assigned: mayhemer)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

Please see this searchfox. The only caller to ScriptLoader::OnStreamComplete is ScriptLoadHandler::OnStreamComplete which in case of a failure should clear the cache and propagate the error to its caller.

But apparently ScriptLoader::OnStreamComplete can never return a failure.

This (with patch for bug 1618292 applied) leads to sending load event notification to a <link preload> tag regardless it's expected to get error notification when the resource doesn't exist on the server (we get 404).

Baku, you've been involved in this code in the past. Should ScriptLoader::OnStreamComplete return rv instead?

Flags: needinfo?(amarchesini)

Baku, you've been involved in this code in the past. Should ScriptLoader::OnStreamComplete return rv instead?

Yes, it seems totally safe to expose rv. And we already check the return value here:
https://searchfox.org/mozilla-central/rev/4ccefc3181f9d237ef4ca8bd17b4e7c101ddf7b5/dom/script/ScriptLoadHandler.cpp#405

Flags: needinfo?(amarchesini)
Assignee: nobody → honzab.moz
Status: NEW → ASSIGNED
Attachment #9138116 - Attachment description: Bug 1627275 - Let ScriptLoader::OnStreamComplete return an error when veritication or processing of the script fails, r=baku → Bug 1627275 - Let ScriptLoader::OnStreamComplete return an error when verification or processing of the script fails, r=baku
Pushed by honzab.moz@firemni.cz: https://hg.mozilla.org/integration/autoland/rev/17f170a040e9 Let ScriptLoader::OnStreamComplete return an error when verification or processing of the script fails, r=baku
Priority: -- → P2
Status: ASSIGNED → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla77
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: