Open Bug 2089930 Opened 13 days ago Updated 9 days ago

Only dispatch the background release of `mUploadStream` in `nsHttpChannel` when there is an upload stream

Categories

(Core :: Networking: HTTP, task, P2)

task

Tracking

()

People

(Reporter: leggert, Unassigned)

References

Details

(Keywords: good-first-bug, Whiteboard: [necko-triaged])

Since bug 1940224, nsHttpChannel::ContinueOnStopRequest releases mUploadStream by moving it into a runnable dispatched with NS_DispatchBackgroundTask, so that closing a file-backed upload stream does not block the main thread. The dispatch is unconditional, so every HTTP channel, including the vast majority that have no request body (e.g. GET), allocates a runnable and queues it on the background thread pool just to release a null pointer.

Wrap the dispatch in if (mUploadStream) { ... }. Behavior for channels with an upload stream stays the same.

Code: nsHttpChannel::ContinueOnStopRequest in netwerk/protocol/http/nsHttpChannel.cpp (the runnable is named "release HttpBaseChannel::mUploadStream").

Severity: -- → N/A
Priority: -- → P2
Whiteboard: [necko-triaged]
You need to log in before you can comment on or make changes to this bug.