gecko-dev/dom/webidl/Fetch.webidl
Till Schneidereit ext:(%2C%20Jason%20Orendorff%20%3Cjorendorff%40mozilla.com%3E) 2cfba34b8d Bug 1385890 - Fix Streams implementation in multiple-global uses. r=baku,tcampbell,jorendorff
Streams have multiple parts that can be JS objects from different compartments.
For example, the [[reader]] internal slot of a stream can point to a reader
object in another compartment.

This patch makes the ReadableStream implementation robust against mixing and
matching stream-related objects and methods from different globals.

This also removes ReadableStreamBYOBReader and ReadableStreamBYOBRequest for
now, with a view toward enabling basic ReadableStream features by default in
bug 1389628.

Differential Revision: https://phabricator.services.mozilla.com/D8450

--HG--
extra : rebase_source : 71d73bed5bc82557efcb6b1ecb231275fd3e1189
extra : amend_source : de29f663b9929eb2858b23cc6f4e7ba97b23a28c
extra : source : f91eb962df6a06d5f51ad13caa2a4a9c2947f293
2018-10-11 14:18:43 -05:00

40 lines
1.1 KiB
Plaintext

/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
* You can obtain one at http://mozilla.org/MPL/2.0/.
*
* The origin of this IDL file is
* http://fetch.spec.whatwg.org/
*/
typedef object JSON;
typedef (Blob or BufferSource or FormData or URLSearchParams or USVString) BodyInit;
[NoInterfaceObject, Exposed=(Window,Worker)]
interface Body {
[Throws]
readonly attribute boolean bodyUsed;
[Throws]
Promise<ArrayBuffer> arrayBuffer();
[Throws]
Promise<Blob> blob();
[Throws]
Promise<FormData> formData();
[Throws]
Promise<JSON> json();
[Throws]
Promise<USVString> text();
};
// These are helper dictionaries for the parsing of a
// getReader().read().then(data) parsing.
// See more about how these 2 helpers are used in
// dom/fetch/FetchStreamReader.cpp
dictionary FetchReadableStreamReadDataDone {
boolean done = false;
};
dictionary FetchReadableStreamReadDataArray {
Uint8Array value;
};