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 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
120 SendPort get sendPort { | 120 SendPort get sendPort { |
121 return _get_sendport(); | 121 return _get_sendport(); |
122 } | 122 } |
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'); | 133 Uri get remotePortUri => new Uri.https('localhost', '55'); |
134 | 134 |
135 /**** Internal implementation details ****/ | 135 /**** Internal implementation details ****/ |
136 _get_id() native "RawReceivePortImpl_get_id"; | 136 _get_id() native "RawReceivePortImpl_get_id"; |
137 _get_sendport() native "RawReceivePortImpl_get_sendport"; | 137 _get_sendport() native "RawReceivePortImpl_get_sendport"; |
138 | 138 |
139 // Called from the VM to retrieve the handler for a message. | 139 // Called from the VM to retrieve the handler for a message. |
140 static _lookupHandler(int id) { | 140 static _lookupHandler(int id) { |
(...skipping 342 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
483 static Isolate _getCurrentIsolate() { | 483 static Isolate _getCurrentIsolate() { |
484 List portAndCapabilities = _getPortAndCapabilitiesOfCurrentIsolate(); | 484 List portAndCapabilities = _getPortAndCapabilitiesOfCurrentIsolate(); |
485 return new Isolate(portAndCapabilities[0], | 485 return new Isolate(portAndCapabilities[0], |
486 pauseCapability: portAndCapabilities[1], | 486 pauseCapability: portAndCapabilities[1], |
487 terminateCapability: portAndCapabilities[2]); | 487 terminateCapability: portAndCapabilities[2]); |
488 } | 488 } |
489 | 489 |
490 static List _getPortAndCapabilitiesOfCurrentIsolate() | 490 static List _getPortAndCapabilitiesOfCurrentIsolate() |
491 native "Isolate_getPortAndCapabilitiesOfCurrentIsolate"; | 491 native "Isolate_getPortAndCapabilitiesOfCurrentIsolate"; |
492 } | 492 } |
OLD | NEW |