Web Inspector: ALTERNATE_DISPATCHERS Let the frontend know about extra agents
authorjoepeck@webkit.org <joepeck@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 3 Nov 2014 19:36:14 +0000 (19:36 +0000)
committerjoepeck@webkit.org <joepeck@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 3 Nov 2014 19:36:14 +0000 (19:36 +0000)
commit850b046ab9a9f2df59e0293c8325faeac9d78f75
tree3273bb89ef96a144f619f16e20b4f7db0b838e21
parente271bb652af17e932a4b9f470c8ab235937a47cb
Web Inspector: ALTERNATE_DISPATCHERS Let the frontend know about extra agents
https://bugs.webkit.org/show_bug.cgi?id=138236

Reviewed by Brian Burg.

Source/JavaScriptCore:

Inform the frontend about any extra domains the backend may have
above and beyond the default list of domains for the debuggable type.
This approach means there is almost no cost to normal debugging.
When a JSContext is debugged with extra agents, a message is sent
to the frontend letting it know which domains to then activate,
and perform any initialization work that may be required.

* inspector/InspectorAgentBase.h:
(Inspector::InspectorAgentBase::domainName):
* inspector/InspectorAgentRegistry.cpp:
(Inspector::InspectorAgentRegistry::appendExtraAgent):
* inspector/InspectorAgentRegistry.h:
* inspector/scripts/codegen/generator_templates.py:
Provide a way to get a list of just the extra domains.
To aggregate this list provide a different "append"
specifically for extra agents.

* inspector/JSGlobalObjectInspectorController.h:
* inspector/JSGlobalObjectInspectorController.cpp:
(Inspector::JSGlobalObjectInspectorController::JSGlobalObjectInspectorController):
(Inspector::JSGlobalObjectInspectorController::connectFrontend):
When a frontend connects, inform it of the extra domains.

* inspector/protocol/Inspector.json:
* inspector/agents/InspectorAgent.h:
* inspector/agents/InspectorAgent.cpp:
(Inspector::InspectorAgent::enable):
(Inspector::InspectorAgent::activateExtraDomains):
Send an event with the extra domains to activate.

Source/WebInspectorUI:

* UserInterface/Protocol/InspectorBackend.js:
(InspectorBackendClass.prototype.activateDomain):
* UserInterface/Protocol/InspectorObserver.js:
(WebInspector.InspectorObserver.prototype.activateExtraDomains):
* UserInterface/Base/Object.js:
* UserInterface/Base/Test.js:
* UserInterface/Base/Main.js:
(WebInspector.activateExtraDomains):
Default state is that there are no extra domains. When extra domains
are activated, some agents need to be re-initialized. Dispatch a
model event so views also know to re-initialize.

* UserInterface/Controllers/ApplicationCacheManager.js:
(WebInspector.ApplicationCacheManager.prototype._mainResourceDidChange):
* UserInterface/Controllers/DOMTreeManager.js:
Be more careful about direct agent use during main resource changes.
That can happen with a JSContext extended with a Page agent.

* UserInterface/Controllers/FrameResourceManager.js:
(WebInspector.FrameResourceManager):
(WebInspector.FrameResourceManager.prototype._mainFrameDidChange):
(WebInspector.FrameResourceManager.prototype._extraDomainsActivated):
* UserInterface/Controllers/StorageManager.js:
(WebInspector.StorageManager):
(WebInspector.StorageManager.prototype._databaseForIdentifier):
(WebInspector.StorageManager.prototype._extraDomainsActivated):
It is possible new window.FooAgent's are available. Perform expected
initialization re-checking if the agents are now available.

* UserInterface/Models/CSSCompletions.js:
Avoid re-initialization if we already did it. This should never
happen but this is just to be safe.

* UserInterface/Views/ResourceSidebarPanel.js:
(WebInspector.ResourceSidebarPanel):
(WebInspector.ResourceSidebarPanel.prototype._extraDomainsActivated):
Don't disallow expandable tree elements if this is a JSContext with
extra domains. If that JSContext has resources, we would have been
unable to see child resources.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@175478 268f45cc-cd09-0410-ab3c-d52691b4dbfc
27 files changed:
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/inspector/InspectorAgentBase.h
Source/JavaScriptCore/inspector/InspectorAgentRegistry.cpp
Source/JavaScriptCore/inspector/InspectorAgentRegistry.h
Source/JavaScriptCore/inspector/JSGlobalObjectInspectorController.cpp
Source/JavaScriptCore/inspector/JSGlobalObjectInspectorController.h
Source/JavaScriptCore/inspector/agents/InspectorAgent.cpp
Source/JavaScriptCore/inspector/agents/InspectorAgent.h
Source/JavaScriptCore/inspector/protocol/Inspector.json
Source/JavaScriptCore/inspector/scripts/codegen/generate_objective_c.py
Source/JavaScriptCore/inspector/scripts/codegen/generator_templates.py
Source/JavaScriptCore/inspector/scripts/tests/expected/commands-with-async-attribute.json-result
Source/JavaScriptCore/inspector/scripts/tests/expected/commands-with-optional-call-return-parameters.json-result
Source/JavaScriptCore/inspector/scripts/tests/expected/domains-with-varying-command-sizes.json-result
Source/JavaScriptCore/inspector/scripts/tests/expected/generate-domains-with-feature-guards.json-result
Source/WebInspectorUI/ChangeLog
Source/WebInspectorUI/UserInterface/Base/Main.js
Source/WebInspectorUI/UserInterface/Base/Object.js
Source/WebInspectorUI/UserInterface/Base/Test.js
Source/WebInspectorUI/UserInterface/Controllers/ApplicationCacheManager.js
Source/WebInspectorUI/UserInterface/Controllers/DOMTreeManager.js
Source/WebInspectorUI/UserInterface/Controllers/FrameResourceManager.js
Source/WebInspectorUI/UserInterface/Controllers/StorageManager.js
Source/WebInspectorUI/UserInterface/Models/CSSCompletions.js
Source/WebInspectorUI/UserInterface/Protocol/InspectorBackend.js
Source/WebInspectorUI/UserInterface/Protocol/InspectorObserver.js
Source/WebInspectorUI/UserInterface/Views/ResourceSidebarPanel.js