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

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 287 matching lines...) Expand 10 before | Expand all | Expand 10 after
298 298
299 Dart_Handle resolved_url = url; 299 Dart_Handle resolved_url = url;
300 if (mapped_url_string != NULL) { 300 if (mapped_url_string != NULL) {
301 // Mapped urls are relative to working directory. 301 // Mapped urls are relative to working directory.
302 resolved_url = ResolveScriptUri(mapped_url_string); 302 resolved_url = ResolveScriptUri(mapped_url_string);
303 if (Dart_IsError(resolved_url)) { 303 if (Dart_IsError(resolved_url)) {
304 return resolved_url; 304 return resolved_url;
305 } 305 }
306 } 306 }
307 307
308 if (DartUtils::IsDartIOLibURL(url_string)) {
309 // No url mapping for dart:io. Load original version.
310 return Builtin::LoadAndCheckLibrary(Builtin::kIOLibrary);
311 }
siva 2013/04/19 17:47:50 Not sure if I understand this. The comment states
podivilov 2013/04/20 07:34:22 Good spot! I misinterpreted "return resolved_url"
312
308 // Get the file path out of the url. 313 // Get the file path out of the url.
309 Dart_Handle file_path = FilePathFromUri( 314 Dart_Handle file_path = FilePathFromUri(
310 DartUtils::GetStringValue(resolved_url)); 315 DartUtils::GetStringValue(resolved_url));
311 if (Dart_IsError(file_path)) { 316 if (Dart_IsError(file_path)) {
312 return file_path; 317 return file_path;
313 } 318 }
314 319
315 return DartUtils::LoadSource(NULL, 320 return DartUtils::LoadSource(NULL,
316 library, 321 library,
317 url, 322 url,
(...skipping 203 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