OLD | NEW |
| (Empty) |
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | |
2 // for details. All rights reserved. Use of this source code is governed by a | |
3 // BSD-style license that can be found in the LICENSE file. | |
4 | |
5 // TODO(jacobr) add events. | |
6 class WebSocketWrappingImplementation extends EventTargetWrappingImplementation
implements WebSocket { | |
7 WebSocketWrappingImplementation._wrap(ptr) : super._wrap(ptr) {} | |
8 | |
9 String get URL() { return _ptr.URL; } | |
10 | |
11 String get binaryType() { return _ptr.binaryType; } | |
12 | |
13 void set binaryType(String value) { _ptr.binaryType = value; } | |
14 | |
15 int get bufferedAmount() { return _ptr.bufferedAmount; } | |
16 | |
17 EventListener get onclose() { return LevelDom.wrapEventListener(_ptr.onclose);
} | |
18 | |
19 void set onclose(EventListener value) { _ptr.onclose = LevelDom.unwrap(value);
} | |
20 | |
21 EventListener get onerror() { return LevelDom.wrapEventListener(_ptr.onerror);
} | |
22 | |
23 void set onerror(EventListener value) { _ptr.onerror = LevelDom.unwrap(value);
} | |
24 | |
25 EventListener get onmessage() { return LevelDom.wrapEventListener(_ptr.onmessa
ge); } | |
26 | |
27 void set onmessage(EventListener value) { _ptr.onmessage = LevelDom.unwrap(val
ue); } | |
28 | |
29 EventListener get onopen() { return LevelDom.wrapEventListener(_ptr.onopen); } | |
30 | |
31 void set onopen(EventListener value) { _ptr.onopen = LevelDom.unwrap(value); } | |
32 | |
33 String get protocol() { return _ptr.protocol; } | |
34 | |
35 int get readyState() { return _ptr.readyState; } | |
36 | |
37 void close() { | |
38 _ptr.close(); | |
39 return; | |
40 } | |
41 | |
42 bool send(String data) { | |
43 return _ptr.send(data); | |
44 } | |
45 | |
46 String get typeName() { return "WebSocket"; } | |
47 } | |
OLD | NEW |