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

Side by Side Diff: runtime/bin/loader.cc

Issue 2797923008: Fix updating packages map on reload and add a regression test (Closed)
Patch Set: Fix loader logic Created 3 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
« no previous file with comments | « runtime/bin/isolate_data.h ('k') | runtime/bin/vmservice/loader.dart » ('j') | 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) 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 634 matching lines...) Expand 10 before | Expand all | Expand 10 after
645 } 645 }
646 Dart_Handle library_url = Dart_LibraryUrl(library); 646 Dart_Handle library_url = Dart_LibraryUrl(library);
647 if (Dart_IsError(library_url)) { 647 if (Dart_IsError(library_url)) {
648 return library_url; 648 return library_url;
649 } 649 }
650 } 650 }
651 651
652 IsolateData* isolate_data = 652 IsolateData* isolate_data =
653 reinterpret_cast<IsolateData*>(Dart_CurrentIsolateData()); 653 reinterpret_cast<IsolateData*>(Dart_CurrentIsolateData());
654 ASSERT(isolate_data != NULL); 654 ASSERT(isolate_data != NULL);
655 655 if ((tag == Dart_kScriptTag) && Dart_IsString(library)) {
656 // Update packages file for isolate.
657 const char* packages_file = NULL;
658 Dart_Handle result = Dart_StringToCString(library, &packages_file);
659 if (Dart_IsError(result)) {
660 return result;
661 }
662 isolate_data->UpdatePackagesFile(packages_file);
663 }
656 // Grab this isolate's loader. 664 // Grab this isolate's loader.
657 Loader* loader = NULL; 665 Loader* loader = NULL;
658 666
659 // The outer invocation of the tag handler for this isolate. We make the outer 667 // The outer invocation of the tag handler for this isolate. We make the outer
660 // invocation block and allow any nested invocations to operate in parallel. 668 // invocation block and allow any nested invocations to operate in parallel.
661 const bool blocking_call = !isolate_data->HasLoader(); 669 const bool blocking_call = !isolate_data->HasLoader();
662 670
663 // If we are the outer invocation of the tag handler and the tag is an import 671 // If we are the outer invocation of the tag handler and the tag is an import
664 // this means that we are starting a deferred library load. 672 // this means that we are starting a deferred library load.
665 const bool is_deferred_import = blocking_call && (tag == Dart_kImportTag); 673 const bool is_deferred_import = blocking_call && (tag == Dart_kImportTag);
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after
863 MutexLocker ml(loader_infos_lock_); 871 MutexLocker ml(loader_infos_lock_);
864 Loader* loader = LoaderForLocked(dest_port_id); 872 Loader* loader = LoaderForLocked(dest_port_id);
865 if (loader == NULL) { 873 if (loader == NULL) {
866 return; 874 return;
867 } 875 }
868 loader->QueueMessage(message); 876 loader->QueueMessage(message);
869 } 877 }
870 878
871 } // namespace bin 879 } // namespace bin
872 } // namespace dart 880 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/bin/isolate_data.h ('k') | runtime/bin/vmservice/loader.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698