OLD | NEW |
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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 utils; | 5 library utils; |
6 | 6 |
7 import 'dart:io'; | 7 import 'dart:io'; |
8 import 'dart:math' show min; | |
9 import 'dart:convert'; | 8 import 'dart:convert'; |
10 | 9 |
11 part 'legacy_path.dart'; | 10 import 'path.dart'; |
12 | 11 |
13 // This is the maximum time we expect stdout/stderr of subprocesses to deliver | 12 // This is the maximum time we expect stdout/stderr of subprocesses to deliver |
14 // data after we've got the exitCode. | 13 // data after we've got the exitCode. |
15 const Duration MAX_STDIO_DELAY = const Duration(seconds: 30); | 14 const Duration MAX_STDIO_DELAY = const Duration(seconds: 30); |
16 | 15 |
17 String MAX_STDIO_DELAY_PASSED_MESSAGE = | 16 String MAX_STDIO_DELAY_PASSED_MESSAGE = |
18 """Not waiting for stdout/stderr from subprocess anymore | 17 """Not waiting for stdout/stderr from subprocess anymore |
19 ($MAX_STDIO_DELAY passed). Please note that this could be an indicator | 18 ($MAX_STDIO_DELAY passed). Please note that this could be an indicator |
20 that there is a hanging process which we were unable to kill."""; | 19 that there is a hanging process which we were unable to kill."""; |
21 | 20 |
(...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
302 | 301 |
303 class UniqueObject { | 302 class UniqueObject { |
304 static int _nextId = 1; | 303 static int _nextId = 1; |
305 final int _hashCode; | 304 final int _hashCode; |
306 | 305 |
307 int get hashCode => _hashCode; | 306 int get hashCode => _hashCode; |
308 operator==(other) => other is UniqueObject && _hashCode == other._hashCode; | 307 operator==(other) => other is UniqueObject && _hashCode == other._hashCode; |
309 | 308 |
310 UniqueObject() : _hashCode = ++_nextId; | 309 UniqueObject() : _hashCode = ++_nextId; |
311 } | 310 } |
OLD | NEW |