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

Unified Diff: runtime/bin/vmservice/loader.dart

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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/bin/loader.cc ('k') | runtime/observatory/lib/src/service/object.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/bin/vmservice/loader.dart
diff --git a/runtime/bin/vmservice/loader.dart b/runtime/bin/vmservice/loader.dart
index 6573e787a718b94792bd617a99273922d983d878..8439b8aad3f6536b891bdeae8a9e330a2cb09e74 100644
--- a/runtime/bin/vmservice/loader.dart
+++ b/runtime/bin/vmservice/loader.dart
@@ -90,9 +90,11 @@ class IsolateLoaderState extends IsolateEmbedderData {
if (packagesConfigFlag != null) {
_setPackagesConfig(packagesConfigFlag);
}
- if (_fileRequestQueue == null) {
- _fileRequestQueue = new List<FileRequest>();
- }
+ }
+
+ void updatePackageMap(String packagesConfigFlag) {
+ _packageMap = null;
+ _setPackagesConfig(packagesConfigFlag);
}
void cleanup() {
@@ -134,7 +136,7 @@ class IsolateLoaderState extends IsolateEmbedderData {
// _fileRequestQueue and are processed when we can safely issue them.
static const int _maxFileRequests = 16;
int currentFileRequests = 0;
- List<FileRequest> _fileRequestQueue;
+ final List<FileRequest> _fileRequestQueue = new List<FileRequest>();
bool get shouldIssueFileRequest => currentFileRequests < _maxFileRequests;
void enqueueFileRequest(FileRequest fr) {
@@ -1034,7 +1036,9 @@ _processLoadRequest(request) {
loaderState = new IsolateLoaderState(isolateId);
isolateEmbedderData[isolateId] = loaderState;
loaderState.init(
- packageRoot, packagesFile, workingDirectory, rootScript);
+ packageRoot, packagesFile, workingDirectory, rootScript);
+ } else {
+ loaderState.updatePackageMap(packagesFile);
}
loaderState.sp = sp;
assert(isolateEmbedderData[isolateId] == loaderState);
« no previous file with comments | « runtime/bin/loader.cc ('k') | runtime/observatory/lib/src/service/object.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698