Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(556)

Unified Diff: lib/isolate/frog/ports.dart

Issue 10696091: Refactor the message serialization code a bit so we can start playing with it for JS interop purpos… (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Remove extra length. Created 8 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « lib/isolate/frog/messages.dart ('k') | lib/isolate/isolate_leg.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/isolate/frog/ports.dart
diff --git a/lib/isolate/frog/ports.dart b/lib/isolate/frog/ports.dart
index 68081a6a3059455d2d7905179d2b05ed6a9eb6aa..9160c634542dfde279116efbcc0bbf36c4b892b2 100644
--- a/lib/isolate/frog/ports.dart
+++ b/lib/isolate/frog/ports.dart
@@ -220,33 +220,33 @@ _waitForPendingPorts(var message, void callback()) {
/** Visitor that finds all unresolved [SendPort]s in a message. */
class _PendingSendPortFinder extends _MessageTraverser {
List<Future<SendPort>> ports;
- _PendingSendPortFinder() : super(), ports = [];
+ _PendingSendPortFinder() : super(), ports = [] {
+ _visited = new _JsVisitedMap();
+ }
visitPrimitive(x) {}
- visitNativeJsSendPort(_NativeJsSendPort port) {}
- visitWorkerSendPort(_WorkerSendPort port) {}
visitList(List list) {
- final visited = _getInfo(list);
- if (visited !== null) return;
- _attachInfo(list, true);
+ final seen = _visited[list];
+ if (seen !== null) return;
+ _visited[list] = true;
// TODO(sigmund): replace with the following: (bug #1660)
// list.forEach(_dispatch);
list.forEach((e) => _dispatch(e));
}
visitMap(Map map) {
- final visited = _getInfo(map);
- if (visited !== null) return;
+ final seen = _visited[map];
+ if (seen !== null) return;
- _attachInfo(map, true);
+ _visited[map] = true;
// TODO(sigmund): replace with the following: (bug #1660)
// map.getValues().forEach(_dispatch);
map.getValues().forEach((e) => _dispatch(e));
}
- visitBufferingSendPort(_BufferingSendPort port) {
- if (port._port == null) {
+ visitSendPort(SendPort port) {
+ if (port is _BufferingSendPort && port._port == null) {
ports.add(port._futurePort);
}
}
« no previous file with comments | « lib/isolate/frog/messages.dart ('k') | lib/isolate/isolate_leg.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698