Closed Bug 1398733 Opened 3 years ago Closed 3 years ago

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

Categories

(Core :: DOM: File, enhancement)

enhancement
Not set

Tracking

()

RESOLVED FIXED
mozilla58
Tracking Status
firefox58 --- fixed

People

(Reporter: baku, Assigned: baku)

References

Details

Attachments

(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]
nsIDocShell::InternalLoad

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]
nsILinkHandler::OnLinkClick

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

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 amarchesini@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/b28ff5ddabbe
nsIDocShell::internalLoad should know the size of the post data inputStream, r=smaug
https://hg.mozilla.org/integration/mozilla-inbound/rev/e77471a16ff7
nsILinkHandler::OnLinkClick and OnLinkClickSync should know the post data inputStream length, r=smaug
https://hg.mozilla.org/integration/mozilla-inbound/rev/90af1cb3c4e3
HTMLFormSubmission should pass the size of the post data inputStream if known, r=smaug
https://hg.mozilla.org/integration/mozilla-inbound/rev/726caa0c36ba
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.