Web Inspector: Modify the type profiler runtime protocol to transfer some computation...
authorsaambarati1@gmail.com <saambarati1@gmail.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 11 Sep 2014 02:37:57 +0000 (02:37 +0000)
committersaambarati1@gmail.com <saambarati1@gmail.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 11 Sep 2014 02:37:57 +0000 (02:37 +0000)
commit7804f680b99481654a3863f26983571a377ca810
tree84adc4b645f5bfb4f3bdc9e35e0e40bb5af11d63
parentc24c31cd475098418346b2efdada6cf35ad327fb
Web Inspector: Modify the type profiler runtime protocol to transfer some computation into the WebInspector
https://bugs.webkit.org/show_bug.cgi?id=136500

Reviewed by Joseph Pecoraro.

Source/JavaScriptCore:

This patch changes the type profiler protocol to the Web Inspector
by moving the work of calculating computed properties that effect the UI
into the Web Inspector. This makes the Web Inspector have control over the
strings it displays as UI elements representing type information to the user
instead of JavaScriptCore deciding on a convention for these strings.
JavaScriptCore now sends enough information to the Web Inspector so that
it can compute the properties JavaScriptCore used to compute.

* inspector/agents/InspectorRuntimeAgent.cpp:
(Inspector::InspectorRuntimeAgent::getRuntimeTypesForVariablesAtOffsets):
* inspector/protocol/Runtime.json:
* runtime/TypeProfiler.cpp:
(JSC::TypeProfiler::getTypesForVariableAtOffsetForInspector): Deleted.
* runtime/TypeProfiler.h:
* runtime/TypeSet.cpp:
(JSC::TypeSet::inspectorTypeSet):
(JSC::StructureShape::leastCommonAncestor):
(JSC::StructureShape::inspectorRepresentation):
* runtime/TypeSet.h:

Source/WebInspectorUI:

This patch maintains the same UI in the Web Inspector for displaying
type information, but now accounts for the new protocol for type profiling.

The Inspector now has a TypeSet class that wraps the TypeDescription
protocol object and creates a simple interface for asking protocol objects
about their type.

* UserInterface/Controllers/TypeTokenAnnotator.js:
(WebInspector.TypeTokenAnnotator.prototype._insertTypeTokensForEachNode):
* UserInterface/Main.html:
* UserInterface/Models/TypeSet.js: Added.
(WebInspector.TypeSet):
(WebInspector.TypeSet.fromPayload):
(WebInspector.TypeSet.prototype.isContainedIn):
* UserInterface/Views/SourceCodeTextEditor.js:
(WebInspector.SourceCodeTextEditor.prototype._tokenTrackingControllerHighlightedJavaScriptTypeInformation.handler):
(WebInspector.SourceCodeTextEditor.prototype._tokenTrackingControllerHighlightedJavaScriptTypeInformation):
* UserInterface/Views/TypePropertiesSection.js:
(WebInspector.TypePropertiesSection.prototype.onpopulate):
(WebInspector.TypePropertyTreeElement.prototype.onpopulate):
* UserInterface/Views/TypeTokenView.js:
(WebInspector.TypeTokenView.prototype.update):
(WebInspector.TypeTokenView.prototype._shouldShowPopover):
(WebInspector.TypeTokenView.prototype._displayTypeName):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@173505 268f45cc-cd09-0410-ab3c-d52691b4dbfc
14 files changed:
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/inspector/agents/InspectorRuntimeAgent.cpp
Source/JavaScriptCore/inspector/protocol/Runtime.json
Source/JavaScriptCore/runtime/TypeProfiler.cpp
Source/JavaScriptCore/runtime/TypeProfiler.h
Source/JavaScriptCore/runtime/TypeSet.cpp
Source/JavaScriptCore/runtime/TypeSet.h
Source/WebInspectorUI/ChangeLog
Source/WebInspectorUI/UserInterface/Controllers/TypeTokenAnnotator.js
Source/WebInspectorUI/UserInterface/Main.html
Source/WebInspectorUI/UserInterface/Models/TypeSet.js [new file with mode: 0644]
Source/WebInspectorUI/UserInterface/Views/SourceCodeTextEditor.js
Source/WebInspectorUI/UserInterface/Views/TypePropertiesSection.js
Source/WebInspectorUI/UserInterface/Views/TypeTokenView.js