Web Inspector: Restrict domains at the target level instead of only at the window...
authorjoepeck@webkit.org <joepeck@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 8 Nov 2018 20:27:04 +0000 (20:27 +0000)
committerjoepeck@webkit.org <joepeck@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 8 Nov 2018 20:27:04 +0000 (20:27 +0000)
commit3f4ada35f610595515edf99e75c8781a1e05bdf7
treeb05771c03ec1ccee6e4d24920c86bfd485531599
parent6bf99d85cb4a8e0bafb1f29b784886d58b180f35
Web Inspector: Restrict domains at the target level instead of only at the window level
https://bugs.webkit.org/show_bug.cgi?id=191344

Reviewed by Devin Rousso.

Source/JavaScriptCore:

* inspector/protocol/Console.json:
* inspector/protocol/Debugger.json:
* inspector/protocol/Heap.json:
* inspector/protocol/Runtime.json:
Remove workerSupported as it is now no longer necessary. It is implied
by availability being empty (meaning it is supported everywhere).

* inspector/protocol/Inspector.json:
* inspector/protocol/ScriptProfiler.json:
Restrict to "javascript" and "web" debuggables, not available in workers.

* inspector/protocol/Worker.json:
Cleanup, remove empty types list.

* inspector/protocol/Recording.json:
Cleanup, only expose this in the "web" domain for now.

* inspector/scripts/codegen/generate_js_backend_commands.py:
(JSBackendCommandsGenerator.generate_domain):
* inspector/scripts/codegen/models.py:
(Protocol.parse_domain):
Allow a list of debuggable types. Add "worker" even though it is unused
since that is a type we would want to allow or consider.

(Domain.__init__):
(Domains):
Remove now unnecessary workerSupported code.
Allow availability on a domain with only types.

* inspector/scripts/tests/generic/expected/worker-supported-domains.json-result: Removed.
* inspector/scripts/tests/generic/worker-supported-domains.json: Removed.

Source/WebCore:

* inspector/WorkerInspectorController.cpp:
(WebCore::WorkerInspectorController::WorkerInspectorController):
Remove Inspector domain from workers. It was unused anyways.

Source/WebInspectorUI:

With this change the list of agents available on the target should accurately
reflect the domains that target supports. We should start moving in the direction
that if we are checking for, or using, a feature, we should ideally be using
code that looks like `target.FooAgent.method` and not `window.FooAgent` or
an unprefixed `FooAgent`. More changes to follow.

* UserInterface/Controllers/AppControllerBase.js:
* UserInterface/Base/DebuggableType.js: Added.
Extract debuggable type enum out into its own file loaded early on.

* UserInterface/Main.html:
* UserInterface/Test.html:
Load DebuggableType.js.

* UserInterface/Controllers/NetworkManager.js:
(WI.NetworkManager.prototype.initializeTarget):
With these changes target.ServiceWorker is only exposed on a ServiceWorker target.

* UserInterface/Protocol/Connection.js:
(InspectorBackend.WorkerConnection):
With these changes Target.js restricts the domains exposed on the Target so just
clone all of the agents (we don't need to do anything special).

* UserInterface/Protocol/InspectorBackend.js:
(InspectorBackendClass.prototype.activateDomain):
Update supported domains per-type. If there is no explicit availability
then the domain is supported on all types.

(InspectorBackendClass.prototype.supportedDomainsForDebuggableType):
Get supported domains per-type.

(InspectorBackendClass.prototype.get workerSupportedDomains): Deleted.
(InspectorBackendClass.prototype.workerSupportedDomain): Deleted.
workerSupportedDomains is now unnecessary.

* UserInterface/Protocol/Target.js:
(WI.Target.prototype._supportedDomainsForTargetType):
Restrict supported domains for this target based on its type.

* UserInterface/Protocol/Legacy/10.3/InspectorBackendCommands.js:
* UserInterface/Protocol/Legacy/11.0/InspectorBackendCommands.js:
* UserInterface/Protocol/Legacy/11.3/InspectorBackendCommands.js:
* UserInterface/Protocol/Legacy/12.0/InspectorBackendCommands.js:
* Versions/Inspector-iOS-10.3.json:
* Versions/Inspector-iOS-11.0.json:
* Versions/Inspector-iOS-11.3.json:
* Versions/Inspector-iOS-12.0.json:
Regenerate protocol files now that workerSupportedDomains is unnecessary
and explicit availability has been added to other domains.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@237997 268f45cc-cd09-0410-ab3c-d52691b4dbfc
38 files changed:
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/inspector/protocol/Console.json
Source/JavaScriptCore/inspector/protocol/Debugger.json
Source/JavaScriptCore/inspector/protocol/Heap.json
Source/JavaScriptCore/inspector/protocol/Inspector.json
Source/JavaScriptCore/inspector/protocol/Recording.json
Source/JavaScriptCore/inspector/protocol/Runtime.json
Source/JavaScriptCore/inspector/protocol/ScriptProfiler.json
Source/JavaScriptCore/inspector/protocol/Worker.json
Source/JavaScriptCore/inspector/scripts/codegen/generate_js_backend_commands.py
Source/JavaScriptCore/inspector/scripts/codegen/models.py
Source/JavaScriptCore/inspector/scripts/tests/generic/expected/worker-supported-domains.json-result [deleted file]
Source/JavaScriptCore/inspector/scripts/tests/generic/worker-supported-domains.json [deleted file]
Source/WebCore/ChangeLog
Source/WebCore/inspector/WorkerInspectorController.cpp
Source/WebInspectorUI/ChangeLog
Source/WebInspectorUI/UserInterface/Base/DebuggableType.js [new file with mode: 0644]
Source/WebInspectorUI/UserInterface/Controllers/AppControllerBase.js
Source/WebInspectorUI/UserInterface/Controllers/NetworkManager.js
Source/WebInspectorUI/UserInterface/Main.html
Source/WebInspectorUI/UserInterface/Protocol/Connection.js
Source/WebInspectorUI/UserInterface/Protocol/InspectorBackend.js
Source/WebInspectorUI/UserInterface/Protocol/Legacy/10.0/InspectorBackendCommands.js
Source/WebInspectorUI/UserInterface/Protocol/Legacy/10.3/InspectorBackendCommands.js
Source/WebInspectorUI/UserInterface/Protocol/Legacy/11.0/InspectorBackendCommands.js
Source/WebInspectorUI/UserInterface/Protocol/Legacy/11.3/InspectorBackendCommands.js
Source/WebInspectorUI/UserInterface/Protocol/Legacy/12.0/InspectorBackendCommands.js
Source/WebInspectorUI/UserInterface/Protocol/Legacy/9.0/InspectorBackendCommands.js
Source/WebInspectorUI/UserInterface/Protocol/Legacy/9.3/InspectorBackendCommands.js
Source/WebInspectorUI/UserInterface/Protocol/Target.js
Source/WebInspectorUI/UserInterface/Test.html
Source/WebInspectorUI/Versions/Inspector-iOS-10.0.json
Source/WebInspectorUI/Versions/Inspector-iOS-10.3.json
Source/WebInspectorUI/Versions/Inspector-iOS-11.0.json
Source/WebInspectorUI/Versions/Inspector-iOS-11.3.json
Source/WebInspectorUI/Versions/Inspector-iOS-12.0.json
Source/WebInspectorUI/Versions/Inspector-iOS-9.0.json
Source/WebInspectorUI/Versions/Inspector-iOS-9.3.json