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

Unified Diff: lib/src/util/isolate_wrapper.dart

Issue 1085883003: Make IsolateWrapper compatible with the 1.11 isolate API changes. (Closed) Base URL: git@github.com:dart-lang/test@master
Patch Set: Created 5 years, 8 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/src/util/dart.dart ('k') | test/runner/isolate_listener_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/src/util/isolate_wrapper.dart
diff --git a/lib/src/util/isolate_wrapper.dart b/lib/src/util/isolate_wrapper.dart
index 9ac7c93d8bbf64406c11d47fcd05b844151d3bed..51db8959f2e90674b9a806a44a12078910696bf4 100644
--- a/lib/src/util/isolate_wrapper.dart
+++ b/lib/src/util/isolate_wrapper.dart
@@ -16,7 +16,10 @@ import 'io.dart';
/// This is necessary to delete the source directory of the isolate only once
/// the Isolate completes. Note that the callback won't necessarily fire before
/// the Isolate is killed, but it comes close enough for our purposes.
-class IsolateWrapper implements Isolate {
+///
+/// This avoids implementing Isolate because there's no interface that's
+/// compatible with both Dart before 1.11 and Dart after 1.11.
+class IsolateWrapper {
final Isolate _inner;
final Function _onExit;
@@ -32,8 +35,7 @@ class IsolateWrapper implements Isolate {
void addOnExitListener(SendPort port) => _inner.addOnExitListener(port);
Capability pause([Capability resumeCapability]) =>
_inner.pause(resumeCapability);
- void ping(SendPort responsePort, [int pingType=Isolate.IMMEDIATE]) =>
- _inner.ping(responsePort, pingType);
+ void ping(SendPort responsePort) => _inner.ping(responsePort);
void removeErrorListener(SendPort port) => _inner.removeErrorListener(port);
void removeOnExitListener(SendPort port) => _inner.removeOnExitListener(port);
void resume(Capability resumeCapability) => _inner.resume(resumeCapability);
@@ -41,8 +43,8 @@ class IsolateWrapper implements Isolate {
_inner.setErrorsFatal(errorsAreFatal);
String toString() => _inner.toString();
- void kill([int priority=Isolate.BEFORE_NEXT_EVENT]) {
- if (supportsIsolateKill) _inner.kill(priority);
+ void kill() {
+ if (supportsIsolateKill) _inner.kill();
_onExit();
}
}
« no previous file with comments | « lib/src/util/dart.dart ('k') | test/runner/isolate_listener_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698