Chromium Code Reviews| 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 /** | 5 /** |
| 6 * Concurrent programming using _isolates_: | 6 * Concurrent programming using _isolates_: |
| 7 * independent workers that are similar to threads | 7 * independent workers that are similar to threads |
| 8 * but don't share memory, | 8 * but don't share memory, |
| 9 * communicating only via messages. | 9 * communicating only via messages. |
| 10 * | 10 * |
| (...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 199 * The handler is invoked in the root-zone ([Zone.ROOT]). | 199 * The handler is invoked in the root-zone ([Zone.ROOT]). |
| 200 */ | 200 */ |
| 201 void set handler(Function newHandler); | 201 void set handler(Function newHandler); |
| 202 | 202 |
| 203 /** | 203 /** |
| 204 * Closes the port. | 204 * Closes the port. |
| 205 * | 205 * |
| 206 * After a call to this method any incoming message is silently dropped. | 206 * After a call to this method any incoming message is silently dropped. |
| 207 */ | 207 */ |
| 208 void close(); | 208 void close(); |
| 209 | |
| 210 /** | |
| 211 * Returns a send port that sends to this receive port. | |
|
ngeoffray
2013/11/20 10:16:30
a send port -> a [SendPort].
Lasse Reichstein Nielsen
2013/11/20 10:35:26
Done.
| |
| 212 */ | |
| 213 SendPort get sendPort; | |
| 209 } | 214 } |
| 210 | 215 |
| 211 /** | 216 /** |
| 212 * Wraps unhandled exceptions thrown during isolate execution. It is | 217 * Wraps unhandled exceptions thrown during isolate execution. It is |
| 213 * used to show both the error message and the stack trace for unhandled | 218 * used to show both the error message and the stack trace for unhandled |
| 214 * exceptions. | 219 * exceptions. |
| 215 */ | 220 */ |
| 216 // TODO(floitsch): probably going to remove and replace with something else. | 221 // TODO(floitsch): probably going to remove and replace with something else. |
| 217 class _IsolateUnhandledException implements Exception { | 222 class _IsolateUnhandledException implements Exception { |
| 218 /** Message being handled when exception occurred. */ | 223 /** Message being handled when exception occurred. */ |
| 219 final message; | 224 final message; |
| 220 | 225 |
| 221 /** Wrapped exception. */ | 226 /** Wrapped exception. */ |
| 222 final source; | 227 final source; |
| 223 | 228 |
| 224 /** Trace for the wrapped exception. */ | 229 /** Trace for the wrapped exception. */ |
| 225 final StackTrace stackTrace; | 230 final StackTrace stackTrace; |
| 226 | 231 |
| 227 const _IsolateUnhandledException(this.message, this.source, this.stackTrace); | 232 const _IsolateUnhandledException(this.message, this.source, this.stackTrace); |
| 228 | 233 |
| 229 String toString() { | 234 String toString() { |
| 230 return 'IsolateUnhandledException: exception while handling message: ' | 235 return 'IsolateUnhandledException: exception while handling message: ' |
| 231 '${message} \n ' | 236 '${message} \n ' |
| 232 '${source.toString().replaceAll("\n", "\n ")}\n' | 237 '${source.toString().replaceAll("\n", "\n ")}\n' |
| 233 'original stack trace:\n ' | 238 'original stack trace:\n ' |
| 234 '${stackTrace.toString().replaceAll("\n","\n ")}'; | 239 '${stackTrace.toString().replaceAll("\n","\n ")}'; |
| 235 } | 240 } |
| 236 } | 241 } |
| OLD | NEW |