| OLD | NEW |
| 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 333 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 344 } | 344 } |
| 345 } | 345 } |
| 346 | 346 |
| 347 // Get the file path out of the url. | 347 // Get the file path out of the url. |
| 348 Dart_Handle file_path = FilePathFromUri( | 348 Dart_Handle file_path = FilePathFromUri( |
| 349 DartUtils::GetStringValue(resolved_url)); | 349 DartUtils::GetStringValue(resolved_url)); |
| 350 if (Dart_IsError(file_path)) { | 350 if (Dart_IsError(file_path)) { |
| 351 return file_path; | 351 return file_path; |
| 352 } | 352 } |
| 353 | 353 |
| 354 return DartUtils::LoadSource(NULL, | 354 return DartUtils::LoadSource(library, |
| 355 library, | |
| 356 url, | 355 url, |
| 357 tag, | 356 tag, |
| 358 DartUtils::GetStringValue(file_path)); | 357 DartUtils::GetStringValue(file_path)); |
| 359 } | 358 } |
| 360 | 359 |
| 361 | 360 |
| 362 static Dart_Handle LoadSnapshotCreationScript(const char* script_name) { | 361 static Dart_Handle LoadSnapshotCreationScript(const char* script_name) { |
| 363 Dart_Handle resolved_script_uri = ResolveScriptUri(script_name); | 362 Dart_Handle resolved_script_uri = ResolveScriptUri(script_name); |
| 364 if (Dart_IsError(resolved_script_uri)) { | 363 if (Dart_IsError(resolved_script_uri)) { |
| 365 return resolved_script_uri; | 364 return resolved_script_uri; |
| (...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 567 } | 566 } |
| 568 return 0; | 567 return 0; |
| 569 } | 568 } |
| 570 | 569 |
| 571 } // namespace bin | 570 } // namespace bin |
| 572 } // namespace dart | 571 } // namespace dart |
| 573 | 572 |
| 574 int main(int argc, char** argv) { | 573 int main(int argc, char** argv) { |
| 575 return dart::bin::main(argc, argv); | 574 return dart::bin::main(argc, argv); |
| 576 } | 575 } |
| OLD | NEW |