| Index: tools/dom/src/native_DOMImplementation.dart
|
| diff --git a/tools/dom/src/native_DOMImplementation.dart b/tools/dom/src/native_DOMImplementation.dart
|
| index 2a063c0f491e188066d7cad1a7b6f1d6f5388473..a7ec6464319816676a7bbf9c527eb05601af2f8b 100644
|
| --- a/tools/dom/src/native_DOMImplementation.dart
|
| +++ b/tools/dom/src/native_DOMImplementation.dart
|
| @@ -94,7 +94,6 @@ class _Utils {
|
| static window() native "Utils_window";
|
| static forwardingPrint(String message) native "Utils_forwardingPrint";
|
| static void spawnDomFunction(Function f, int replyTo) native "Utils_spawnDomFunction";
|
| - static void spawnDomUri(String uri, int replyTo) native "Utils_spawnDomUri";
|
| static int _getNewIsolateId() native "Utils_getNewIsolateId";
|
|
|
| // The following methods were added for debugger integration to make working
|
| @@ -366,8 +365,28 @@ class _DOMStringMap extends NativeFieldWrapperClass1 implements Map<String, Stri
|
| bool get isNotEmpty => Maps.isNotEmpty(this);
|
| }
|
|
|
| +// TODO(vsm): Remove DOM isolate code. This is only used to support
|
| +// printing and timers in background isolates. Background isolates
|
| +// should just forward to the main DOM isolate instead of requiring a
|
| +// special DOM isolate.
|
| +
|
| +_makeSendPortFuture(spawnRequest) {
|
| + final completer = new Completer<SendPort>.sync();
|
| + final port = new ReceivePort();
|
| + port.receive((result, _) {
|
| + completer.complete(result);
|
| + port.close();
|
| + });
|
| + // TODO: SendPort.hashCode is ugly way to access port id.
|
| + spawnRequest(port.toSendPort().hashCode);
|
| + return completer.future;
|
| +}
|
| +
|
| +Future<SendPort> _spawnDomFunction(Function f) =>
|
| + _makeSendPortFuture((portId) { _Utils.spawnDomFunction(f, portId); });
|
| +
|
| final Future<SendPort> __HELPER_ISOLATE_PORT =
|
| - spawnDomFunction(_helperIsolateMain);
|
| + _spawnDomFunction(_helperIsolateMain);
|
|
|
| // Tricky part.
|
| // Once __HELPER_ISOLATE_PORT gets resolved, it will still delay in .then
|
|
|