The size of WebSocket's buffered_amount was changed[1] after an issue I opened, which I found while working on WebSocket previously[2]. @jdm suggested I make a PR updating Servo reflecting this, and so I have! As always, I'd like to hear any feedback on anything I can do to improve this. [1] https://github.com/whatwg/html/issues/296 [2] https://github.com/servo/servo/pull/8218#issuecomment-152021737 point 5) Source-Repo: https://github.com/servo/servo Source-Revision: 6844adbe2dd2730cbc13df0a78736386501cad02
36 lines
1.3 KiB
Plaintext
36 lines
1.3 KiB
Plaintext
/* 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/. */
|
|
|
|
// https://html.spec.whatwg.org/multipage/#the-websocket-interface
|
|
|
|
enum BinaryType { "blob", "arraybuffer" };
|
|
|
|
[Constructor(DOMString url, optional /*(*/DOMString /*or DOMString[])*/ protocols)]
|
|
interface WebSocket : EventTarget {
|
|
readonly attribute DOMString url;
|
|
//ready state
|
|
const unsigned short CONNECTING = 0;
|
|
const unsigned short OPEN = 1;
|
|
const unsigned short CLOSING = 2;
|
|
const unsigned short CLOSED = 3;
|
|
readonly attribute unsigned short readyState;
|
|
readonly attribute unsigned long long bufferedAmount;
|
|
|
|
//networking
|
|
attribute EventHandler onopen;
|
|
attribute EventHandler onerror;
|
|
attribute EventHandler onclose;
|
|
//readonly attribute DOMString extensions;
|
|
readonly attribute DOMString protocol;
|
|
[Throws] void close([Clamp] optional unsigned short code, optional USVString reason);
|
|
|
|
//messaging
|
|
attribute EventHandler onmessage;
|
|
attribute BinaryType binaryType;
|
|
[Throws] void send(USVString data);
|
|
[Throws] void send(Blob data);
|
|
//void send(ArrayBuffer data);
|
|
//void send(ArrayBufferView data);
|
|
};
|