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

Side by Side Diff: packages/analyzer/lib/source/custom_resolver.dart

Issue 2990843002: Removed fixed dependencies (Closed)
Patch Set: Created 3 years, 4 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 | « packages/analyzer/lib/source/config.dart ('k') | packages/analyzer/lib/source/embedder.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file
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.
4
5 library analyzer.source.custom_resolver;
6
7 import 'package:analyzer/file_system/file_system.dart';
8 import 'package:analyzer/src/generated/source.dart';
9
10 class CustomUriResolver extends UriResolver {
11 final ResourceProvider resourceProvider;
12 final Map<String, String> _urlMappings;
13
14 CustomUriResolver(this.resourceProvider, this._urlMappings);
15
16 @override
17 Source resolveAbsolute(Uri uri, [Uri actualUri]) {
18 String mapping = _urlMappings[uri.toString()];
19 if (mapping == null) {
20 return null;
21 }
22 Uri fileUri = new Uri.file(mapping);
23 if (!fileUri.isAbsolute) {
24 return null;
25 }
26 return resourceProvider
27 .getFile(resourceProvider.pathContext.fromUri(fileUri))
28 .createSource(actualUri ?? uri);
29 }
30 }
OLDNEW
« no previous file with comments | « packages/analyzer/lib/source/config.dart ('k') | packages/analyzer/lib/source/embedder.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698