Web Inspector: track WI.Script unique display name numbers per Page target
authoryurys@chromium.org <yurys@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 30 Oct 2019 22:49:11 +0000 (22:49 +0000)
committeryurys@chromium.org <yurys@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 30 Oct 2019 22:49:11 +0000 (22:49 +0000)
commit72653d6fa1316887468085d8e15eb13f6f29d1e0
tree25abfd7f432c75971955b0306a67b0c001c7a327
parentf49515f3054904c0a642d4c8652f8c69ff18bf5d
Web Inspector: track WI.Script unique display name numbers per Page target
https://bugs.webkit.org/show_bug.cgi?id=203427

Reviewed by Devin Rousso.

WI.Script now keeps track of last unique numbers via a static weak map keyed by
the Script's root target. So whenever new Page target is created all its scripts
will get unique display numbers from a new namespace.

Parent target is now passed to each target constructor and allow to find host
page target for nested targets. Among other things WorkerConnection and
TargetConnection use parentTarget for dispatching events instead of creating
extra copy of the same data that is already stored in Target.

* UserInterface/Controllers/DebuggerManager.js:
(WI.DebuggerManager.prototype.globalObjectCleared):
* UserInterface/Controllers/TargetManager.js:
(WI.TargetManager.prototype.targetCreated):
(WI.TargetManager.prototype.didCommitProvisionalTarget):
(WI.TargetManager.prototype.targetDestroyed):
(WI.TargetManager.prototype.dispatchMessageFromTarget):
(WI.TargetManager.prototype._connectToTarget):
(WI.TargetManager.prototype._createTarget):
* UserInterface/Controllers/WorkerManager.js:
(WI.WorkerManager.prototype.workerCreated):
* UserInterface/Models/Script.js:
(WI.Script):
(WI.Script.prototype.get displayName):
(WI.Script.prototype._nextUniqueDisplayNameNumber):
(WI.Script.prototype._nextUniqueConsoleDisplayNameNumber):
(WI.Script.prototype._uniqueDisplayNameNumbersForRootTarget):
* UserInterface/Protocol/Connection.js:
(InspectorBackend.WorkerConnection.prototype.sendMessageToBackend):
(InspectorBackend.WorkerConnection):
(InspectorBackend.TargetConnection.prototype.sendMessageToBackend):
(InspectorBackend.TargetConnection):
* UserInterface/Protocol/DirectBackendTarget.js:
(WI.DirectBackendTarget):
* UserInterface/Protocol/MultiplexingBackendTarget.js:
(WI.MultiplexingBackendTarget):
* UserInterface/Protocol/PageTarget.js:
(WI.PageTarget):
* UserInterface/Protocol/Target.js:
(WI.Target):
(WI.Target.prototype.get parentTarget):
(WI.Target.prototype.get rootTarget):
* UserInterface/Protocol/WorkerTarget.js:
(WI.WorkerTarget):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@251816 268f45cc-cd09-0410-ab3c-d52691b4dbfc
12 files changed:
Source/WebInspectorUI/ChangeLog
Source/WebInspectorUI/UserInterface/Controllers/DebuggerManager.js
Source/WebInspectorUI/UserInterface/Controllers/TargetManager.js
Source/WebInspectorUI/UserInterface/Controllers/WorkerManager.js
Source/WebInspectorUI/UserInterface/Models/Script.js
Source/WebInspectorUI/UserInterface/Protocol/Connection.js
Source/WebInspectorUI/UserInterface/Protocol/DebuggerObserver.js
Source/WebInspectorUI/UserInterface/Protocol/DirectBackendTarget.js
Source/WebInspectorUI/UserInterface/Protocol/MultiplexingBackendTarget.js
Source/WebInspectorUI/UserInterface/Protocol/PageTarget.js
Source/WebInspectorUI/UserInterface/Protocol/Target.js
Source/WebInspectorUI/UserInterface/Protocol/WorkerTarget.js