| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2009 Google Inc. All rights reserved. | 2 * Copyright (C) 2009 Google Inc. All rights reserved. |
| 3 * Copyright (C) 2010, 2011 Apple Inc. All Rights Reserved. | 3 * Copyright (C) 2010, 2011 Apple Inc. All Rights Reserved. |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions are | 6 * modification, are permitted provided that the following conditions are |
| 7 * met: | 7 * met: |
| 8 * | 8 * |
| 9 * * Redistributions of source code must retain the above copyright | 9 * * Redistributions of source code must retain the above copyright |
| 10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 27 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 28 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 28 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 29 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 29 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 30 */ | 30 */ |
| 31 | 31 |
| 32 // https://html.spec.whatwg.org/multipage/comms.html#the-websocket-interface | 32 // https://html.spec.whatwg.org/multipage/comms.html#the-websocket-interface |
| 33 | 33 |
| 34 enum BinaryType { "blob", "arraybuffer" }; | 34 enum BinaryType { "blob", "arraybuffer" }; |
| 35 | 35 |
| 36 [ | 36 [ |
| 37 DependentLifetime, | 37 ActiveScriptWrappable, |
| 38 Constructor(DOMString url, optional (DOMString or sequence<DOMString>) proto
cols), | 38 Constructor(DOMString url, optional (DOMString or sequence<DOMString>) proto
cols), |
| 39 ConstructorCallWith=ExecutionContext, | 39 ConstructorCallWith=ExecutionContext, |
| 40 DependentLifetime, |
| 40 Exposed=(Window,Worker), | 41 Exposed=(Window,Worker), |
| 41 RaisesException=Constructor, | |
| 42 GarbageCollected, | 42 GarbageCollected, |
| 43 ImplementedAs=DOMWebSocket, | 43 ImplementedAs=DOMWebSocket, |
| 44 RaisesException=Constructor, |
| 44 ] interface WebSocket : EventTarget { | 45 ] interface WebSocket : EventTarget { |
| 45 readonly attribute DOMString url; | 46 readonly attribute DOMString url; |
| 46 | 47 |
| 47 // ready state | 48 // ready state |
| 48 const unsigned short CONNECTING = 0; | 49 const unsigned short CONNECTING = 0; |
| 49 const unsigned short OPEN = 1; | 50 const unsigned short OPEN = 1; |
| 50 const unsigned short CLOSING = 2; | 51 const unsigned short CLOSING = 2; |
| 51 const unsigned short CLOSED = 3; | 52 const unsigned short CLOSED = 3; |
| 52 readonly attribute unsigned short readyState; | 53 readonly attribute unsigned short readyState; |
| 53 readonly attribute unsigned long bufferedAmount; | 54 readonly attribute unsigned long bufferedAmount; |
| 54 | 55 |
| 55 // networking | 56 // networking |
| 56 attribute EventHandler onopen; | 57 attribute EventHandler onopen; |
| 57 attribute EventHandler onerror; | 58 attribute EventHandler onerror; |
| 58 attribute EventHandler onclose; | 59 attribute EventHandler onclose; |
| 59 readonly attribute DOMString extensions; | 60 readonly attribute DOMString extensions; |
| 60 readonly attribute DOMString protocol; | 61 readonly attribute DOMString protocol; |
| 61 [RaisesException] void close([Clamp] optional unsigned short code, optional
USVString reason); | 62 [RaisesException] void close([Clamp] optional unsigned short code, optional
USVString reason); |
| 62 | 63 |
| 63 // messaging | 64 // messaging |
| 64 attribute EventHandler onmessage; | 65 attribute EventHandler onmessage; |
| 65 attribute BinaryType binaryType; | 66 attribute BinaryType binaryType; |
| 66 [RaisesException] void send(USVString data); | 67 [RaisesException] void send(USVString data); |
| 67 [RaisesException] void send(Blob data); | 68 [RaisesException] void send(Blob data); |
| 68 [RaisesException] void send(ArrayBuffer data); | 69 [RaisesException] void send(ArrayBuffer data); |
| 69 [RaisesException] void send(ArrayBufferView data); | 70 [RaisesException] void send(ArrayBufferView data); |
| 70 }; | 71 }; |
| OLD | NEW |