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

Side by Side Diff: runtime/bin/gen_snapshot.cc

Issue 14366024: Add fallback to load the original version of dart:io library (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 8 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 | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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 // Generate a snapshot file after loading all the scripts specified on the 5 // Generate a snapshot file after loading all the scripts specified on the
6 // command line. 6 // command line.
7 7
8 #include <stdlib.h> 8 #include <stdlib.h>
9 #include <string.h> 9 #include <string.h>
10 #include <stdio.h> 10 #include <stdio.h>
(...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after
289 url_string); 289 url_string);
290 290
291 if (tag == kCanonicalizeUrl) { 291 if (tag == kCanonicalizeUrl) {
292 // Keep original names for libraries that have a mapping (e.g. dart:io). 292 // Keep original names for libraries that have a mapping (e.g. dart:io).
293 if (mapped_url_string) { 293 if (mapped_url_string) {
294 return url; 294 return url;
295 } 295 }
296 return ResolveUri(library_url_string, url_string); 296 return ResolveUri(library_url_string, url_string);
297 } 297 }
298 298
299 if (DartUtils::IsDartIOLibURL(url_string) && mapped_url_string == NULL) {
300 // No url mapping for dart:io. Load original version.
301 return Builtin::LoadAndCheckLibrary(Builtin::kIOLibrary);
302 }
303
299 Dart_Handle resolved_url = url; 304 Dart_Handle resolved_url = url;
300 if (mapped_url_string != NULL) { 305 if (mapped_url_string != NULL) {
301 // Mapped urls are relative to working directory. 306 // Mapped urls are relative to working directory.
302 resolved_url = ResolveScriptUri(mapped_url_string); 307 resolved_url = ResolveScriptUri(mapped_url_string);
303 if (Dart_IsError(resolved_url)) { 308 if (Dart_IsError(resolved_url)) {
304 return resolved_url; 309 return resolved_url;
305 } 310 }
306 } 311 }
307 312
308 // Get the file path out of the url. 313 // Get the file path out of the url.
(...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after
521 CreateAndWriteSnapshot(); 526 CreateAndWriteSnapshot();
522 527
523 Dart_EnterIsolate(UriResolverIsolateScope::isolate); 528 Dart_EnterIsolate(UriResolverIsolateScope::isolate);
524 Dart_ShutdownIsolate(); 529 Dart_ShutdownIsolate();
525 } else { 530 } else {
526 SetupForGenericSnapshotCreation(); 531 SetupForGenericSnapshotCreation();
527 CreateAndWriteSnapshot(); 532 CreateAndWriteSnapshot();
528 } 533 }
529 return 0; 534 return 0;
530 } 535 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698