Fix a race in the wasmDWARFDebugging experiment

A race can occur when enabling the wasmDWARFDebuggin experiment. DebuggerModel instances created before that happens are not associated with a plugin manager. We thus need to catch that particular case when new scripts arrive for an existing DebuggerModel after the experiment is enabled.

Change-Id: Iad1fa36c8e8f1a76fae86b1928acd4b38242f009
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2132239
Reviewed-by: Eric Leese <leese@chromium.org>
Commit-Queue: Philip Pfaffe <pfaffe@chromium.org>
This commit is contained in:
Philip Pfaffe
2020-04-02 11:42:10 +00:00
committed by Commit Bot
parent 4d123409dc
commit c980dbf22c
+2 -1
View File
@@ -661,7 +661,8 @@ export class DebuggerModel extends SDKModel {
this.dispatchEventToListeners(Events.ParsedScriptSource, script);
const pluginManager = Bindings.debuggerWorkspaceBinding.getLanguagePluginManager(this);
if (!Root.Runtime.experiments.isEnabled('wasmDWARFDebugging') || !pluginManager.hasPluginForScript(script)) {
if (!Root.Runtime.experiments.isEnabled('wasmDWARFDebugging') || !pluginManager ||
!pluginManager.hasPluginForScript(script)) {
const sourceMapId = DebuggerModel._sourceMapId(script.executionContextId, script.sourceURL, script.sourceMapURL);
if (sourceMapId && !hasSyntaxError) {
// Consecutive script evaluations in the same execution context with the same sourceURL