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

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

Issue 2338883002: Update uses of deprecated API in ddc (Closed)
Patch Set: Created 4 years, 3 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 | « no previous file | pkg/dev_compiler/lib/src/analyzer/context.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 /**
11 * A resolver that maps individual URI's to other URI's.
scheglov 2016/09/13 18:27:24 The comment seems too generic.
Brian Wilkerson 2016/09/13 20:37:20 The original class had no comment, and I don't act
12 */
13 class CustomUriResolver extends UriResolver {
14 final ResourceProvider resourceProvider;
15 final Map<String, String> _urlMappings;
16
17 CustomUriResolver(this.resourceProvider, this._urlMappings);
18
19 @override
20 Source resolveAbsolute(Uri uri, [Uri actualUri]) {
21 String mapping = _urlMappings[uri.toString()];
22 if (mapping == null) {
23 return null;
24 }
25 Uri fileUri = new Uri.file(mapping);
26 if (!fileUri.isAbsolute) {
27 return null;
28 }
29 return resourceProvider
30 .getFile(fileUri.toFilePath())
scheglov 2016/09/13 18:27:24 I think we need to use ResourceProvider's path con
Brian Wilkerson 2016/09/13 20:37:20 Done
31 .createSource(actualUri ?? uri);
32 }
33 }
OLDNEW
« no previous file with comments | « no previous file | pkg/dev_compiler/lib/src/analyzer/context.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698