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

Side by Side Diff: runtime/bin/builtin.dart

Issue 9694045: Change lookup path for Dart native extensions shared libraries. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Add comments, remove printf statement. Created 8 years, 9 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | runtime/bin/extensions.h » ('j') | runtime/bin/extensions.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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("builtin"); 5 #library("builtin");
6 6
7 void print(arg) { 7 void print(arg) {
8 _Logger._printString(arg.toString()); 8 _Logger._printString(arg.toString());
9 } 9 }
10 10
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 } 61 }
62 62
63 String resolveUri(String base, String userString) { 63 String resolveUri(String base, String userString) {
64 var baseUri = new Uri.fromString(base); 64 var baseUri = new Uri.fromString(base);
65 _logResolution("# Resolving: $userString from $base"); 65 _logResolution("# Resolving: $userString from $base");
66 var resolved = baseUri.resolve(userString); 66 var resolved = baseUri.resolve(userString);
67 _logResolution("# Resolved to: $resolved"); 67 _logResolution("# Resolved to: $resolved");
68 return resolved.toString(); 68 return resolved.toString();
69 } 69 }
70 70
71 String resolveExtensionUri(String base, String userString) {
72 var uri = new Uri.fromString(userString);
73 if ("dart-ext" != uri.scheme) {
74 throw "Not a Dart extension uri: $uri";
75 }
76 var schemelessUri = new Uri(path: uri.path);
77 var baseUri = new Uri.fromString(base);
78 _logResolution("# Resolving: $userString from $base");
79 var resolved = baseUri.resolveUri(schemelessUri);
80 resolved = new Uri(scheme: 'dart-ext', path: resolved.path);
81 _logResolution("# Resolved to: $resolved");
82 return resolved.toString();
83 }
84
71 String filePathFromUri(String userUri) { 85 String filePathFromUri(String userUri) {
72 var uri = new Uri.fromString(userUri); 86 var uri = new Uri.fromString(userUri);
73 _logResolution("# Getting file path from: $uri"); 87 _logResolution("# Getting file path from: $uri");
74 if ("file" != uri.scheme) { 88 if ("file" != uri.scheme) {
75 // Only handling file URIs in standalone binary. 89 // Only handling file URIs in standalone binary.
76 _logResolution("# Not a file URI."); 90 _logResolution("# Not a file URI.");
77 throw "Not a file uri: $uri"; 91 throw "Not a file uri: $uri";
78 } 92 }
79 var path = uri.path; 93 var path = uri.path;
80 _logResolution("# Path: $path"); 94 _logResolution("# Path: $path");
81 if (_is_windows) { 95 if (_is_windows) {
82 // Drop the leading / before the drive letter. 96 // Drop the leading / before the drive letter.
83 path = path.substring(1); 97 path = path.substring(1);
84 _logResolution("# path: $path"); 98 _logResolution("# path: $path");
85 } 99 }
86 return path; 100 return path;
87 } 101 }
OLDNEW
« no previous file with comments | « no previous file | runtime/bin/extensions.h » ('j') | runtime/bin/extensions.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698