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 /** Common functionality to all send ports. */ | 5 /** Common functionality to all send ports. */ |
6 class _BaseSendPort implements SendPort { | 6 class _BaseSendPort implements SendPort { |
7 /** Id for the destination isolate. */ | 7 /** Id for the destination isolate. */ |
8 final int _isolateId; | 8 final int _isolateId; |
9 | 9 |
10 _BaseSendPort(this._isolateId); | 10 const _BaseSendPort(this._isolateId); |
11 | 11 |
12 static void checkReplyTo(SendPort replyTo) { | 12 static void checkReplyTo(SendPort replyTo) { |
13 if (replyTo !== null | 13 if (replyTo !== null |
14 && replyTo is! _NativeJsSendPort | 14 && replyTo is! _NativeJsSendPort |
15 && replyTo is! _WorkerSendPort | 15 && replyTo is! _WorkerSendPort |
16 && replyTo is! _BufferingSendPort) { | 16 && replyTo is! _BufferingSendPort) { |
17 throw new Exception("SendPort.send: Illegal replyTo port type"); | 17 throw new Exception("SendPort.send: Illegal replyTo port type"); |
18 } | 18 } |
19 } | 19 } |
20 | 20 |
(...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
244 // map.getValues().forEach(_dispatch); | 244 // map.getValues().forEach(_dispatch); |
245 map.getValues().forEach((e) => _dispatch(e)); | 245 map.getValues().forEach((e) => _dispatch(e)); |
246 } | 246 } |
247 | 247 |
248 visitBufferingSendPort(_BufferingSendPort port) { | 248 visitBufferingSendPort(_BufferingSendPort port) { |
249 if (port._port == null) { | 249 if (port._port == null) { |
250 ports.add(port._futurePort); | 250 ports.add(port._futurePort); |
251 } | 251 } |
252 } | 252 } |
253 } | 253 } |
OLD | NEW |