Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 5d6c6dd65e724fa1ccdbf390ceeee95dd6a89775
      
https://github.com/WebKit/WebKit/commit/5d6c6dd65e724fa1ccdbf390ceeee95dd6a89775
  Author: Devin Rousso <[email protected]>
  Date:   2025-03-31 (Mon, 31 Mar 2025)

  Changed paths:
    M LayoutTests/inspector/timeline/timeline-recording-expected.txt
    M LayoutTests/inspector/timeline/timeline-recording.html
    M Source/WebInspectorUI/UserInterface/Controllers/DebuggerManager.js
    M Source/WebInspectorUI/UserInterface/Main.html
    M 
Source/WebInspectorUI/UserInterface/Models/HeapAllocationsTimelineRecord.js
    A Source/WebInspectorUI/UserInterface/Models/ImportedTarget.js
    M Source/WebInspectorUI/UserInterface/Models/ScriptTimeline.js
    M Source/WebInspectorUI/UserInterface/Models/ScriptTimelineRecord.js
    M Source/WebInspectorUI/UserInterface/Models/TimelineRecording.js
    M Source/WebInspectorUI/UserInterface/Protocol/Target.js
    M Source/WebInspectorUI/UserInterface/Proxies/HeapSnapshotNodeProxy.js
    M Source/WebInspectorUI/UserInterface/Proxies/HeapSnapshotProxy.js
    M Source/WebInspectorUI/UserInterface/Proxies/HeapSnapshotWorkerProxy.js
    M Source/WebInspectorUI/UserInterface/Test.html
    M Source/WebInspectorUI/UserInterface/Views/HeapAllocationsTimelineView.js
    M Source/WebInspectorUI/UserInterface/Views/HeapSnapshotDataGridTree.js
    M 
Source/WebInspectorUI/UserInterface/Views/HeapSnapshotInstanceDataGridNode.js
    M Source/WebInspectorUI/UserInterface/Views/ProfileDataGridNode.js
    M Source/WebInspectorUI/UserInterface/Views/ScriptClusterTimelineView.js
    M Source/WebInspectorUI/UserInterface/Workers/HeapSnapshot/HeapSnapshot.js
    M 
Source/WebInspectorUI/UserInterface/Workers/HeapSnapshot/HeapSnapshotWorker.js

  Log Message:
  -----------
  Web Inspector: Timelines: support exporting and importing data from worker 
targets
https://bugs.webkit.org/show_bug.cgi?id=287738
<rdar://problem/145330533>

Reviewed by BJ Burg.

This will allow developers to share timeline recordings of `Worker` with 
others, just like what's already possible for the main execution context.

* Source/WebInspectorUI/UserInterface/Protocol/Target.js:
(WI.Target.prototype.exportData): Added.
* Source/WebInspectorUI/UserInterface/Models/ImportedTarget.js: Added.
(WI.ImportedTarget):
(WI.ImportedTarget.import):
(WI.ImportedTarget.prototype.exportData):
(WI.ImportedTarget.prototype.forIdentifier):
(WI.ImportedTarget.prototype.get identifier):
(WI.ImportedTarget.prototype.get type):
(WI.ImportedTarget.prototype.get name):
(WI.ImportedTarget.prototype.get url):
(WI.ImportedTarget.prototype.get isDestroyed):
(WI.ImportedTarget.prototype.get displayName):
(WI.ImportedTarget.prototype.hasDomain):
(WI.ImportedTarget.prototype.hasCommand):
(WI.ImportedTarget.prototype.hasEvent):
Add a model object to represent a target that did exist when the timeline 
recording was captured.

* Source/WebInspectorUI/UserInterface/Models/TimelineRecording.js:
(WI.TimelineRecording):
(WI.TimelineRecording.async import):
(WI.TimelineRecording.prototype.exportData):
(WI.TimelineRecording.prototype.reset):
(WI.TimelineRecording.prototype.updateCallingContextTrees):
* Source/WebInspectorUI/UserInterface/Models/HeapAllocationsTimelineRecord.js:
(WI.HeapAllocationsTimelineRecord.async fromJSON):
(WI.HeapAllocationsTimelineRecord.prototype.toJSON):
* Source/WebInspectorUI/UserInterface/Models/ScriptTimelineRecord.js:
(WI.ScriptTimelineRecord.async fromJSON):
(WI.ScriptTimelineRecord.prototype.toJSON):
Include the `WI.Target` data in the exported data to create a 
`WI.ImportedTarget` when (re)imported.

* Source/WebInspectorUI/UserInterface/Models/ScriptTimeline.js:
(WI.ScriptTimeline.prototype.get imported): Added.
Provide a way for `WI.ScriptClusterTimelineView` to know if a timeline 
recording is imported since it doesn't have access to the 
`WI.TimelineRecording`.

* Source/WebInspectorUI/UserInterface/Proxies/HeapSnapshotWorkerProxy.js:
(WI.HeapSnapshotWorkerProxy.prototype.createImportedSnapshot):
* Source/WebInspectorUI/UserInterface/Views/HeapAllocationsTimelineView.js:
(WI.HeapAllocationsTimelineView.prototype._importButtonNavigationItemClicked):
Remove the FIXME comment since imported snapshots will have a `null` target in 
the `HeapSnapshotWorker` since the `WI.Target` (and `WI.ImportedTarget`) only 
exist in the main execution context.

* Source/WebInspectorUI/UserInterface/Views/HeapSnapshotDataGridTree.js:
(WI.HeapSnapshotObjectGraphDataGridTree.prototype.populateTopLevel):
Just query for all kinds of global objects instead of deciding based on the 
`WI.TargetType`.

* Source/WebInspectorUI/UserInterface/Proxies/HeapSnapshotProxy.js:
(WI.HeapSnapshotProxy):
(WI.HeapSnapshotProxy.prototype.get imported):
* Source/WebInspectorUI/UserInterface/Proxies/HeapSnapshotNodeProxy.js:
(WI.HeapSnapshotNodeProxy):
(WI.HeapSnapshotNodeProxy.prototype.get imported): Added.
* Source/WebInspectorUI/UserInterface/Views/HeapSnapshotInstanceDataGridNode.js:
(WI.HeapSnapshotInstanceDataGridNode.logHeapSnapshotNode):
(WI.HeapSnapshotInstanceDataGridNode.prototype.createCellContent):
(WI.HeapSnapshotInstanceDataGridNode.prototype._getRemoteObject):
(WI.HeapSnapshotInstanceDataGridNode.prototype._populateWindowPreview):
(WI.HeapSnapshotInstanceDataGridNode.prototype._populatePreview):
(WI.HeapSnapshotInstanceDataGridNode.prototype._populateRemoteObject):
(WI.HeapSnapshotInstanceDataGridNode.prototype._mouseoverHandler):
Prevent imported heap snaphots from using `Heap` commands.

* Source/WebInspectorUI/UserInterface/Views/ScriptClusterTimelineView.js:
(WI.ScriptClusterTimelineView):
(WI.ScriptClusterTimelineView.prototype.restoreFromCookie):
(WI.ScriptClusterTimelineView.prototype._handleTargetAdded):
Only default to the `WI.mainTarget` if the timeline recording is not imported.

* Source/WebInspectorUI/UserInterface/Controllers/DebuggerManager.js:
(WI.DebuggerManager.prototype.scriptForIdentifier):
(WI.DebuggerManager.prototype.scriptsForURL):
Drive-by: Add a fastpath for `WI.ImportedTarget`.

* Source/WebInspectorUI/UserInterface/Views/ProfileDataGridNode.js:
(WI.ProfileDataGridNode.prototype.iconClassName):
(WI.ProfileDataGridNode.prototype.filterableDataForColumn):
(WI.ProfileDataGridNode.prototype._getScript): Added.
(WI.ProfileDataGridNode.prototype._displayContent):
Drive-by: Attempt to get the `WI.Script` (or `WI.Resource`) via the URL if 
viewing an imported timeline recording so that if the developer has imported 
the recording onto the same website then they can see source code locations.

* Source/WebInspectorUI/UserInterface/Workers/HeapSnapshot/HeapSnapshot.js:
(HeapSnapshot.prototype.get imported): Added.
* 
Source/WebInspectorUI/UserInterface/Workers/HeapSnapshot/HeapSnapshotWorker.js:
(HeapSnaphotWorker.prototype.createSnapshot):
Drive-by: Add missing method now that `imported` is no longer given as a 
separate argument.

* Source/WebInspectorUI/UserInterface/Main.html:
* Source/WebInspectorUI/UserInterface/Test.html:

* LayoutTests/inspector/timeline/timeline-recording.html:
* LayoutTests/inspector/timeline/timeline-recording-expected.txt:

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



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to