Closed Bug 1398733 Opened 4 years ago Closed 4 years ago

IPCBlobInputStream::Available() should return 0 if the remote stream has not been received yet


(Core :: DOM: File, enhancement)

Not set



Tracking Status
firefox58 --- fixed


(Reporter: baku, Assigned: baku)




(4 files)

By nsIAsyncInputStream contract, ::Available() is allowed to return 0 if the stream is not ready to return data. This is not completely supported by gecko because, in many places, we use ::Available() to know the size of the stream.

For this reason IPCBlobInputStream returns the size of the stream when before starting the retrieving of the remote Stream (before any ::AsyncWait() call). This part should not be needed.

A lot of work has been done in order to fully support nsIAsyncInputStream in gecko: bug 1397627, bug 1397810, bug 1397635 and more. This bug covers the rest: mainly docShell and HTMLFormSubmission.
Attachment #8906572 - Flags: review?(bugs)
Attachment #8906573 - Flags: review?(bugs)
Attachment #8906574 - Flags: review?(bugs)
Attachment #8906575 - Flags: review?(bugs)
These patches are green on try. Note that I haven't touched nsIWebNavigation::loadURI and ::loadURIWithOptions nor the session history.
Comment on attachment 8906572 [details] [diff] [review]

Please document in the .idl that -1 means unknown length, or "not yet available".

What the XXXbaku mean here? Are you going to fix something there or is there some bug?
Attachment #8906572 - Flags: review?(bugs) → review+
Comment on attachment 8906573 [details] [diff] [review]

Please document in nsILinkHandler.h what -1 means
Attachment #8906573 - Flags: review?(bugs) → review+
Comment on attachment 8906574 [details] [diff] [review]

aha, you're removing xxxbaku

Hopefully we have enough tests for all this code.
Could this land after FF57 branching?
Attachment #8906574 - Flags: review?(bugs) → review+
Attachment #8906575 - Flags: review?(bugs) → review+
Pushed by
nsIDocShell::internalLoad should know the size of the post data inputStream, r=smaug
nsILinkHandler::OnLinkClick and OnLinkClickSync should know the post data inputStream length, r=smaug
HTMLFormSubmission should pass the size of the post data inputStream if known, r=smaug
IPCBlobInputStream::Available() should return 0 before any AsyncWait() call, r=smaug
Depends on: 1434553
No longer depends on: 1434553
Depends on: 1455447
You need to log in before you can comment on or make changes to this bug.