Closed Bug 1134325 Opened 5 years ago Closed 5 years ago
Set body of Request object used for onfetch event
There's currently a TODO comment in FetchEventRunnable::DispatchFetchEvent. It would be kind of sucky to always duplicate the request body for memory usage reasons...
Important bits: HttpBaseChannel::GetUploadStream will get an input stream for the request body. We'll probably need to rewind it after reading it, like http://mxr.mozilla.org/mozilla-central/source/netwerk/protocol/http/nsHttpChannel.cpp#6173 in DoAuthRetry. The easiest way to accomplish this bug is to just eagerly get the body, extract it to a string and create the Request object with the result. The better way to do it would be to add a lazy getter to the Request object that only extracts the stream as necessary, to avoid the performance and memory hit of duplicating it. I'd probably be fine with that as a followup?
The bit when we create the request object is http://mxr.mozilla.org/mozilla-central/source/dom/workers/ServiceWorkerManager.cpp#2246 in DispatchFetchEvent.
Attachment #8601106 - Flags: review?(josh) → review+
Attachment #8601105 - Flags: review?(mcmanus) → review+
You need to log in before you can comment on or make changes to this bug.