Web Inspector: Get a RemoteObject or ObjectPreview from HeapSnapshot Object Identifier
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 10 Mar 2016 06:15:25 +0000 (06:15 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 10 Mar 2016 06:15:25 +0000 (06:15 +0000)
commit4f0304c5c325871d6f63295e6aa7bf719cca23ee
tree6b7d1e4c50b08092a3303f2baeea15d685055944
parent39fd33e800da81c804f7c26047e7b951860065bc
Web Inspector: Get a RemoteObject or ObjectPreview from HeapSnapshot Object Identifier
https://bugs.webkit.org/show_bug.cgi?id=155264
<rdar://problem/25070716>

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2016-03-09
Reviewed by Timothy Hatcher.

Source/JavaScriptCore:

* inspector/InjectedScript.h:
* inspector/InjectedScript.cpp:
(Inspector::InjectedScript::functionDetails):
(Inspector::InjectedScript::previewValue):
New InjectedScript methods for building Debugger.FunctionDetails
or Runtime.ObjectPreview protocol objects from a JSValue.

* inspector/InjectedScriptSource.js:
(InjectedScript.prototype.previewValue):
(InjectedScript.prototype.functionDetails):
(InjectedScript.prototype.getFunctionDetails):
(InjectedScript.RemoteObject.prototype._isPreviewableObjectInternal):
(InjectedScript.RemoteObject.prototype._createObjectPreviewForValue): Deleted.
(InjectedScript.RemoteObject.prototype._appendEntryPreviews): Deleted.
Share code around creating function details or object preview objects.

* inspector/agents/InspectorHeapAgent.cpp:
(Inspector::InspectorHeapAgent::InspectorHeapAgent):
(Inspector::InspectorHeapAgent::nodeForHeapObjectIdentifier):
(Inspector::InspectorHeapAgent::getPreview):
(Inspector::InspectorHeapAgent::getRemoteObject):
* inspector/agents/InspectorHeapAgent.h:
* inspector/protocol/Heap.json:
New protocol methods that go from heap object identifier to a
remote object or some kind of preview.

* inspector/scripts/codegen/generator.py:
Allow runtime casts for ObjectPreview.

LayoutTests:

* inspector/heap/getPreview-expected.txt: Added.
* inspector/heap/getPreview.html: Added.
* inspector/heap/getRemoteObject-expected.txt: Added.
* inspector/heap/getRemoteObject.html: Added.
Test the new protocol methods in different scenarios.

* inspector/heap/snapshot-expected.txt:
* inspector/heap/snapshot.html:
Fix typo.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@197926 268f45cc-cd09-0410-ab3c-d52691b4dbfc
16 files changed:
LayoutTests/ChangeLog
LayoutTests/inspector/heap/getPreview-expected.txt [new file with mode: 0644]
LayoutTests/inspector/heap/getPreview.html [new file with mode: 0644]
LayoutTests/inspector/heap/getRemoteObject-expected.txt [new file with mode: 0644]
LayoutTests/inspector/heap/getRemoteObject.html [new file with mode: 0644]
LayoutTests/inspector/heap/snapshot-expected.txt
LayoutTests/inspector/heap/snapshot.html
LayoutTests/platform/mac-wk1/TestExpectations
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/inspector/InjectedScript.cpp
Source/JavaScriptCore/inspector/InjectedScript.h
Source/JavaScriptCore/inspector/InjectedScriptSource.js
Source/JavaScriptCore/inspector/agents/InspectorHeapAgent.cpp
Source/JavaScriptCore/inspector/agents/InspectorHeapAgent.h
Source/JavaScriptCore/inspector/protocol/Heap.json
Source/JavaScriptCore/inspector/scripts/codegen/generator.py