OLD | NEW |
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 import 'dart:async'; | 5 import 'dart:async'; |
6 import 'dart:io'; | 6 import 'dart:io'; |
7 import 'dart:isolate'; | 7 import 'dart:isolate'; |
8 | 8 |
9 import 'package:front_end/src/incremental/byte_store.dart'; | 9 import 'package:front_end/src/byte_store/byte_store.dart'; |
10 import 'package:path/path.dart'; | 10 import 'package:path/path.dart'; |
11 | 11 |
12 /** | 12 /** |
13 * The request that is sent from the main isolate to the clean-up isolate. | 13 * The request that is sent from the main isolate to the clean-up isolate. |
14 */ | 14 */ |
15 class CacheCleanUpRequest { | 15 class CacheCleanUpRequest { |
16 final String cachePath; | 16 final String cachePath; |
17 final int maxSizeBytes; | 17 final int maxSizeBytes; |
18 final SendPort replyTo; | 18 final SendPort replyTo; |
19 | 19 |
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
162 tempFile.writeAsBytesSync(bytes); | 162 tempFile.writeAsBytesSync(bytes); |
163 File file = _getFileForKey(key); | 163 File file = _getFileForKey(key); |
164 tempFile.renameSync(file.path); | 164 tempFile.renameSync(file.path); |
165 } catch (_) {} | 165 } catch (_) {} |
166 } | 166 } |
167 | 167 |
168 File _getFileForKey(String key) { | 168 File _getFileForKey(String key) { |
169 return new File(join(_cachePath, key)); | 169 return new File(join(_cachePath, key)); |
170 } | 170 } |
171 } | 171 } |
OLD | NEW |