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 import "dart:collection" show HashMap; | 5 import "dart:collection" show HashMap; |
6 import "dart:_internal"; | 6 import "dart:_internal"; |
7 | 7 |
8 patch class ReceivePort { | 8 patch class ReceivePort { |
9 /* patch */ factory ReceivePort() = _ReceivePortImpl; | 9 /* patch */ factory ReceivePort() = _ReceivePortImpl; |
10 | 10 |
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
123 | 123 |
124 bool operator==(var other) { | 124 bool operator==(var other) { |
125 return (other is _RawReceivePortImpl) && | 125 return (other is _RawReceivePortImpl) && |
126 (this._get_id() == other._get_id()); | 126 (this._get_id() == other._get_id()); |
127 } | 127 } |
128 | 128 |
129 int get hashCode { | 129 int get hashCode { |
130 return sendPort.hashCode(); | 130 return sendPort.hashCode(); |
131 } | 131 } |
132 | 132 |
| 133 Uri get remotePortUri => new Uri.https('localhost', '55'); |
| 134 |
133 /**** Internal implementation details ****/ | 135 /**** Internal implementation details ****/ |
134 _get_id() native "RawReceivePortImpl_get_id"; | 136 _get_id() native "RawReceivePortImpl_get_id"; |
135 _get_sendport() native "RawReceivePortImpl_get_sendport"; | 137 _get_sendport() native "RawReceivePortImpl_get_sendport"; |
136 | 138 |
137 // Called from the VM to retrieve the handler for a message. | 139 // Called from the VM to retrieve the handler for a message. |
138 static _lookupHandler(int id) { | 140 static _lookupHandler(int id) { |
139 var result = _handlerMap[id]; | 141 var result = _handlerMap[id]; |
140 return result; | 142 return result; |
141 } | 143 } |
142 | 144 |
(...skipping 312 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
455 static Isolate _getCurrentIsolate() { | 457 static Isolate _getCurrentIsolate() { |
456 List portAndCapabilities = _getPortAndCapabilitiesOfCurrentIsolate(); | 458 List portAndCapabilities = _getPortAndCapabilitiesOfCurrentIsolate(); |
457 return new Isolate(portAndCapabilities[0], | 459 return new Isolate(portAndCapabilities[0], |
458 pauseCapability: portAndCapabilities[1], | 460 pauseCapability: portAndCapabilities[1], |
459 terminateCapability: portAndCapabilities[2]); | 461 terminateCapability: portAndCapabilities[2]); |
460 } | 462 } |
461 | 463 |
462 static List _getPortAndCapabilitiesOfCurrentIsolate() | 464 static List _getPortAndCapabilitiesOfCurrentIsolate() |
463 native "Isolate_getPortAndCapabilitiesOfCurrentIsolate"; | 465 native "Isolate_getPortAndCapabilitiesOfCurrentIsolate"; |
464 } | 466 } |
OLD | NEW |