| 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 _serialize(var message) { | 5 _serialize(var message) { |
| 6 return new _JsSerializer().traverse(message); | 6 return new _JsSerializer().traverse(message); |
| 7 } | 7 } |
| 8 | 8 |
| 9 class JsProxy { | 9 class JsProxy { |
| 10 SendPortSync _port; | 10 SendPortSync _port; |
| (...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 169 } | 169 } |
| 170 | 170 |
| 171 /// End of object proxy implementation. | 171 /// End of object proxy implementation. |
| 172 | 172 |
| 173 _deserialize(var message) { | 173 _deserialize(var message) { |
| 174 return new _JsDeserializer().deserialize(message); | 174 return new _JsDeserializer().deserialize(message); |
| 175 } | 175 } |
| 176 | 176 |
| 177 class _JsDeserializer extends _Deserializer { | 177 class _JsDeserializer extends _Deserializer { |
| 178 | 178 |
| 179 static final _UNSPECIFIED = const Object(); | 179 static const _UNSPECIFIED = const Object(); |
| 180 | 180 |
| 181 deserializeSendPort(List x) { | 181 deserializeSendPort(List x) { |
| 182 String tag = x[1]; | 182 String tag = x[1]; |
| 183 switch (tag) { | 183 switch (tag) { |
| 184 case 'nativejs': | 184 case 'nativejs': |
| 185 num id = x[2]; | 185 num id = x[2]; |
| 186 return new _JsSendPortSync(id); | 186 return new _JsSendPortSync(id); |
| 187 case 'dart': | 187 case 'dart': |
| 188 num isolateId = x[2]; | 188 num isolateId = x[2]; |
| 189 num portId = x[3]; | 189 num portId = x[3]; |
| (...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 368 } | 368 } |
| 369 } | 369 } |
| 370 | 370 |
| 371 get _isolateId => ReceivePortSync._isolateId; | 371 get _isolateId => ReceivePortSync._isolateId; |
| 372 | 372 |
| 373 void _dispatchEvent(String receiver, var message) { | 373 void _dispatchEvent(String receiver, var message) { |
| 374 var event = document.$dom_createEvent('TextEvent'); | 374 var event = document.$dom_createEvent('TextEvent'); |
| 375 event.initTextEvent(receiver, false, false, window, JSON.stringify(message)); | 375 event.initTextEvent(receiver, false, false, window, JSON.stringify(message)); |
| 376 window.$dom_dispatchEvent(event); | 376 window.$dom_dispatchEvent(event); |
| 377 } | 377 } |
| OLD | NEW |