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 ActiveDOMObject, | 37 DependentLifetime, |
38 // FIXME: Spec has DOMString[]. https://www.w3.org/Bugs/Public/show_bug.cgi?
id=28102 | |
39 Constructor(DOMString url, optional (DOMString or sequence<DOMString>) proto
cols), | 38 Constructor(DOMString url, optional (DOMString or sequence<DOMString>) proto
cols), |
40 ConstructorCallWith=ExecutionContext, | 39 ConstructorCallWith=ExecutionContext, |
41 Exposed=(Window,Worker), | 40 Exposed=(Window,Worker), |
42 TypeChecking=Interface, | |
43 RaisesException=Constructor, | 41 RaisesException=Constructor, |
44 GarbageCollected, | 42 GarbageCollected, |
45 ImplementedAs=DOMWebSocket, | 43 ImplementedAs=DOMWebSocket, |
46 ] interface WebSocket : EventTarget { | 44 ] interface WebSocket : EventTarget { |
47 readonly attribute DOMString url; | 45 readonly attribute DOMString url; |
48 | 46 |
49 // ready state | 47 // ready state |
50 const unsigned short CONNECTING = 0; | 48 const unsigned short CONNECTING = 0; |
51 const unsigned short OPEN = 1; | 49 const unsigned short OPEN = 1; |
52 const unsigned short CLOSING = 2; | 50 const unsigned short CLOSING = 2; |
(...skipping 10 matching lines...) Expand all Loading... |
63 [RaisesException] void close([Clamp] optional unsigned short code, optional
USVString reason); | 61 [RaisesException] void close([Clamp] optional unsigned short code, optional
USVString reason); |
64 | 62 |
65 // messaging | 63 // messaging |
66 attribute EventHandler onmessage; | 64 attribute EventHandler onmessage; |
67 attribute BinaryType binaryType; | 65 attribute BinaryType binaryType; |
68 [RaisesException] void send(USVString data); | 66 [RaisesException] void send(USVString data); |
69 [RaisesException] void send(Blob data); | 67 [RaisesException] void send(Blob data); |
70 [RaisesException] void send(ArrayBuffer data); | 68 [RaisesException] void send(ArrayBuffer data); |
71 [RaisesException] void send(ArrayBufferView data); | 69 [RaisesException] void send(ArrayBufferView data); |
72 }; | 70 }; |
OLD | NEW |