Send an observer notification with the decodedBodySize before calling OnStopRequest listeners
Categories
(Core :: Networking, task, P2)
Tracking
()
Tracking | Status | |
---|---|---|
firefox125 | --- | fixed |
People
(Reporter: jdescottes, Assigned: valentin)
References
Details
(Whiteboard: [necko-triaged])
Attachments
(1 file)
To monitor network events DevTools and WebDriver BiDi setup a response listener that will decode the input stream of the response in the parent process. We use this to get the response body and the response's decoded body size. The closing of the input stream is also used to consider a request as "completed". For BiDi, this is when we emit the network.responseCompleted
event.
However this decoding can be async and might be completed significantly later than the actual "stop" of the request. This can be an issue for webdriver BiDi, because the network.responseCompleted
event might be fired after the domContentLoaded
and load
events are fired (for the special case of a navigation request).
We would like to stop decoding the input stream in the parent process, and instead try to retrieve the information we need from the content processes, where the decoding already happens anyway.
At the moment, BiDi doesn't need the response body, so we only need a solution for the decoded body size.
Could we add an observer notification with the decoded body size, emitted in the content process before the OnStopRequest listeners are called ?
BiDi would listen to this notification and take care of sending it to the parent process, so that we avoid extra IPC when BiDi is not enabled.
Reporter | ||
Comment 1•7 months ago
|
||
Valentin, we discussed about something similar last year, can you check if the summary above makes sense?
Assignee | ||
Comment 2•7 months ago
|
||
Hi Julian,
Yes, I think that makes sense.
Just to clarify, the problem is that the content process request loads and fires the load
event, but for some reason we're not able to get the decodedBodySize from the channel that triggers the load event? Or is devtools not able to access the channel for the load
event?
Reporter | ||
Comment 3•7 months ago
|
||
As of now we are only monitoring channels in the parent process, and there decodedBodySize
is always set 0.
We could add some logic in content processes in order to get the channel that triggered domContentLoaded
& load
events, read decodedBodySize
there and send it to the parent process before we send domContentLoaded
& load
. Typically we could look this up when we catch domContentLoaded
.
But we need the decodedBodySize
information for all requests, not only navigation requests. For a non-navigation request we would not really know where to get the decodedBodySize. That's why having a dedicated notification which is consistently emitted before OnStopRequest listeners are called seems like a good fit.
Assignee | ||
Comment 4•7 months ago
|
||
This notification would be sent by HttpChannelChild before
calling onStopRequest for a channel.
This patch also updates some comments regarding the on stop topic
which referenced the non-existent http-on-stop-connect
Updated•7 months ago
|
Assignee | ||
Updated•7 months ago
|
Comment 6•7 months ago
|
||
bugherder |
Description
•