| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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('system_cache'); | 5 library system_cache; |
| 6 | 6 |
| 7 #import('io.dart'); | 7 import 'io.dart'; |
| 8 #import('package.dart'); | 8 import 'package.dart'; |
| 9 #import('source.dart'); | 9 import 'source.dart'; |
| 10 #import('source_registry.dart'); | 10 import 'source_registry.dart'; |
| 11 #import('utils.dart'); | 11 import 'utils.dart'; |
| 12 #import('version.dart'); | 12 import 'version.dart'; |
| 13 | 13 |
| 14 /** | 14 /** |
| 15 * The system-wide cache of installed packages. | 15 * The system-wide cache of installed packages. |
| 16 * | 16 * |
| 17 * This cache contains all packages that are downloaded from the internet. | 17 * This cache contains all packages that are downloaded from the internet. |
| 18 * Packages that are available locally (e.g. from the SDK) don't use this cache. | 18 * Packages that are available locally (e.g. from the SDK) don't use this cache. |
| 19 */ | 19 */ |
| 20 class SystemCache { | 20 class SystemCache { |
| 21 /** | 21 /** |
| 22 * The root directory where this package cache is located. | 22 * The root directory where this package cache is located. |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 64 | 64 |
| 65 var pending = _pendingInstalls[id]; | 65 var pending = _pendingInstalls[id]; |
| 66 if (pending != null) return pending; | 66 if (pending != null) return pending; |
| 67 | 67 |
| 68 var future = id.source.installToSystemCache(id); | 68 var future = id.source.installToSystemCache(id); |
| 69 always(future, () => _pendingInstalls.remove(id)); | 69 always(future, () => _pendingInstalls.remove(id)); |
| 70 _pendingInstalls[id] = future; | 70 _pendingInstalls[id] = future; |
| 71 return future; | 71 return future; |
| 72 } | 72 } |
| 73 } | 73 } |
| OLD | NEW |