Allow nsHttpChannel listeners to delay OnStopRequest

RESOLVED INVALID

Status

()

Core
Networking
RESOLVED INVALID
2 years ago
2 years ago

People

(Reporter: fkiefer, Unassigned)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: [necko-next])

While trying to delay an OnStopRequest propagation I found out that this is not possible.

Scenario:
* Inject a listener in nsHttpChannel
* Return in the listeners OnStopRequest without calling any further listener (i.e. mNextListener-> ...)

I would expect now that I can call mNextListener-> in my listener at a later point in time to finish off the request.
Unfortunately that's not possible because nsHttpChannel cleans up after calling mListener->OnStopRequest [1] such that any my listener is not usable anymore.

>    CloseCacheEntry(!contentComplete);
> 
>    if (mOfflineCacheEntry)
>        CloseOfflineCacheEntry();
> 
>    if (mLoadGroup)
>        mLoadGroup->RemoveRequest(this, nullptr, status);
> 
>    // We don't need this info anymore
>    CleanRedirectCacheChainIfNecessary();
> 
>    ReleaseListeners();

[1] https://dxr.mozilla.org/mozilla-central/rev/51377a64158941f89ed73f388ae437cfa494c030/netwerk/protocol/http/nsHttpChannel.cpp#6412
Whiteboard: [necko-next]
There is no need to do this.  Correct use of mListener chaining will work well.
Status: NEW → RESOLVED
Last Resolved: 2 years ago
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.