Closed Bug 1392358 Opened 7 years ago Closed 7 years ago

Unify xhr.send() and remove xhr.send(nsIInputStream)

Categories

(Core :: DOM: Core & HTML, enhancement)

enhancement
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla57
Tracking Status
firefox57 --- fixed

People

(Reporter: baku, Assigned: baku)

Details

(Keywords: dev-doc-complete)

Attachments

(2 files)

from the spec, XHR should have this send method:

  void send(optional (Document or BodyInit)? body = null);

We still expose |send(nsIInputStream)| because maybe some addon was still depending on it, but because of FF57 we can stop the supporting nsIInputStream in xhr.send().
Attached patch xhr.patchSplinter Review
Attachment #8899557 - Flags: review?(bugs)
Comment on attachment 8899557 [details] [diff] [review]
xhr.patch

Better to push this to tryserver before landing.
Attachment #8899557 - Flags: review?(bugs) → review+
Attached patch xhr2.patchSplinter Review
It turned out that searchController uses the sending of an inputStream.
I would like to have this feature as a separate method, chrome only: it makes cleaner to know what is exposed to content and what is not.
Attachment #8900612 - Flags: review?(bugs)
Comment on attachment 8900612 [details] [diff] [review]
xhr2.patch

Please check if some other code might use input stream too. Like, look for XHR usage in browser chrome.
Attachment #8900612 - Flags: review?(bugs) → review+
Pushed by amarchesini@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/586a6514e046
Remove XHR.send(nsIInputStream) and unify XHR.send(params) as the spec says, r=smaug
https://hg.mozilla.org/integration/mozilla-inbound/rev/0d9988ed1c6e
Introduce  XHR.sendInputStream(nsIInputStream) chrome-only, r=smaug
https://hg.mozilla.org/mozilla-central/rev/586a6514e046
https://hg.mozilla.org/mozilla-central/rev/0d9988ed1c6e
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla57
BTW, Thunderbird was using XHR.send(nsIInputStream) and now we switched to XHR.sendInputStream(nsIInputStream), bug 1394081. It would be nice if you could think of your tiny little brother before removing interfaces without replacement. Luckily you're using it yourself.
I've updated the send() method page to provide a better explanation of its parameter, and remove any information about nsIInputStream:

https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/send

I've also added a note to the Fx57 rel notes:

https://developer.mozilla.org/en-US/Firefox/Releases/57#DOM

Let me know if that looks OK. Thanks!
Chris, the nsIInputStream overload was not exposed to the web.  It was only exposed to privileged code.  So I'm not sure whether we should document it in the "Firefox 57 for developers" documentation...
Flags: needinfo?(cmills)
(In reply to Boris Zbarsky [:bz] (still digging out from vacation mail) from comment #9)
> Chris, the nsIInputStream overload was not exposed to the web.  It was only
> exposed to privileged code.  So I'm not sure whether we should document it
> in the "Firefox 57 for developers" documentation...

OK, makes sense. I've removed it from the rel notes.
Flags: needinfo?(cmills)
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: