| Index: runtime/bin/gen_snapshot.cc
|
| diff --git a/runtime/bin/gen_snapshot.cc b/runtime/bin/gen_snapshot.cc
|
| index c77021bf139dd45dfc3265e3703166048c8e6e35..9a25552df8045f8ecc70f1c959ec95afbd6cfdbe 100644
|
| --- a/runtime/bin/gen_snapshot.cc
|
| +++ b/runtime/bin/gen_snapshot.cc
|
| @@ -556,29 +556,12 @@ class UriResolverIsolateScope {
|
| Dart_Isolate UriResolverIsolateScope::isolate = NULL;
|
|
|
|
|
| -static char* ResolveAsFilePath(const char* uri_string) {
|
| - UriResolverIsolateScope scope;
|
| - uint8_t* scoped_file_path = NULL;
|
| - intptr_t scoped_file_path_length = -1;
|
| - Dart_Handle uri = Dart_NewStringFromCString(uri_string);
|
| - ASSERT(!Dart_IsError(uri));
|
| - Dart_Handle result = Loader::ResolveAsFilePath(uri, &scoped_file_path,
|
| - &scoped_file_path_length);
|
| - if (Dart_IsError(result)) {
|
| - Log::Print("Error resolving dependency: %s\n", Dart_GetError(result));
|
| - exit(kErrorExitCode);
|
| - }
|
| - return StringUtils::StrNDup(reinterpret_cast<const char*>(scoped_file_path),
|
| - scoped_file_path_length);
|
| -}
|
| -
|
| -
|
| static void AddDependency(const char* uri_string) {
|
| IsolateData* isolate_data =
|
| reinterpret_cast<IsolateData*>(Dart_CurrentIsolateData());
|
| MallocGrowableArray<char*>* dependencies = isolate_data->dependencies();
|
| if (dependencies != NULL) {
|
| - dependencies->Add(ResolveAsFilePath(uri_string));
|
| + dependencies->Add(strdup(uri_string));
|
| }
|
| }
|
|
|
| @@ -682,6 +665,8 @@ static void CreateAndWriteDependenciesFile() {
|
| return;
|
| }
|
|
|
| + Loader::ResolveDependenciesAsFilePaths();
|
| +
|
| ASSERT((dependencies_filename != NULL) || print_dependencies);
|
| bool success = true;
|
| File* file = NULL;
|
| @@ -1550,8 +1535,6 @@ int main(int argc, char** argv) {
|
| result = Dart_SetEnvironmentCallback(EnvironmentCallback);
|
| CHECK_RESULT(result);
|
|
|
| - ASSERT(vm_snapshot_data_filename != NULL);
|
| - ASSERT(isolate_snapshot_data_filename != NULL);
|
| // Load up the script before a snapshot is created.
|
| if (app_script_name != NULL) {
|
| // This is the case of a custom embedder (e.g: dartium) trying to
|
| @@ -1582,7 +1565,8 @@ int main(int argc, char** argv) {
|
|
|
| // Now we create an isolate into which we load all the code that needs to
|
| // be in the snapshot.
|
| - isolate_data = new IsolateData(NULL, NULL, NULL, NULL);
|
| + isolate_data = new IsolateData(app_script_name, commandline_package_root,
|
| + commandline_packages_file, NULL);
|
| const uint8_t* kernel = NULL;
|
| intptr_t kernel_length = 0;
|
| const bool is_kernel_file =
|
|
|