| 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 649 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 660 char* part_uri = reinterpret_cast<char*>(malloc(len + 1)); | 660 char* part_uri = reinterpret_cast<char*>(malloc(len + 1)); |
| 661 snprintf(part_uri, len + 1, "%s/%s", library_url_string, url_string); | 661 snprintf(part_uri, len + 1, "%s/%s", library_url_string, url_string); |
| 662 Dart_Handle part_uri_obj = DartUtils::NewString(part_uri); | 662 Dart_Handle part_uri_obj = DartUtils::NewString(part_uri); |
| 663 free(part_uri); | 663 free(part_uri); |
| 664 return Dart_LoadSource(library, | 664 return Dart_LoadSource(library, |
| 665 part_uri_obj, Dart_Null(), | 665 part_uri_obj, Dart_Null(), |
| 666 Builtin::PartSource(id, url_string), 0, 0); | 666 Builtin::PartSource(id, url_string), 0, 0); |
| 667 } | 667 } |
| 668 // All cases should have been handled above. | 668 // All cases should have been handled above. |
| 669 UNREACHABLE(); | 669 UNREACHABLE(); |
| 670 return Dart_Null(); |
| 670 } | 671 } |
| 671 | 672 |
| 672 | 673 |
| 673 void Loader::InitOnce() { | 674 void Loader::InitOnce() { |
| 674 loader_infos_lock_ = new Mutex(); | 675 loader_infos_lock_ = new Mutex(); |
| 675 } | 676 } |
| 676 | 677 |
| 677 | 678 |
| 678 Mutex* Loader::loader_infos_lock_; | 679 Mutex* Loader::loader_infos_lock_; |
| 679 Loader::LoaderInfo* Loader::loader_infos_ = NULL; | 680 Loader::LoaderInfo* Loader::loader_infos_ = NULL; |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 757 MutexLocker ml(loader_infos_lock_); | 758 MutexLocker ml(loader_infos_lock_); |
| 758 Loader* loader = LoaderForLocked(dest_port_id); | 759 Loader* loader = LoaderForLocked(dest_port_id); |
| 759 if (loader == NULL) { | 760 if (loader == NULL) { |
| 760 return; | 761 return; |
| 761 } | 762 } |
| 762 loader->QueueMessage(message); | 763 loader->QueueMessage(message); |
| 763 } | 764 } |
| 764 | 765 |
| 765 } // namespace bin | 766 } // namespace bin |
| 766 } // namespace dart | 767 } // namespace dart |
| OLD | NEW |