OLD | NEW |
---|---|
1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2016, 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 | 5 |
6 #include "bin/loader.h" | 6 #include "bin/loader.h" |
7 | 7 |
8 #include "bin/builtin.h" | 8 #include "bin/builtin.h" |
9 #include "bin/dartutils.h" | 9 #include "bin/dartutils.h" |
10 #include "bin/extensions.h" | 10 #include "bin/extensions.h" |
(...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
289 // Fall through | 289 // Fall through |
290 loader->error_ = Dart_NewUnhandledExceptionError(error); | 290 loader->error_ = Dart_NewUnhandledExceptionError(error); |
291 return false; | 291 return false; |
292 } | 292 } |
293 | 293 |
294 | 294 |
295 if (result->tag == _Dart_kImportExtension) { | 295 if (result->tag == _Dart_kImportExtension) { |
296 ASSERT(library_uri != Dart_Null()); | 296 ASSERT(library_uri != Dart_Null()); |
297 Dart_Handle library = Dart_LookupLibrary(library_uri); | 297 Dart_Handle library = Dart_LookupLibrary(library_uri); |
298 ASSERT(!Dart_IsError(library)); | 298 ASSERT(!Dart_IsError(library)); |
299 const char* lib_path_str = reinterpret_cast<const char*>(result->payload); | 299 const char* lib_uri = reinterpret_cast<const char*>(result->payload); |
300 const char* extension_uri = reinterpret_cast<const char*>(result->uri); | 300 const char* extension_uri = reinterpret_cast<const char*>(result->uri); |
301 const char* lib_path = DartUtils::RemoveScheme(lib_uri); | |
301 const char* extension_path = DartUtils::RemoveScheme(extension_uri); | 302 const char* extension_path = DartUtils::RemoveScheme(extension_uri); |
302 if (strchr(extension_path, '/') != NULL || | 303 if (strchr(extension_path, '/') != NULL || |
303 (IsWindowsHost() && strchr(extension_path, '\\') != NULL)) { | 304 (IsWindowsHost() && strchr(extension_path, '\\') != NULL)) { |
304 loader->error_ = DartUtils::NewError( | 305 loader->error_ = DartUtils::NewError( |
305 "Relative paths for dart extensions are not supported: '%s'", | 306 "Relative paths for dart extensions are not supported: '%s'", |
306 extension_path); | 307 extension_path); |
307 return false; | 308 return false; |
308 } | 309 } |
309 Dart_Handle result = Extensions::LoadExtension(lib_path_str, | 310 Dart_Handle result = Extensions::LoadExtension(lib_path, |
rmacnak
2016/07/15 19:28:30
This bypasses the check for http or https in LoadE
Cutch
2016/07/15 19:58:43
Done.
| |
310 extension_path, | 311 extension_path, |
311 library); | 312 library); |
312 if (Dart_IsError(result)) { | 313 if (Dart_IsError(result)) { |
313 loader->error_ = result; | 314 loader->error_ = result; |
314 return false; | 315 return false; |
315 } | 316 } |
316 return true; | 317 return true; |
317 } | 318 } |
318 | 319 |
319 // Check for payload and load accordingly. | 320 // Check for payload and load accordingly. |
(...skipping 416 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
736 MutexLocker ml(loader_infos_lock_); | 737 MutexLocker ml(loader_infos_lock_); |
737 Loader* loader = LoaderForLocked(dest_port_id); | 738 Loader* loader = LoaderForLocked(dest_port_id); |
738 if (loader == NULL) { | 739 if (loader == NULL) { |
739 return; | 740 return; |
740 } | 741 } |
741 loader->QueueMessage(message); | 742 loader->QueueMessage(message); |
742 } | 743 } |
743 | 744 |
744 } // namespace bin | 745 } // namespace bin |
745 } // namespace dart | 746 } // namespace dart |
OLD | NEW |