OLD | NEW |
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 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. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
| 5 part of html; |
| 6 |
5 _serialize(var message) { | 7 _serialize(var message) { |
6 return new _JsSerializer().traverse(message); | 8 return new _JsSerializer().traverse(message); |
7 } | 9 } |
8 | 10 |
9 class _JsSerializer extends _Serializer { | 11 class _JsSerializer extends _Serializer { |
10 | 12 |
11 visitSendPortSync(SendPortSync x) { | 13 visitSendPortSync(SendPortSync x) { |
12 if (x is _JsSendPortSync) return visitJsSendPortSync(x); | 14 if (x is _JsSendPortSync) return visitJsSendPortSync(x); |
13 if (x is _LocalSendPortSync) return visitLocalSendPortSync(x); | 15 if (x is _LocalSendPortSync) return visitLocalSendPortSync(x); |
14 if (x is _RemoteSendPortSync) return visitRemoteSendPortSync(x); | 16 if (x is _RemoteSendPortSync) return visitRemoteSendPortSync(x); |
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
191 } | 193 } |
192 | 194 |
193 get _isolateId => ReceivePortSync._isolateId; | 195 get _isolateId => ReceivePortSync._isolateId; |
194 | 196 |
195 void _dispatchEvent(String receiver, var message) { | 197 void _dispatchEvent(String receiver, var message) { |
196 var event = new CustomEvent(receiver, false, false, JSON.stringify(message)); | 198 var event = new CustomEvent(receiver, false, false, JSON.stringify(message)); |
197 window.$dom_dispatchEvent(event); | 199 window.$dom_dispatchEvent(event); |
198 } | 200 } |
199 | 201 |
200 String _getPortSyncEventData(CustomEvent event) => event.detail; | 202 String _getPortSyncEventData(CustomEvent event) => event.detail; |
OLD | NEW |