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

Side by Side Diff: lib/src/isolate_wrapper.dart

Issue 939303003: pkg/unittest: Fix warnings reported by analyzer (Closed) Base URL: https://github.com/dart-lang/unittest.git@master
Patch Set: nits Created 5 years, 10 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 unified diff | Download patch
« no previous file with comments | « lib/src/dart.dart ('k') | pubspec.yaml » ('j') | pubspec.yaml » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2015, 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 library unittest.isolate_wrapper; 5 library unittest.isolate_wrapper;
6 6
7 import 'dart:async';
7 import 'dart:isolate'; 8 import 'dart:isolate';
8 9
9 // TODO(nweiz): Get rid of this when issue 6610 is fixed. 10 // TODO(nweiz): Get rid of this when issue 6610 is fixed.
10 /// This is a wrapper around an [Isolate] that supports a callback that will 11 /// This is a wrapper around an [Isolate] that supports a callback that will
11 /// fire when [Isolate.exit] is called. 12 /// fire when [Isolate.exit] is called.
12 /// 13 ///
13 /// This is necessary to delete the source directory of the isolate only once 14 /// This is necessary to delete the source directory of the isolate only once
14 /// the Isolate completes. Note that the callback won't necessarily fire before 15 /// the Isolate completes. Note that the callback won't necessarily fire before
15 /// the Isolate is killed, but it comes close enough for our purposes. 16 /// the Isolate is killed, but it comes close enough for our purposes.
16 class IsolateWrapper implements Isolate { 17 class IsolateWrapper implements Isolate {
17 final Isolate _inner; 18 final Isolate _inner;
18 19
19 final Function _onExit; 20 final Function _onExit;
20 21
22 Capability get pauseCapability => _inner.pauseCapability;
21 SendPort get controlPort => _inner.controlPort; 23 SendPort get controlPort => _inner.controlPort;
22 Stream get errors => _inner.errors; 24 Stream get errors => _inner.errors;
23 Capability get terminateCapability => _inner.terminateCapability; 25 Capability get terminateCapability => _inner.terminateCapability;
24 26
25 IsolateWrapper(this._inner, this._onExit); 27 IsolateWrapper(this._inner, this._onExit);
26 28
27 void addErrorListener(SendPort port) => _inner.addErrorListener(port); 29 void addErrorListener(SendPort port) => _inner.addErrorListener(port);
28 void addOnExitListener(SendPort port) => _inner.addOnExitListener(port); 30 void addOnExitListener(SendPort port) => _inner.addOnExitListener(port);
29 Capability pause([Capability resumeCapability]) => 31 Capability pause([Capability resumeCapability]) =>
30 _inner.pause(resumeCapability); 32 _inner.pause(resumeCapability);
31 void ping(SendPort responsePort, [int pingType=Isolate.IMMEDIATE]) => 33 void ping(SendPort responsePort, [int pingType=Isolate.IMMEDIATE]) =>
32 _inner.ping(responsePort, pingType); 34 _inner.ping(responsePort, pingType);
33 void removeErrorListener(SendPort port) => _inner.removeErrorListener(port); 35 void removeErrorListener(SendPort port) => _inner.removeErrorListener(port);
34 void removeOnExitListener(SendPort port) => _inner.removeOnExitListener(port); 36 void removeOnExitListener(SendPort port) => _inner.removeOnExitListener(port);
35 void resume(Capability resumeCapability) => _inner.resume(resumeCapability); 37 void resume(Capability resumeCapability) => _inner.resume(resumeCapability);
36 void setErrorsFatal(bool errorsAreFatal) => 38 void setErrorsFatal(bool errorsAreFatal) =>
37 _inner.setErrorsFatal(errorsAreFatal); 39 _inner.setErrorsFatal(errorsAreFatal);
38 String toString() => _inner.toString(); 40 String toString() => _inner.toString();
39 41
40 void kill([int priority=Isolate.BEFORE_NEXT_EVENT]) { 42 void kill([int priority=Isolate.BEFORE_NEXT_EVENT]) {
41 _inner.kill(priority); 43 _inner.kill(priority);
42 _onExit(); 44 _onExit();
43 } 45 }
44 } 46 }
OLDNEW
« no previous file with comments | « lib/src/dart.dart ('k') | pubspec.yaml » ('j') | pubspec.yaml » ('J')

Powered by Google App Engine
This is Rietveld 408576698