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

Side by Side Diff: pkg/analyzer/lib/file_system/memory_file_system.dart

Issue 1206323005: Package map source factory support. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: ResourceProvider updates Created 5 years, 5 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
OLDNEW
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, 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 memory_file_system; 5 library memory_file_system;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 import 'dart:collection'; 8 import 'dart:collection';
9 import 'dart:core' hide Resource; 9 import 'dart:core' hide Resource;
10 10
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 throw 'failed to delete resource: $child'; 58 throw 'failed to delete resource: $child';
59 } 59 }
60 } 60 }
61 _pathToResource.remove(path); 61 _pathToResource.remove(path);
62 _pathToContent.remove(path); 62 _pathToContent.remove(path);
63 _pathToTimestamp.remove(path); 63 _pathToTimestamp.remove(path);
64 _notifyWatchers(path, ChangeType.REMOVE); 64 _notifyWatchers(path, ChangeType.REMOVE);
65 } 65 }
66 66
67 @override 67 @override
68 File getFile(String path) => new _MemoryFile(this, path);
69
70 @override
71 Folder getFolder(String path) => newFolder(path);
72
73 @override
68 Resource getResource(String path) { 74 Resource getResource(String path) {
69 path = posix.normalize(path); 75 path = posix.normalize(path);
70 Resource resource = _pathToResource[path]; 76 Resource resource = _pathToResource[path];
71 if (resource == null) { 77 if (resource == null) {
72 resource = new _MemoryFile(this, path); 78 resource = new _MemoryFile(this, path);
73 } 79 }
74 return resource; 80 return resource;
75 } 81 }
76 82
77 @override 83 @override
(...skipping 388 matching lines...) Expand 10 before | Expand all | Expand 10 after
466 bool operator ==(other) { 472 bool operator ==(other) {
467 if (runtimeType != other.runtimeType) { 473 if (runtimeType != other.runtimeType) {
468 return false; 474 return false;
469 } 475 }
470 return path == other.path; 476 return path == other.path;
471 } 477 }
472 478
473 @override 479 @override
474 String toString() => path; 480 String toString() => path;
475 } 481 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698