Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 14549e6b85926dcf5f87f114d2d688b73053f2f1
      
https://github.com/WebKit/WebKit/commit/14549e6b85926dcf5f87f114d2d688b73053f2f1
  Author: Devin Rousso <[email protected]>
  Date:   2026-07-24 (Fri, 24 Jul 2026)

  Changed paths:
    A LayoutTests/inspector/debugger/wasm/getScriptSource-expected.txt
    A LayoutTests/inspector/debugger/wasm/getScriptSource.html
    A LayoutTests/inspector/debugger/wasm/resources/test-modules.js
    M LayoutTests/inspector/model/frame-extra-scripts-expected.txt
    M LayoutTests/inspector/model/frame-extra-scripts.html
    A LayoutTests/inspector/worker/debugger-getScriptSource-wasm-expected.txt
    A LayoutTests/inspector/worker/debugger-getScriptSource-wasm.html
    A LayoutTests/inspector/worker/resources/worker-debugger-wasm.js
    M Source/JavaScriptCore/debugger/Debugger.cpp
    M Source/JavaScriptCore/debugger/Debugger.h
    M Source/JavaScriptCore/inspector/agents/InspectorDebuggerAgent.cpp
    M Source/JavaScriptCore/inspector/agents/InspectorDebuggerAgent.h
    M Source/JavaScriptCore/inspector/protocol/Debugger.json
    M Source/JavaScriptCore/inspector/scripts/codegen/generator.py
    M Source/JavaScriptCore/tools/JSDollarVM.cpp
    M Source/JavaScriptCore/wasm/WasmModule.cpp
    M Source/JavaScriptCore/wasm/WasmModule.h
    M Source/JavaScriptCore/wasm/WasmModuleInformation.h
    M Source/JavaScriptCore/wasm/WasmStreamingCompiler.cpp
    M Source/JavaScriptCore/wasm/debugger/WasmModuleDebugInfo.cpp
    M Source/JavaScriptCore/wasm/debugger/WasmModuleDebugInfo.h
    M Source/JavaScriptCore/wasm/js/JSWebAssembly.cpp
    M Source/JavaScriptCore/wasm/js/JSWebAssemblyModule.cpp
    M Source/WebCore/bindings/js/JSDOMGlobalObject.cpp
    M Source/WebCore/inspector/FrameDebugger.cpp
    M Source/WebCore/inspector/FrameDebugger.h
    M Source/WebCore/inspector/PageDebugger.cpp
    M Source/WebCore/inspector/PageDebugger.h
    M Source/WebCore/inspector/WorkerDebugger.cpp
    M Source/WebCore/inspector/WorkerDebugger.h
    M Source/WebCore/inspector/agents/frame/FrameRuntimeAgent.cpp
    M Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js
    M Source/WebInspectorUI/UserInterface/Controllers/DebuggerManager.js
    M Source/WebInspectorUI/UserInterface/Controllers/NetworkManager.js
    M Source/WebInspectorUI/UserInterface/Models/ExecutionContext.js
    M Source/WebInspectorUI/UserInterface/Models/Script.js
    M Source/WebInspectorUI/UserInterface/Protocol/DebuggerObserver.js
    M Source/WebInspectorUI/UserInterface/Protocol/RuntimeObserver.js
    M Source/WebInspectorUI/UserInterface/Views/FrameTreeElement.js
    M Source/WebInspectorUI/UserInterface/Views/OpenResourceDialog.js
    M Source/WebInspectorUI/UserInterface/Views/ScriptContentView.js
    M Source/WebInspectorUI/UserInterface/Views/SourceCodeTextEditor.js
    M Source/WebInspectorUI/UserInterface/Views/SourcesNavigationSidebarPanel.js

  Log Message:
  -----------
  Web Inspector: Sources: show WebAssembly modules
https://bugs.webkit.org/show_bug.cgi?id=319168

Reviewed by Yusuke Suzuki.

* Source/JavaScriptCore/wasm/WasmModule.h:
(JSC::Wasm::Module::validateAsync):
(JSC::Wasm::Module::create):
(JSC::Wasm::Module::Module):
* Source/JavaScriptCore/wasm/WasmModule.cpp:
(JSC::Wasm::Module::Module):
(JSC::Wasm::makeValidationResult):
(JSC::Wasm::makeValidationCallback):
(JSC::Wasm::Module::validateAsync):
* Source/JavaScriptCore/wasm/WasmModuleInformation.h:
* Source/JavaScriptCore/wasm/WasmStreamingCompiler.cpp:
(JSC::Wasm::StreamingCompiler::StreamingCompiler):
* Source/JavaScriptCore/wasm/debugger/WasmModuleDebugInfo.h:
* Source/JavaScriptCore/wasm/debugger/WasmModuleDebugInfo.cpp:
(JSC::Wasm::ModuleDebugInfo::debugName const):
* Source/JavaScriptCore/wasm/js/JSWebAssembly.cpp:
(JSC::compileAndInstantiate):
Store the URL of streamed modules and module-loader for showing in Web 
Inspector.

* Source/JavaScriptCore/wasm/js/JSWebAssemblyModule.cpp:
(JSC::JSWebAssemblyModule::create):
* Source/JavaScriptCore/debugger/Debugger.h:
(JSC::Debugger::sourceParsed):
(JSC::Debugger::Observer::didParseSource):
(JSC::Debugger::sourceURLBase const): Added.
* Source/JavaScriptCore/debugger/Debugger.cpp:
(JSC::Debugger::attach):
(JSC::Debugger::removeObserver):
(JSC::Debugger::sourceParsed):
* Source/JavaScriptCore/tools/JSDollarVM.cpp:
(JSC::DoNothingDebugger::sourceParsed): Added.
Add instrumentation whenever a `WebAssembly.Module` is created.
Use the standard WebAssembly module name subsection as an optional/fallback 
display name.
Drive-by: deduplicate all parsed scripts by `SourceID`.

* Source/JavaScriptCore/inspector/protocol/Debugger.json:
* Source/JavaScriptCore/inspector/scripts/codegen/generator.py:
(ucfirst):
* Source/JavaScriptCore/inspector/agents/InspectorDebuggerAgent.h:
(Inspector::InspectorDebuggerAgent::didParseSource):
* Source/JavaScriptCore/inspector/agents/InspectorDebuggerAgent.cpp:
(Inspector::scriptTypeForScript): Added.
(Inspector::InspectorDebuggerAgent::resolveBreakpoint):
(Inspector::InspectorDebuggerAgent::getBreakpointLocations):
(Inspector::InspectorDebuggerAgent::setBlackboxConfiguration):
(Inspector::InspectorDebuggerAgent::didParseSource):
Report script type, execution context, and display name for each 
`WebAssembly.Module`.
Disable unsupported WebAssembly debugger features (e.g. breakpoints, 
blackboxing, etc.).

* Source/WebCore/bindings/js/JSDOMGlobalObject.cpp:
(WebCore::handleResponseOnStreamingAction):
Forward the final response URL to the streaming compiler so it can be stored 
with the module.

* Source/WebCore/inspector/FrameDebugger.h:
(WebCore::FrameDebugger::sourceURLBase const): Added.
* Source/WebCore/inspector/FrameDebugger.cpp:
(WebCore::FrameDebugger::sourceURLBase const): Added.
* Source/WebCore/inspector/PageDebugger.h:
(WebCore::PageDebugger::sourceURLBase const): Added.
* Source/WebCore/inspector/PageDebugger.cpp:
(WebCore::PageDebugger::sourceURLBase const): Added.
* Source/WebCore/inspector/WorkerDebugger.h:
(WebCore::WorkerDebugger::sourceURLBase const): Added.
* Source/WebCore/inspector/WorkerDebugger.cpp:
(WebCore::WorkerDebugger::sourceURLBase const): Added.
Use the document or `Worker` URL as the base for modules instantiated directly 
from bytes.

* Source/WebCore/inspector/agents/frame/FrameRuntimeAgent.cpp:
(WebCore::FrameRuntimeAgent::frameIdForProtocol const):
Use process-qualified identifiers so execution contexts can be associated with 
site-isolated frames.

* Source/WebInspectorUI/UserInterface/Protocol/DebuggerObserver.js:
(WI.DebuggerObserver):
(WI.DebuggerObserver.prototype.scriptParsed):
* Source/WebInspectorUI/UserInterface/Protocol/RuntimeObserver.js:
(WI.RuntimeObserver.prototype.executionContextCreated):
* Source/WebInspectorUI/UserInterface/Controllers/DebuggerManager.js:
(WI.DebuggerManager):
(WI.DebuggerManager.prototype.scriptDidParse):
(WI.DebuggerManager.prototype._frameForExecutionContext): Added.
(WI.DebuggerManager.prototype._targetRemoved):
(WI.DebuggerManager.prototype._frameWasRemoved): Added.
Convert the legacy `module` parameter from older backends into a 
`Debugger.ScriptType` enum.
Associate every `WI.Script` reported with a `WI.ExecutionContext` to its owner 
`WI.Frame`.
Keep WebAssembly module `WI.Script` that cannot map to a `WI.Resource` in 
"Extra Scripts".

* Source/WebInspectorUI/UserInterface/Models/Script.js:
(WI.Script):
(WI.Script.isWebAssembly): Added.
(WI.Script.prototype.get parentFrame): Added.
(WI.Script.prototype.get mimeType):
(WI.Script.prototype.get syntheticMIMEType): Added.
(WI.Script.prototype.get supportsScriptBlackboxing): Added.
(WI.Script.prototype.get displayName):
(WI.Script.prototype.couldBeMainResource):
(WI.Script.prototype._resolveResource):
Give WebAssembly `WI.Script` a MIME of `application/wasm`.
Resolve a matching `WI.Resource` without allowing WebAssembly `WI.Script` to 
replace a main resource.

* Source/WebInspectorUI/UserInterface/Views/FrameTreeElement.js:
(WI.FrameTreeElement):
(WI.FrameTreeElement.prototype.onpopulate):
(WI.FrameTreeElement.prototype._collectionItemWasRemoved): Added.
(WI.FrameTreeElement.prototype._extraScriptAdded):
* Source/WebInspectorUI/UserInterface/Views/OpenResourceDialog.js:
(WI.OpenResourceDialog.prototype._scriptAdded):
(WI.OpenResourceDialog.prototype._scriptRemoved):
* Source/WebInspectorUI/UserInterface/Views/SourcesNavigationSidebarPanel.js:
(WI.SourcesNavigationSidebarPanel):
(WI.SourcesNavigationSidebarPanel.prototype.closed):
(WI.SourcesNavigationSidebarPanel.prototype._addScript):
(WI.SourcesNavigationSidebarPanel.prototype._handleFrameWasRemoved): Added.
(WI.SourcesNavigationSidebarPanel.prototype._handleDebuggerScriptRemoved):
(WI.SourcesNavigationSidebarPanel.prototype._handleDebuggerScriptsCleared):
(WI.SourcesNavigationSidebarPanel.prototype._handleTargetRemoved):
Show WebAssembly `WI.Script` without a `WI.Resource` under the parent 
`WI.Frame` and/or `Worker`.

* Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js:
* Source/WebInspectorUI/UserInterface/Views/ScriptContentView.js:
(WI.ScriptContentView):
(WI.ScriptContentView.prototype._contentDidPopulate):
* Source/WebInspectorUI/UserInterface/Views/SourceCodeTextEditor.js:
(WI.SourceCodeTextEditor.prototype._prepareEditorForInitialContent):
(WI.SourceCodeTextEditor.prototype.get _supportsDebugging):
Show binary WebAssembly `WI.Script` without treating their contents as editable 
source text.

* LayoutTests/inspector/debugger/wasm/getScriptSource.html: Added.
* LayoutTests/inspector/debugger/wasm/getScriptSource-expected.txt: Added.
* LayoutTests/inspector/debugger/wasm/resources/test-modules.js: Added.
* LayoutTests/inspector/model/frame-extra-scripts.html:
* LayoutTests/inspector/model/frame-extra-scripts-expected.txt:
* LayoutTests/inspector/worker/debugger-getScriptSource-wasm.html: Added.
* LayoutTests/inspector/worker/debugger-getScriptSource-wasm-expected.txt: 
Added.
* LayoutTests/inspector/worker/resources/worker-debugger-wasm.js: Added.

Canonical link: https://commits.webkit.org/317891@main



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications

Reply via email to