| OLD | NEW |
| 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 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 | 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 #library("proxy"); |
| 6 |
| 5 /** | 7 /** |
| 6 * Base class for all RpcProxy's | 8 * Base class for all RpcProxy's |
| 7 * | 9 * |
| 8 * RpcProxy objects run in the "client" isolate and have a SendPort which | 10 * RpcProxy objects run in the "client" isolate and have a SendPort which |
| 9 * they use to send messages to RpcReceiver objects running in a "service" | 11 * they use to send messages to RpcReceiver objects running in a "service" |
| 10 * isolate. | 12 * isolate. |
| 11 */ | 13 */ |
| 12 | 14 |
| 13 class RpcProxy { | 15 class RpcProxy { |
| 14 final Future<SendPort> futurePort; | 16 final Future<SendPort> futurePort; |
| (...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 228 if (object === null || !(object is String)) { | 230 if (object === null || !(object is String)) { |
| 229 return null; | 231 return null; |
| 230 } | 232 } |
| 231 String s = object; | 233 String s = object; |
| 232 if (!s.startsWith(prefix)) { | 234 if (!s.startsWith(prefix)) { |
| 233 return null; | 235 return null; |
| 234 } | 236 } |
| 235 return new RpcException(s.substring(prefix.length, s.length)); | 237 return new RpcException(s.substring(prefix.length, s.length)); |
| 236 } | 238 } |
| 237 } | 239 } |
| OLD | NEW |