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 21 matching lines...) Expand all Loading... |
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 ActiveScriptWrappable, | 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 DependentLifetime, |
41 Exposed=(Window,Worker), | 41 Exposed=(Window,Worker), |
42 GarbageCollected, | |
43 ImplementedAs=DOMWebSocket, | 42 ImplementedAs=DOMWebSocket, |
44 RaisesException=Constructor, | 43 RaisesException=Constructor, |
45 ] interface WebSocket : EventTarget { | 44 ] interface WebSocket : EventTarget { |
46 readonly attribute DOMString url; | 45 readonly attribute DOMString url; |
47 | 46 |
48 // ready state | 47 // ready state |
49 const unsigned short CONNECTING = 0; | 48 const unsigned short CONNECTING = 0; |
50 const unsigned short OPEN = 1; | 49 const unsigned short OPEN = 1; |
51 const unsigned short CLOSING = 2; | 50 const unsigned short CLOSING = 2; |
52 const unsigned short CLOSED = 3; | 51 const unsigned short CLOSED = 3; |
53 readonly attribute unsigned short readyState; | 52 readonly attribute unsigned short readyState; |
54 readonly attribute unsigned long bufferedAmount; | 53 readonly attribute unsigned long bufferedAmount; |
55 | 54 |
56 // networking | 55 // networking |
57 attribute EventHandler onopen; | 56 attribute EventHandler onopen; |
58 attribute EventHandler onerror; | 57 attribute EventHandler onerror; |
59 attribute EventHandler onclose; | 58 attribute EventHandler onclose; |
60 readonly attribute DOMString extensions; | 59 readonly attribute DOMString extensions; |
61 readonly attribute DOMString protocol; | 60 readonly attribute DOMString protocol; |
62 [RaisesException] void close([Clamp] optional unsigned short code, optional
USVString reason); | 61 [RaisesException] void close([Clamp] optional unsigned short code, optional
USVString reason); |
63 | 62 |
64 // messaging | 63 // messaging |
65 attribute EventHandler onmessage; | 64 attribute EventHandler onmessage; |
66 attribute BinaryType binaryType; | 65 attribute BinaryType binaryType; |
67 [RaisesException] void send(USVString data); | 66 [RaisesException] void send(USVString data); |
68 [RaisesException] void send(Blob data); | 67 [RaisesException] void send(Blob data); |
69 [RaisesException] void send(ArrayBuffer data); | 68 [RaisesException] void send(ArrayBuffer data); |
70 [RaisesException] void send(ArrayBufferView data); | 69 [RaisesException] void send(ArrayBufferView data); |
71 }; | 70 }; |
OLD | NEW |