Diff
Modified: trunk/Source/WebInspectorUI/ChangeLog (200473 => 200474)
--- trunk/Source/WebInspectorUI/ChangeLog 2016-05-05 20:27:12 UTC (rev 200473)
+++ trunk/Source/WebInspectorUI/ChangeLog 2016-05-05 20:34:17 UTC (rev 200474)
@@ -1,3 +1,121 @@
+2016-05-05 Joseph Pecoraro <[email protected]>
+
+ Web Inspector: HeapSnapshot should exploratory Object Graph view
+ https://bugs.webkit.org/show_bug.cgi?id=157371
+ <rdar://problem/26107304>
+
+ Reviewed by Timothy Hatcher.
+
+ HeapSnapshots now have two ContentViews for viewing the graph.
+
+ HeapSnapshotInstancesContentView:
+ - top level are Class Categories nodes
+ - categories expand to Instances
+ - instances expand to show what they retain
+ - retained sizes only shown for dominated nodes of the instance
+
+ HeapSnapshotObjectGraphContentView:
+ - top level are GlobalObject or Window nodes
+ - expand to show what they retain
+ - retained sizes are shown for all nodes, everything is shown
+
+ This also provides a custom preview for Window instances. Instead of
+ showing an ObjectPreview, it just shows the `window.location.href`
+ for that instance, which is useful when there are multiple Window
+ instances for different frames.
+
+ * Localizations/en.lproj/localizedStrings.js:
+ * UserInterface/Main.html:
+ New "Object Graph" string and new files.
+
+ * UserInterface/Images/HeapSnapshotObjectGraph.svg: Added.
+ * UserInterface/Images/gtk/HeapSnapshotObjectGraph.svg: Added.
+ * UserInterface/Views/PathComponentIcons.css:
+ (.heap-snapshot-object-graph-icon .icon):
+ Copy the red [{}] icon from Style Rules.
+
+ * UserInterface/Views/HeapSnapshotClusterContentView.js:
+ (WebInspector.HeapSnapshotClusterContentView):
+ (WebInspector.HeapSnapshotClusterContentView.prototype.get objectGraphContentView):
+ (WebInspector.HeapSnapshotClusterContentView.prototype.showObjectGraph):
+ (WebInspector.HeapSnapshotClusterContentView.prototype._supportsObjectGraph):
+ (WebInspector.HeapSnapshotClusterContentView.prototype._pathComponentForContentView):
+ (WebInspector.HeapSnapshotClusterContentView.prototype._identifierForContentView):
+ (WebInspector.HeapSnapshotClusterContentView.prototype._showContentViewForIdentifier):
+ Include an "Object Graph" content view. This is unavailable in Diff views
+ but is available for individual HeapSnapshots.
+
+ * UserInterface/Views/HeapSnapshotContentView.js: Renamed from Source/WebInspectorUI/UserInterface/Views/HeapSnapshotInstancesContentView.js.
+ (WebInspector.HeapSnapshotContentView):
+ (WebInspector.HeapSnapshotContentView.prototype.shown):
+ (WebInspector.HeapSnapshotContentView.prototype.hidden):
+ (WebInspector.HeapSnapshotContentView.prototype._sortDataGrid):
+ (WebInspector.HeapSnapshotContentView.prototype._heapSnapshotDataGridTreeDidPopulate):
+ (WebInspector.HeapSnapshotInstancesContentView):
+ (WebInspector.HeapSnapshotObjectGraphContentView):
+ Share and generalize a HeapSnapshot ContentView. The only differences are
+ the DataGrid columns, DataGridTree class, and identifier prefix for settings.
+
+ * UserInterface/Views/HeapSnapshotDataGridTree.js: Renamed from Source/WebInspectorUI/UserInterface/Views/HeapSnapshotInstancesDataGridTree.js.
+ (WebInspector.HeapSnapshotDataGridTree):
+ (WebInspector.HeapSnapshotDataGridTree.buildSortComparator):
+ (WebInspector.HeapSnapshotDataGridTree.prototype.get heapSnapshot):
+ (WebInspector.HeapSnapshotDataGridTree.prototype.get visible):
+ (WebInspector.HeapSnapshotDataGridTree.prototype.get popover):
+ (WebInspector.HeapSnapshotDataGridTree.prototype.get popoverNode):
+ (WebInspector.HeapSnapshotDataGridTree.prototype.set popoverNode):
+ (WebInspector.HeapSnapshotDataGridTree.prototype.get children):
+ (WebInspector.HeapSnapshotDataGridTree.prototype.appendChild):
+ (WebInspector.HeapSnapshotDataGridTree.prototype.insertChild):
+ (WebInspector.HeapSnapshotDataGridTree.prototype.removeChildren):
+ (WebInspector.HeapSnapshotDataGridTree.prototype.set sortComparator):
+ (WebInspector.HeapSnapshotDataGridTree.prototype.sort):
+ (WebInspector.HeapSnapshotDataGridTree.prototype.shown):
+ (WebInspector.HeapSnapshotDataGridTree.prototype.hidden):
+ (WebInspector.HeapSnapshotDataGridTree.prototype.willDismissPopover):
+ (WebInspector.HeapSnapshotDataGridTree.prototype.get alwaysShowRetainedSize):
+ (WebInspector.HeapSnapshotDataGridTree.prototype.populateTopLevel):
+ (WebInspector.HeapSnapshotDataGridTree.prototype.didPopulate):
+ (WebInspector.HeapSnapshotInstancesDataGridTree.prototype.get alwaysShowRetainedSize):
+ (WebInspector.HeapSnapshotInstancesDataGridTree.prototype.populateTopLevel):
+ (WebInspector.HeapSnapshotInstancesDataGridTree):
+ (WebInspector.HeapSnapshotObjectGraphDataGridTree.prototype.get alwaysShowRetainedSize):
+ (WebInspector.HeapSnapshotObjectGraphDataGridTree.prototype.populateTopLevel):
+ (WebInspector.HeapSnapshotObjectGraphDataGridTree):
+
+ * UserInterface/Views/HeapSnapshotInstanceDataGridNode.js:
+ (WebInspector.HeapSnapshotInstanceDataGridNode.prototype.createCellContent):
+ Start using different previews based on instance type.
+
+ (WebInspector.HeapSnapshotInstanceDataGridNode.prototype._populateError):
+ Common preview error logic. Also, don't output "Internal object" next to things
+ like Structure, InferredType, etc. Just don't output anything. Eventually, if
+ we provide preview data, something will show, but for now nothing is fine.
+
+ (WebInspector.HeapSnapshotInstanceDataGridNode.prototype._populateWindowPreview.inspectedPage_window_getLocationHref):
+ (WebInspector.HeapSnapshotInstanceDataGridNode.prototype._populateWindowPreview):
+ Custom preview logic for Window's gets `window.location.href` on the instance if it is alive.
+
+ (WebInspector.HeapSnapshotInstanceDataGridNode.prototype._populatePreview):
+ Normal preview logic.
+
+ * UserInterface/Views/HeapSnapshotInstancesContentView.css:
+ (.heap-snapshot > .data-grid tr:not(.selected) td .preview-error): Deleted.
+ The red text for errors was standing out too much. Make it the default black.
+
+ * UserInterface/Views/HeapAllocationsTimelineView.js:
+ (WebInspector.HeapAllocationsTimelineView.prototype.showHeapSnapshotTimelineRecord):
+ Better variable name.
+
+ * UserInterface/Controllers/_javascript_RuntimeCompletionProvider.js:
+ (WebInspector._javascript_RuntimeCompletionProvider.prototype.completionControllerCompletionsNeeded.inspectedPage_evalResult_getArrayCompletions):
+ (WebInspector._javascript_RuntimeCompletionProvider.prototype.completionControllerCompletionsNeeded.inspectedPage_evalResult_getCompletions):
+ (WebInspector._javascript_RuntimeCompletionProvider.prototype.completionControllerCompletionsNeeded.getArrayCompletions): Deleted.
+ (WebInspector._javascript_RuntimeCompletionProvider.prototype.completionControllerCompletionsNeeded.getCompletions): Deleted.
+ (WebInspector._javascript_RuntimeCompletionProvider.prototype.completionControllerCompletionsNeeded.evaluated):
+ Try to be clearer about functions that run on the inspected page
+ by using the pattern with inspectedPage_<thisObject>_functionName.
+
2016-05-05 Nikita Vasilyev <[email protected]>
Web Inspector: Console is unresponsive for >10 seconds when it tries to render 10,000 messages
Modified: trunk/Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js (200473 => 200474)
--- trunk/Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js 2016-05-05 20:27:12 UTC (rev 200473)
+++ trunk/Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js 2016-05-05 20:34:17 UTC (rev 200474)
@@ -410,7 +410,6 @@
localizedStrings["Input: "] = "Input: ";
localizedStrings["Inset"] = "Inset";
localizedStrings["Instances"] = "Instances";
-localizedStrings["Internal object"] = "Internal object";
localizedStrings["Invalid"] = "Invalid";
localizedStrings["Invoke getter"] = "Invoke getter";
localizedStrings["Iterations"] = "Iterations";
@@ -509,6 +508,7 @@
localizedStrings["Not found"] = "Not found";
localizedStrings["Number"] = "Number";
localizedStrings["Numeric"] = "Numeric";
+localizedStrings["Object Graph"] = "Object Graph";
localizedStrings["Offset"] = "Offset";
localizedStrings["Online"] = "Online";
localizedStrings["Opacity"] = "Opacity";
Modified: trunk/Source/WebInspectorUI/UserInterface/Controllers/_javascript_RuntimeCompletionProvider.js (200473 => 200474)
--- trunk/Source/WebInspectorUI/UserInterface/Controllers/_javascript_RuntimeCompletionProvider.js 2016-05-05 20:27:12 UTC (rev 200473)
+++ trunk/Source/WebInspectorUI/UserInterface/Controllers/_javascript_RuntimeCompletionProvider.js 2016-05-05 20:34:17 UTC (rev 200474)
@@ -125,7 +125,7 @@
return;
}
- function getArrayCompletions(primitiveType)
+ function inspectedPage_evalResult_getArrayCompletions(primitiveType)
{
var array = this;
var arrayLength;
@@ -153,7 +153,7 @@
return resultSet;
}
- function getCompletions(primitiveType)
+ function inspectedPage_evalResult_getCompletions(primitiveType)
{
var object;
if (primitiveType === "string")
@@ -182,9 +182,9 @@
}
if (result.subtype === "array")
- result.callFunctionJSON(getArrayCompletions, undefined, receivedArrayPropertyNames.bind(this));
+ result.callFunctionJSON(inspectedPage_evalResult_getArrayCompletions, undefined, receivedArrayPropertyNames.bind(this));
else if (result.type === "object" || result.type === "function")
- result.callFunctionJSON(getCompletions, undefined, receivedPropertyNames.bind(this));
+ result.callFunctionJSON(inspectedPage_evalResult_getCompletions, undefined, receivedPropertyNames.bind(this));
else if (result.type === "string" || result.type === "number" || result.type === "boolean" || result.type === "symbol")
WebInspector.runtimeManager.evaluateInInspectedWindow("(" + getCompletions + ")(\"" + result.type + "\")", "completion", false, true, true, false, false, receivedPropertyNamesFromEvaluate.bind(this));
else
Added: trunk/Source/WebInspectorUI/UserInterface/Images/HeapSnapshotObjectGraph.svg (0 => 200474)
--- trunk/Source/WebInspectorUI/UserInterface/Images/HeapSnapshotObjectGraph.svg (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Images/HeapSnapshotObjectGraph.svg 2016-05-05 20:34:17 UTC (rev 200474)
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright © 2013 Apple Inc. All rights reserved. -->
+<svg xmlns="http://www.w3.org/2000/svg" id="root" version="1.1" viewBox="0 0 16 16">
+ <path fill="rgb(236, 151, 153)" d="M 13 1 L 3 1 C 1.898438 1 1 1.898438 1 3 L 1 13 C 1 14.101562 1.898438 15 3 15 L 13 15 C 14.101562 15 15 14.101562 15 13 L 15 3 C 15 1.898438 14.101562 1 13 1 Z"/>
+ <path fill="rgb(191, 109, 113)" d="M 13 1 L 3 1 C 1.898438 1 1 1.898438 1 3 L 1 13 C 1 14.101562 1.898438 15 3 15 L 13 15 C 14.101562 15 15 14.101562 15 13 L 15 3 C 15 1.898438 14.101562 1 13 1 M 13 2 C 13.550781 2 14 2.449219 14 3 L 14 13 C 14 13.550781 13.550781 14 13 14 L 3 14 C 2.449219 14 2 13.550781 2 13 L 2 3 C 2 2.449219 2.449219 2 3 2 L 13 2"/>
+ <path fill="white" d="M 6.585938 12.023438 C 6.152344 12.023438 5.820312 11.96875 5.574219 11.863281 C 5.308594 11.746094 5.113281 11.550781 4.992188 11.285156 C 4.882812 11.035156 4.828125 10.660156 4.828125 10.136719 C 4.828125 9.453125 4.796875 9.226562 4.78125 9.152344 C 4.753906 9.03125 4.699219 8.925781 4.617188 8.824219 C 4.558594 8.75 4.40625 8.703125 4.191406 8.695312 L 4 8.6875 L 4 7.328125 L 4.199219 7.328125 C 4.414062 7.324219 4.566406 7.265625 4.667969 7.144531 C 4.714844 7.085938 4.828125 6.875 4.828125 6.152344 C 4.828125 5.691406 4.84375 5.355469 4.878906 5.128906 C 4.914062 4.875 5.007812 4.660156 5.152344 4.484375 C 5.296875 4.308594 5.484375 4.183594 5.710938 4.109375 C 5.925781 4.035156 6.210938 4 6.585938 4 L 6.984375 4 L 6.984375 5.367188 L 6.785156 5.367188 C 6.363281 5.367188 6.273438 5.417969 6.265625 5.425781 C 6.265625 5.425781 6.21875 5.488281 6.214844 5.742188 C 6.199219 6.386719 6.175781 6.804688 6.152344 7 C 6.125 7.21093
8 6.0625 7.417969 5.964844 7.613281 C 5.894531 7.753906 5.789062 7.882812 5.644531 8.011719 C 5.78125 8.132812 5.890625 8.273438 5.96875 8.421875 C 6.085938 8.648438 6.152344 8.957031 6.171875 9.367188 L 6.226562 10.515625 C 6.234375 10.539062 6.257812 10.574219 6.300781 10.601562 C 6.308594 10.605469 6.394531 10.65625 6.78125 10.65625 L 6.980469 10.65625 L 6.980469 12.023438 Z"/>
+ <path fill="rgb(204, 116, 121)" d="M 7.984375 3 L 6.585938 3 C 6.101562 3 5.714844 3.050781 5.394531 3.160156 C 4.984375 3.296875 4.648438 3.527344 4.382812 3.84375 C 4.121094 4.160156 3.953125 4.546875 3.886719 4.984375 C 3.847656 5.265625 3.828125 5.636719 3.828125 6.152344 C 3.828125 6.21875 3.828125 6.277344 3.824219 6.332031 L 3 6.339844 L 3 9.652344 L 3.820312 9.683594 C 3.824219 9.796875 3.828125 9.941406 3.828125 10.136719 C 3.828125 10.8125 3.90625 11.308594 4.082031 11.691406 C 4.300781 12.1875 4.679688 12.558594 5.171875 12.777344 C 5.546875 12.941406 6.011719 13.023438 6.585938 13.023438 L 7.980469 13.023438 L 7.980469 9.652344 L 7.1875 9.652344 L 7.171875 9.316406 C 7.144531 8.789062 7.050781 8.363281 6.882812 8.015625 C 7.015625 7.730469 7.105469 7.433594 7.144531 7.121094 C 7.160156 7.015625 7.175781 6.820312 7.195312 6.363281 L 7.984375 6.363281 Z M 6.984375 4 L 6.984375 5.363281 L 6.785156 5.363281 C 6.367188 5.363281 6.277344 5.417969
6.265625 5.425781 C 6.265625 5.425781 6.21875 5.488281 6.214844 5.742188 C 6.199219 6.386719 6.175781 6.804688 6.152344 7 C 6.125 7.210938 6.0625 7.417969 5.964844 7.613281 C 5.894531 7.753906 5.789062 7.886719 5.644531 8.011719 C 5.78125 8.132812 5.890625 8.269531 5.96875 8.421875 C 6.085938 8.648438 6.152344 8.957031 6.171875 9.363281 L 6.226562 10.515625 C 6.234375 10.539062 6.257812 10.574219 6.296875 10.601562 C 6.308594 10.605469 6.394531 10.652344 6.78125 10.652344 L 6.980469 10.652344 L 6.980469 12.023438 L 6.585938 12.023438 C 6.152344 12.023438 5.820312 11.96875 5.574219 11.859375 C 5.308594 11.742188 5.113281 11.550781 4.992188 11.285156 C 4.882812 11.035156 4.828125 10.660156 4.828125 10.136719 C 4.828125 9.453125 4.796875 9.230469 4.78125 9.152344 C 4.753906 9.03125 4.699219 8.925781 4.617188 8.824219 C 4.554688 8.75 4.40625 8.703125 4.195312 8.695312 L 4 8.6875 L 4 7.328125 L 4.199219 7.328125 C 4.414062 7.324219 4.570312 7.265625 4.667969 7.144531 C 4.714844 7
.085938 4.828125 6.875 4.828125 6.152344 C 4.828125 5.691406 4.84375 5.355469 4.878906 5.128906 C 4.914062 4.875 5.007812 4.65625 5.152344 4.484375 C 5.296875 4.3125 5.484375 4.183594 5.710938 4.105469 C 5.925781 4.035156 6.210938 4 6.585938 4 L 6.984375 4"/>
+ <path fill="rgb(204, 116, 121)" d="M 9.414062 3 L 8.015625 3 L 8.015625 6.363281 L 8.808594 6.363281 C 8.824219 6.804688 8.851562 7.113281 8.890625 7.328125 C 8.933594 7.570312 9.011719 7.804688 9.117188 8.019531 C 9 8.261719 8.921875 8.519531 8.878906 8.785156 C 8.851562 8.921875 8.828125 9.136719 8.808594 9.652344 L 8.019531 9.652344 L 8.019531 13.023438 L 9.421875 13.023438 C 9.90625 13.023438 10.296875 12.96875 10.617188 12.859375 C 11.003906 12.730469 11.355469 12.496094 11.617188 12.179688 C 11.886719 11.855469 12.054688 11.472656 12.117188 11.035156 C 12.15625 10.753906 12.171875 10.382812 12.171875 9.863281 C 12.171875 9.800781 12.175781 9.742188 12.175781 9.691406 L 13 9.683594 L 13 6.371094 L 12.179688 6.339844 C 12.175781 6.230469 12.171875 6.078125 12.171875 5.886719 C 12.171875 5.210938 12.09375 4.714844 11.921875 4.328125 C 11.699219 3.839844 11.324219 3.464844 10.828125 3.246094 C 10.453125 3.078125 9.988281 3 9.414062 3 M 9.414062 4 C 9.
847656 4 10.179688 4.054688 10.425781 4.160156 C 10.691406 4.277344 10.886719 4.472656 11.007812 4.738281 C 11.117188 4.988281 11.171875 5.363281 11.171875 5.886719 C 11.171875 6.59375 11.203125 6.816406 11.222656 6.886719 C 11.253906 7.003906 11.308594 7.105469 11.390625 7.203125 C 11.425781 7.246094 11.523438 7.316406 11.808594 7.328125 L 12 7.335938 L 12 8.695312 L 11.800781 8.695312 C 11.585938 8.699219 11.433594 8.757812 11.332031 8.878906 C 11.273438 8.953125 11.171875 9.175781 11.171875 9.863281 C 11.171875 10.332031 11.15625 10.667969 11.125 10.894531 C 11.089844 11.144531 10.996094 11.363281 10.851562 11.539062 C 10.707031 11.714844 10.519531 11.839844 10.292969 11.914062 C 10.082031 11.984375 9.796875 12.023438 9.421875 12.023438 L 9.019531 12.023438 L 9.019531 10.652344 L 9.21875 10.652344 C 9.636719 10.652344 9.726562 10.59375 9.730469 10.59375 C 9.730469 10.59375 9.785156 10.53125 9.789062 10.277344 C 9.808594 9.582031 9.828125 9.148438 9.863281 8.945312 C 9.898
438 8.730469 9.972656 8.527344 10.078125 8.339844 C 10.144531 8.21875 10.238281 8.109375 10.355469 8.007812 C 10.230469 7.902344 10.140625 7.796875 10.074219 7.6875 C 9.976562 7.523438 9.910156 7.34375 9.875 7.148438 C 9.839844 6.96875 9.816406 6.644531 9.800781 6.183594 C 9.78125 5.597656 9.761719 5.480469 9.757812 5.457031 C 9.695312 5.402344 9.609375 5.363281 9.214844 5.363281 L 9.015625 5.363281 L 9.015625 4 L 9.414062 4"/>
+ <path fill="white" d="M 9.019531 12.023438 L 9.019531 10.65625 L 9.21875 10.65625 C 9.636719 10.65625 9.726562 10.59375 9.734375 10.589844 C 9.734375 10.589844 9.785156 10.53125 9.789062 10.277344 C 9.804688 9.582031 9.832031 9.148438 9.863281 8.945312 C 9.898438 8.730469 9.96875 8.527344 10.078125 8.339844 C 10.144531 8.21875 10.238281 8.109375 10.351562 8.007812 C 10.230469 7.902344 10.140625 7.796875 10.074219 7.6875 C 9.976562 7.523438 9.910156 7.34375 9.875 7.152344 C 9.839844 6.96875 9.816406 6.644531 9.800781 6.183594 C 9.78125 5.597656 9.761719 5.476562 9.757812 5.457031 C 9.695312 5.402344 9.609375 5.367188 9.214844 5.367188 L 9.015625 5.367188 L 9.015625 4 L 9.414062 4 C 9.847656 4 10.179688 4.050781 10.425781 4.160156 C 10.691406 4.277344 10.886719 4.472656 11.007812 4.738281 C 11.117188 4.988281 11.171875 5.363281 11.171875 5.886719 C 11.171875 6.589844 11.207031 6.816406 11.222656 6.886719 C 11.253906 7.003906 11.308594 7.105469 11.390625 7
.203125 C 11.425781 7.246094 11.527344 7.316406 11.804688 7.328125 L 12 7.335938 L 12 8.695312 L 11.800781 8.695312 C 11.585938 8.699219 11.433594 8.757812 11.332031 8.878906 C 11.273438 8.953125 11.171875 9.175781 11.171875 9.867188 C 11.171875 10.332031 11.15625 10.667969 11.125 10.890625 C 11.089844 11.144531 11 11.363281 10.851562 11.539062 C 10.707031 11.710938 10.519531 11.839844 10.292969 11.914062 C 10.082031 11.988281 9.792969 12.023438 9.417969 12.023438 Z"/>
+</svg>
Added: trunk/Source/WebInspectorUI/UserInterface/Images/gtk/HeapSnapshotObjectGraph.svg (0 => 200474)
--- trunk/Source/WebInspectorUI/UserInterface/Images/gtk/HeapSnapshotObjectGraph.svg (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Images/gtk/HeapSnapshotObjectGraph.svg 2016-05-05 20:34:17 UTC (rev 200474)
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Licensed under the Creative Commons Attribution-Share Alike 3.0 United States License (http://creativecommons.org/licenses/by-sa/3.0/) -->
+<svg xmlns="http://www.w3.org/2000/svg" id="root" version="1.1" viewBox="0 0 16 16">
+ <defs>
+ <radialGradient id="b" cx="301" cy="51.5" r="19.5" gradientUnits="userSpaceOnUse" gradientTransform="matrix(.97063 1.9684e-8 0 .28611 -291.16 -14.63)">
+ <stop stop-color="#fff" offset="0"/>
+ <stop stop-color="#fff" stop-opacity="0" offset="1"/>
+ </radialGradient>
+ <radialGradient id="a" cx="24.446" cy="35.878" r="20.531" gradientUnits="userSpaceOnUse" gradientTransform="matrix(.85696 3.2529e-7 -1.253e-7 .33010 -12.949 .77181)">
+ <stop stop-color="#fff" offset="0"/>
+ <stop stop-color="#fabebe" offset="1"/>
+ </radialGradient>
+ <linearGradient id="c" x1="321.57" x2="311.65" y1="145.52" y2="118.5" gradientUnits="userSpaceOnUse" gradientTransform="matrix(.55569 0 0 .55568 -169.27 -70.906)">
+ <stop stop-color="#a40000" offset="0"/>
+ <stop stop-color="#f9adad" offset="1"/>
+ </linearGradient>
+ <linearGradient id="d" x1="491.22" x2="491.22" y1="506.65" y2="732.05" gradientUnits="userSpaceOnUse" gradientTransform="matrix(.093294 0 0 .093294 -35.871 -43.769)">
+ <stop stop-color="#a40000" offset="0"/>
+ <stop stop-color="#f9adad" offset="1"/>
+ </linearGradient>
+ </defs>
+ <rect width="15.004" height="15.003" x=".49815" y=".49833" fill="url(#a)" fill-rule="evenodd" stroke="url(#c)" stroke-miterlimit="10" rx="1.5143" ry="1.5143" stroke-linejoin="bevel"/>
+ <rect width="12.997" height="13" x="1.5014" y="1.5016" fill="none" stroke="#fff" stroke-miterlimit="10" ry=".50810" stroke-linejoin="bevel" rx=".50812"/>
+ <rect width="14" height="14" x="1.0017" y="1.0016" fill="url(#b)" fill-rule="evenodd" rx="1.9062" ry="1.9062"/>
+ <path fill="#fff" d="m6.4497 4.8501c-0.25562 0.01929-0.68218 0.12665-1.0625 0.4375s-0.7029 0.82923-0.78125 1.6562c-0.01595 0.21541-0.04213 0.44238-0.0625 0.625-0.001 0.009 0.0011 0.02233 0 0.03125-0.08624 0.5742-0.34913 0.76554-0.625 0.8125l-0.125 0.03125a0.25002 0.25002 0 0 0 -0.09375 0.03125 0.25002 0.25002 0 0 0 -0.09375 0.09375 0.25002 0.25002 0 0 0 -0.03125 0.125v0.8125a0.25002 0.25002 0 0 0 0.03125 0.09375 0.25002 0.25002 0 0 0 0.03125 0.0625 0.25002 0.25002 0 0 0 0.03125 0.03125 0.25002 0.25002 0 0 0 0.03125 0.03125 0.25002 0.25002 0 0 0 0.09375 0.03125l0.125 0.03125h0.03125c0.08878 0.02005 0.17292 0.03869 0.25 0.09375 0.1907 0.13841 0.2651 0.34781 0.3125 0.59375s0.06321 0.51581 0.09375 0.8125c0.08313 0.81821 0.426 1.3579 0.8125 1.6562 0.37615 0.2904 0.76763 0.35692 1 0.375 0.0064 0.000497 0.02511-0.0004 0.03125 0l0.125 0.03125a0.25002 0.25002 0 0 0 0.0625 0 0.25002 0.25002 0 0 0 0.0625 -0.03125 0.25002 0.25002 0 0 0 0.0625 -0.03125 0.25002 0.25002
0 0 0 0.03125 -0.03125 0.25002 0.25002 0 0 0 0.03125 -0.0625 0.25002 0.25002 0 0 0 0 -0.03125l0.21875-0.84375a0.25002 0.25002 0 0 0 0 -0.03125 0.25002 0.25002 0 0 0 0 -0.0625 0.25002 0.25002 0 0 0 -0.03125 -0.0625 0.25002 0.25002 0 0 0 -0.03125 -0.0625 0.25002 0.25002 0 0 0 -0.03125 -0.03125 0.25002 0.25002 0 0 0 -0.03125 -0.03125 0.25002 0.25002 0 0 0 -0.09375 -0.03125h-0.1875c-0.18184-0.02204-0.34449-0.17298-0.4375-0.3125-0.1576-0.24224-0.16703-0.69416-0.21875-1.2188-0.04542-0.46068-0.24764-0.95497-0.625-1.375 0.37302-0.41951 0.54842-0.91617 0.59375-1.375 0.05042-0.51041 0.09838-0.96692 0.25-1.2188 0.09479-0.14218 0.2606-0.29106 0.4375-0.3125l0.1875-0.03125a0.25002 0.25002 0 0 0 0.0625 0 0.25002 0.25002 0 0 0 0.09375 -0.0625 0.25002 0.25002 0 0 0 0.03125 -0.0625 0.25002 0.25002 0 0 0 0.03125 -0.09375 0.25002 0.25002 0 0 0 0 -0.0625 0.25002 0.25002 0 0 0 0 -0.03125l-0.2187-0.8121a0.25002 0.25002 0 0 0 0 -0.03125 0.25002 0.25002 0 0 0 -0.03125 -0.0625 0.25002 0.25002 0 0 0 -
0.0625 -0.0625 0.25002 0.25002 0 0 0 -0.0625 -0.03125 0.25002 0.25002 0 0 0 -0.0625 0 0.25002 0.25002 0 0 0 -0.03125 0h-0.125zm2.625 0a0.25002 0.25002 0 0 0 -0.0625 0.0625 0.25002 0.25002 0 0 0 -0.03125 0.03125 0.25002 0.25002 0 0 0 -0.03125 0.0625 0.25002 0.25002 0 0 0 -0.03125 0.03125l-0.1875 0.8125a0.25002 0.25002 0 0 0 0 0.0625 0.25002 0.25002 0 0 0 0.03125 0.09375 0.25002 0.25002 0 0 0 0.03125 0.0625 0.25002 0.25002 0 0 0 0.03125 0.03125 0.25002 0.25002 0 0 0 0.03125 0.03125 0.25002 0.25002 0 0 0 0.09375 0.03125l0.1875 0.03125c0.1763 0.02137 0.34004 0.16632 0.4375 0.3125 0.15152 0.25187 0.16834 0.70846 0.21875 1.2188 0.045371 0.45927 0.25111 0.95529 0.625 1.375-0.37736 0.42003-0.57958 0.91432-0.625 1.375-0.05172 0.52459-0.061149 0.97651-0.21875 1.2188-0.095677 0.14352-0.25626 0.29053-0.4375 0.3125h-0.1875a0.25002 0.25002 0 0 0 -0.03125 0.03125 0.25002 0.25002 0 0 0 -0.09375 0.0625 0.25002 0.25002 0 0 0 -0.03125 0.03125 0.25002 0.25002 0 0 0 -0.03125 0.0625 0.25002 0.250
02 0 0 0 -0.03125 0.125l0.1875 0.84375a0.25002 0.25002 0 0 0 0.0625 0.09375 0.25002 0.25002 0 0 0 0.03125 0.03125 0.25002 0.25002 0 0 0 0.03125 0.03125 0.25002 0.25002 0 0 0 0.09375 0.03125 0.25002 0.25002 0 0 0 0.0625 0l0.125-0.03125c0.00614-0.0004 0.02486 0.000497 0.03125 0 0.23237-0.01808 0.62385-0.0846 1-0.375 0.3865-0.29839 0.72937-0.83804 0.8125-1.6562 0.03054-0.29669 0.04635-0.56656 0.09375-0.8125s0.12182-0.45534 0.3125-0.59375c0.07296-0.05211 0.15827-0.07303 0.25-0.09375h0.03125l0.125-0.03125a0.25002 0.25002 0 0 0 0.09375 -0.03125 0.25002 0.25002 0 0 0 0.09375 -0.09375 0.25002 0.25002 0 0 0 0.03125 -0.09375 0.25002 0.25002 0 0 0 0 -0.03125v-0.8125a0.25002 0.25002 0 0 0 -0.03125 -0.09375 0.25002 0.25002 0 0 0 -0.0625 -0.09375 0.25002 0.25002 0 0 0 -0.0625 -0.03125 0.25002 0.25002 0 0 0 -0.0625 -0.03125l-0.125-0.03125c-0.27587-0.04696-0.53876-0.2383-0.625-0.8125-0.0011-0.0092 0.0011-0.02193 0-0.03125-0.02172-0.18821-0.04698-0.41542-0.0625-0.625-0.07836-0.82274-0.40221-
1.3443-0.78125-1.6562-0.37904-0.31194-0.80161-0.41818-1.0625-0.4375h-0.125a0.25002 0.25002 0 0 0 -0.0625 0 0.25002 0.25002 0 0 0 -0.03125 0 0.25002 0.25002 0 0 0 -0.03125 0z" display="block"/>
+ <path fill="url(#d)" d="m6.5623 3.75c-0.25562 0.01929-0.68218 0.12665-1.0625 0.4375s-0.7029 0.82923-0.78125 1.6562c-0.01595 0.21541-0.04213 0.44238-0.0625 0.625-0.001 0.009 0.0011 0.02233 0 0.03125-0.08624 0.5742-0.34913 0.76554-0.625 0.8125l-0.125 0.03125a0.25002 0.25002 0 0 0 -0.09375 0.03125 0.25002 0.25002 0 0 0 -0.09375 0.09375 0.25002 0.25002 0 0 0 -0.03125 0.125v0.8125a0.25002 0.25002 0 0 0 0.03125 0.09375 0.25002 0.25002 0 0 0 0.03125 0.0625 0.25002 0.25002 0 0 0 0.03125 0.03125 0.25002 0.25002 0 0 0 0.03125 0.03125 0.25002 0.25002 0 0 0 0.09375 0.03125l0.125 0.03125h0.03125c0.08878 0.02005 0.17292 0.03869 0.25 0.09375 0.1907 0.13841 0.2651 0.34781 0.3125 0.59375s0.06321 0.51581 0.09375 0.8125c0.08313 0.81821 0.426 1.3579 0.8125 1.6562 0.37615 0.2904 0.76763 0.35692 1 0.375 0.0064 0.000497 0.02511-0.0004 0.03125 0l0.125 0.03125a0.25002 0.25002 0 0 0 0.0625 0 0.25002 0.25002 0 0 0 0.0625 -0.03125 0.25002 0.25002 0 0 0 0.0625 -0.03125 0.25002 0.25002
0 0 0 0.03125 -0.03125 0.25002 0.25002 0 0 0 0.03125 -0.0625 0.25002 0.25002 0 0 0 0 -0.03125l0.21875-0.84375a0.25002 0.25002 0 0 0 0 -0.03125 0.25002 0.25002 0 0 0 0 -0.0625 0.25002 0.25002 0 0 0 -0.03125 -0.0625 0.25002 0.25002 0 0 0 -0.03125 -0.0625 0.25002 0.25002 0 0 0 -0.03125 -0.03125 0.25002 0.25002 0 0 0 -0.03125 -0.03125 0.25002 0.25002 0 0 0 -0.09375 -0.03125h-0.1875c-0.18184-0.02204-0.34449-0.17298-0.4375-0.3125-0.1576-0.24224-0.16703-0.69416-0.21875-1.2188-0.04542-0.46068-0.24764-0.95497-0.625-1.375 0.37302-0.41951 0.54842-0.91617 0.59375-1.375 0.05042-0.51041 0.09838-0.96692 0.25-1.2188 0.09479-0.14218 0.2606-0.29106 0.4375-0.3125l0.1875-0.03125a0.25002 0.25002 0 0 0 0.0625 0 0.25002 0.25002 0 0 0 0.09375 -0.0625 0.25002 0.25002 0 0 0 0.03125 -0.0625 0.25002 0.25002 0 0 0 0.03125 -0.09375 0.25002 0.25002 0 0 0 0 -0.0625 0.25002 0.25002 0 0 0 0 -0.03125l-0.2187-0.8122a0.25002 0.25002 0 0 0 0 -0.03125 0.25002 0.25002 0 0 0 -0.03125 -0.0625 0.25002 0.25002 0 0 0
-0.0625 -0.0625 0.25002 0.25002 0 0 0 -0.0625 -0.03125 0.25002 0.25002 0 0 0 -0.0625 0 0.25002 0.25002 0 0 0 -0.03125 0h-0.125zm2.625 0a0.25002 0.25002 0 0 0 -0.0625 0.0625 0.25002 0.25002 0 0 0 -0.03125 0.03125 0.25002 0.25002 0 0 0 -0.03125 0.0625 0.25002 0.25002 0 0 0 -0.03125 0.03125l-0.1875 0.8125a0.25002 0.25002 0 0 0 0 0.0625 0.25002 0.25002 0 0 0 0.03125 0.09375 0.25002 0.25002 0 0 0 0.03125 0.0625 0.25002 0.25002 0 0 0 0.03125 0.03125 0.25002 0.25002 0 0 0 0.03125 0.03125 0.25002 0.25002 0 0 0 0.09375 0.03125l0.1875 0.03125c0.1763 0.02137 0.34004 0.16632 0.4375 0.3125 0.15152 0.25187 0.16834 0.70846 0.21875 1.2188 0.045371 0.45927 0.25111 0.95529 0.625 1.375-0.37736 0.42003-0.57958 0.91432-0.625 1.375-0.05172 0.52459-0.061149 0.97651-0.21875 1.2187-0.095677 0.14352-0.25626 0.29053-0.4375 0.3125h-0.1875a0.25002 0.25002 0 0 0 -0.03125 0.03125 0.25002 0.25002 0 0 0 -0.09375 0.0625 0.25002 0.25002 0 0 0 -0.03125 0.03125 0.25002 0.25002 0 0 0 -0.03125 0.0625 0.25002 0.25
002 0 0 0 -0.03125 0.125l0.1875 0.84375a0.25002 0.25002 0 0 0 0.0625 0.09375 0.25002 0.25002 0 0 0 0.03125 0.03125 0.25002 0.25002 0 0 0 0.03125 0.03125 0.25002 0.25002 0 0 0 0.09375 0.03125 0.25002 0.25002 0 0 0 0.0625 0l0.125-0.03125c0.00614-0.0004 0.02486 0.000497 0.03125 0 0.23237-0.01808 0.62385-0.0846 1-0.375 0.3865-0.29839 0.72937-0.83804 0.8125-1.6562 0.03054-0.29669 0.04635-0.56656 0.09375-0.8125s0.12182-0.45534 0.3125-0.59375c0.07296-0.05211 0.15827-0.07303 0.25-0.09375h0.03125l0.125-0.03125a0.25002 0.25002 0 0 0 0.09375 -0.03125 0.25002 0.25002 0 0 0 0.09375 -0.09375 0.25002 0.25002 0 0 0 0.03125 -0.09375 0.25002 0.25002 0 0 0 0 -0.03125v-0.8125a0.25002 0.25002 0 0 0 -0.03125 -0.09375 0.25002 0.25002 0 0 0 -0.0625 -0.09375 0.25002 0.25002 0 0 0 -0.0625 -0.03125 0.25002 0.25002 0 0 0 -0.0625 -0.03125l-0.125-0.03125c-0.27587-0.04696-0.53876-0.2383-0.625-0.8125-0.0011-0.0092 0.0011-0.02193 0-0.03125-0.02172-0.18821-0.04698-0.41542-0.0625-0.625-0.07836-0.82274-0.40221
-1.3443-0.78125-1.6562-0.37904-0.31194-0.80161-0.41818-1.0625-0.4375h-0.125a0.25002 0.25002 0 0 0 -0.0625 0 0.25002 0.25002 0 0 0 -0.03125 0 0.25002 0.25002 0 0 0 -0.03125 0z" display="block"/>
+</svg>
Modified: trunk/Source/WebInspectorUI/UserInterface/Main.html (200473 => 200474)
--- trunk/Source/WebInspectorUI/UserInterface/Main.html 2016-05-05 20:27:12 UTC (rev 200473)
+++ trunk/Source/WebInspectorUI/UserInterface/Main.html 2016-05-05 20:34:17 UTC (rev 200474)
@@ -529,10 +529,10 @@
<script src=""
<script src=""
<script src=""
+ <script src=""
+ <script src=""
<script src=""
<script src=""
- <script src=""
- <script src=""
<script src=""
<script src=""
<script src=""
Modified: trunk/Source/WebInspectorUI/UserInterface/Views/HeapAllocationsTimelineView.js (200473 => 200474)
--- trunk/Source/WebInspectorUI/UserInterface/Views/HeapAllocationsTimelineView.js 2016-05-05 20:27:12 UTC (rev 200473)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/HeapAllocationsTimelineView.js 2016-05-05 20:34:17 UTC (rev 200474)
@@ -129,11 +129,11 @@
}
}
- let shouldManuallyTriggerContentViewUpdate = this._contentViewContainer.currentContentView && this._contentViewContainer.currentContentView.representedObject === heapSnapshotTimelineRecord.heapSnapshot;
+ let shouldTriggerContentViewUpdate = this._contentViewContainer.currentContentView && this._contentViewContainer.currentContentView.representedObject === heapSnapshotTimelineRecord.heapSnapshot;
this._contentViewContainer.showContentViewForRepresentedObject(heapSnapshotTimelineRecord.heapSnapshot);
- if (shouldManuallyTriggerContentViewUpdate)
+ if (shouldTriggerContentViewUpdate)
this._currentContentViewDidChange();
}
Modified: trunk/Source/WebInspectorUI/UserInterface/Views/HeapSnapshotClusterContentView.js (200473 => 200474)
--- trunk/Source/WebInspectorUI/UserInterface/Views/HeapSnapshotClusterContentView.js 2016-05-05 20:27:12 UTC (rev 200473)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/HeapSnapshotClusterContentView.js 2016-05-05 20:34:17 UTC (rev 200474)
@@ -43,14 +43,21 @@
this._shownInitialContent = false;
this._summaryContentView = null;
this._instancesContentView = null;
+ this._objectGraphContentView = null;
this._summaryPathComponent = createPathComponent.call(this, WebInspector.UIString("Summary"), "heap-snapshot-summary-icon", WebInspector.HeapSnapshotClusterContentView.SummaryIdentifier);
this._instancesPathComponent = createPathComponent.call(this, WebInspector.UIString("Instances"), "heap-snapshot-instances-icon", WebInspector.HeapSnapshotClusterContentView.InstancesIdentifier);
+ this._objectGraphPathComponent = createPathComponent.call(this, WebInspector.UIString("Object Graph"), "heap-snapshot-object-graph-icon", WebInspector.HeapSnapshotClusterContentView.ObjectGraphIdentifier);
this._summaryPathComponent.nextSibling = this._instancesPathComponent;
this._instancesPathComponent.previousSibling = this._summaryPathComponent;
- this._currentContentViewSetting = new WebInspector.Setting("heap-snapshot-cluster-current-view", WebInspector.HeapSnapshotClusterContentView.SummaryIdentifier);
+ if (this._supportsObjectGraph()) {
+ this._instancesPathComponent.nextSibling = this._objectGraphPathComponent;
+ this._objectGraphPathComponent.previousSibling = this._instancesPathComponent;
+ }
+
+ this._currentContentViewSetting = new WebInspector.Setting("heap-snapshot-cluster-current-view", WebInspector.HeapSnapshotClusterContentView.InstancesIdentifier);
}
// Static
@@ -118,6 +125,16 @@
return this._instancesContentView;
}
+ get objectGraphContentView()
+ {
+ if (!this._supportsObjectGraph())
+ return null;
+
+ if (!this._objectGraphContentView)
+ this._objectGraphContentView = new WebInspector.HeapSnapshotObjectGraphContentView(this._heapSnapshot);
+ return this._objectGraphContentView;
+ }
+
get selectionPathComponents()
{
let currentContentView = this._contentViewContainer.currentContentView;
@@ -167,8 +184,19 @@
return this._showContentViewForIdentifier(WebInspector.HeapSnapshotClusterContentView.InstancesIdentifier);
}
+ showObjectGraph()
+ {
+ this._shownInitialContent = true;
+ return this._showContentViewForIdentifier(WebInspector.HeapSnapshotClusterContentView.ObjectGraphIdentifier);
+ }
+
// Private
+ _supportsObjectGraph()
+ {
+ return this._heapSnapshot instanceof WebInspector.HeapSnapshotProxy;
+ }
+
_pathComponentForContentView(contentView)
{
console.assert(contentView);
@@ -178,6 +206,8 @@
return this._summaryPathComponent;
if (contentView === this._instancesContentView)
return this._instancesPathComponent;
+ if (contentView === this._objectGraphContentView)
+ return this._objectGraphPathComponent;
console.error("Unknown contentView.");
return null;
}
@@ -191,6 +221,8 @@
return WebInspector.HeapSnapshotClusterContentView.SummaryIdentifier;
if (contentView === this._instancesContentView)
return WebInspector.HeapSnapshotClusterContentView.InstancesIdentifier;
+ if (contentView === this._objectGraphContentView)
+ return WebInspector.HeapSnapshotClusterContentView.ObjectGraphIdentifier;
console.error("Unknown contentView.");
return null;
}
@@ -206,6 +238,9 @@
case WebInspector.HeapSnapshotClusterContentView.InstancesIdentifier:
contentViewToShow = this.instancesContentView;
break;
+ case WebInspector.HeapSnapshotClusterContentView.ObjectGraphIdentifier:
+ contentViewToShow = this.objectGraphContentView;
+ break;
}
if (!contentViewToShow)
@@ -230,3 +265,4 @@
WebInspector.HeapSnapshotClusterContentView.SummaryIdentifier = "summary";
WebInspector.HeapSnapshotClusterContentView.InstancesIdentifier = "instances";
+WebInspector.HeapSnapshotClusterContentView.ObjectGraphIdentifier = "object-graph";
Copied: trunk/Source/WebInspectorUI/UserInterface/Views/HeapSnapshotContentView.js (from rev 200473, trunk/Source/WebInspectorUI/UserInterface/Views/HeapSnapshotInstancesContentView.js) (0 => 200474)
--- trunk/Source/WebInspectorUI/UserInterface/Views/HeapSnapshotContentView.js (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/HeapSnapshotContentView.js 2016-05-05 20:34:17 UTC (rev 200474)
@@ -0,0 +1,151 @@
+/*
+ * Copyright (C) 2016 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+WebInspector.HeapSnapshotContentView = class HeapSnapshotContentView extends WebInspector.ContentView
+{
+ constructor(representedObject, identifier, columns, heapSnapshotDataGridTreeConstructor)
+ {
+ console.assert(representedObject instanceof WebInspector.HeapSnapshotProxy || representedObject instanceof WebInspector.HeapSnapshotDiffProxy);
+
+ super(representedObject);
+
+ this.element.classList.add("heap-snapshot");
+
+ this._dataGrid = new WebInspector.DataGrid(columns);
+ this._dataGrid.sortColumnIdentifierSetting = new WebInspector.Setting(identifier + "-sort", "retainedSize");
+ this._dataGrid.sortOrderSetting = new WebInspector.Setting(identifier + "-sort-order", WebInspector.DataGrid.SortOrder.Descending);
+ this._dataGrid.addEventListener(WebInspector.DataGrid.Event.SortChanged, this._sortDataGrid, this);
+
+ let sortComparator = WebInspector.HeapSnapshotDataGridTree.buildSortComparator(this._dataGrid.sortColumnIdentifier, this._dataGrid.sortOrder);
+ this._heapSnapshotDataGridTree = new heapSnapshotDataGridTreeConstructor(this.representedObject, sortComparator);
+ this._heapSnapshotDataGridTree.addEventListener(WebInspector.HeapSnapshotDataGridTree.Event.DidPopulate, this._heapSnapshotDataGridTreeDidPopulate, this);
+
+ for (let child of this._heapSnapshotDataGridTree.children)
+ this._dataGrid.appendChild(child);
+
+ this.addSubview(this._dataGrid);
+ this._dataGrid.updateLayout();
+ }
+
+ // Protected
+
+ shown()
+ {
+ super.shown();
+
+ this._heapSnapshotDataGridTree.shown();
+ }
+
+ hidden()
+ {
+ super.hidden();
+
+ this._heapSnapshotDataGridTree.hidden();
+ }
+
+ // Private
+
+ _sortDataGrid()
+ {
+ if (!this._heapSnapshotDataGridTree)
+ return;
+
+ this._heapSnapshotDataGridTree.sortComparator = WebInspector.HeapSnapshotDataGridTree.buildSortComparator(this._dataGrid.sortColumnIdentifier, this._dataGrid.sortOrder);
+
+ this._dataGrid.removeChildren();
+ for (let child of this._heapSnapshotDataGridTree.children)
+ this._dataGrid.appendChild(child);
+ }
+
+ _heapSnapshotDataGridTreeDidPopulate()
+ {
+ for (let child of this._heapSnapshotDataGridTree.children)
+ this._dataGrid.appendChild(child);
+ }
+};
+
+WebInspector.HeapSnapshotInstancesContentView = class HeapSnapshotInstancesContentView extends WebInspector.HeapSnapshotContentView
+{
+ constructor(representedObject)
+ {
+ let columns = {
+ retainedSize: {
+ title: WebInspector.UIString("Retained Size"),
+ tooltip: WebInspector.UIString("Size of the current object plus the size of all objects it keeps alive."),
+ width: "140px",
+ aligned: "right",
+ sortable: true,
+ },
+ size: {
+ title: WebInspector.UIString("Self Size"),
+ width: "90px",
+ aligned: "right",
+ sortable: true,
+ },
+ count: {
+ title: WebInspector.UIString("Count"),
+ width: "75px",
+ aligned: "right",
+ sortable: true,
+ },
+ className: {
+ title: WebInspector.UIString("Class Name"),
+ sortable: true,
+ disclosure: true,
+ }
+ };
+
+ super(representedObject, "heap-snapshot-instances-content-view", columns, WebInspector.HeapSnapshotInstancesDataGridTree);
+ }
+};
+
+WebInspector.HeapSnapshotObjectGraphContentView = class HeapSnapshotObjectGraphContentView extends WebInspector.HeapSnapshotContentView
+{
+ constructor(representedObject)
+ {
+ let columns = {
+ retainedSize: {
+ title: WebInspector.UIString("Retained Size"),
+ tooltip: WebInspector.UIString("Size of the current object plus the size of all objects it keeps alive."),
+ width: "140px",
+ aligned: "right",
+ sortable: true,
+ },
+ size: {
+ title: WebInspector.UIString("Self Size"),
+ width: "90px",
+ aligned: "right",
+ sortable: true,
+ },
+ className: {
+ title: WebInspector.UIString("Class Name"),
+ sortable: true,
+ disclosure: true,
+ }
+ };
+
+ super(representedObject, "heap-snapshot-object-graph-content-view", columns, WebInspector.HeapSnapshotObjectGraphDataGridTree);
+ }
+};
Copied: trunk/Source/WebInspectorUI/UserInterface/Views/HeapSnapshotDataGridTree.js (from rev 200473, trunk/Source/WebInspectorUI/UserInterface/Views/HeapSnapshotInstancesDataGridTree.js) (0 => 200474)
--- trunk/Source/WebInspectorUI/UserInterface/Views/HeapSnapshotDataGridTree.js (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/HeapSnapshotDataGridTree.js 2016-05-05 20:34:17 UTC (rev 200474)
@@ -0,0 +1,221 @@
+/*
+* Copyright (C) 2016 Apple Inc. All rights reserved.
+*
+* Redistribution and use in source and binary forms, with or without
+* modification, are permitted provided that the following conditions
+* are met:
+* 1. Redistributions of source code must retain the above copyright
+* notice, this list of conditions and the following disclaimer.
+* 2. Redistributions in binary form must reproduce the above copyright
+* notice, this list of conditions and the following disclaimer in the
+* documentation and/or other materials provided with the distribution.
+*
+* THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+* THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+WebInspector.HeapSnapshotDataGridTree = class HeapSnapshotDataGridTree extends WebInspector.Object
+{
+ constructor(heapSnapshot, sortComparator)
+ {
+ super();
+
+ console.assert(heapSnapshot instanceof WebInspector.HeapSnapshotProxy || heapSnapshot instanceof WebInspector.HeapSnapshotDiffProxy);
+
+ this._heapSnapshot = heapSnapshot;
+
+ this._children = [];
+ this._sortComparator = sortComparator;
+
+ this._visible = false;
+ this._popover = null;
+ this._popoverNode = null;
+
+ this.populateTopLevel();
+ }
+
+ // Static
+
+ static buildSortComparator(columnIdentifier, sortOrder)
+ {
+ let multiplier = sortOrder === WebInspector.DataGrid.SortOrder.Ascending ? 1 : -1;
+ let numberCompare = (columnIdentifier, a, b) => multiplier * (a.data[columnIdentifier] - b.data[columnIdentifier]);
+ let localeCompare = (columnIdentifier, a, b) => multiplier * (a.data[columnIdentifier].localeCompare(b.data[columnIdentifier]));
+
+ let comparator;
+ switch (columnIdentifier) {
+ case "retainedSize":
+ return numberCompare.bind(this, "retainedSize");
+ case "size":
+ return numberCompare.bind(this, "size");
+ case "count":
+ return numberCompare.bind(this, "count");
+ case "className":
+ return localeCompare.bind(this, "className");
+ }
+ }
+
+ // Public
+
+ get heapSnapshot() { return this._heapSnapshot; }
+
+ get visible()
+ {
+ return this._visible;
+ }
+
+ get popover()
+ {
+ if (!this._popover)
+ this._popover = new WebInspector.Popover(this);
+
+ return this._popover;
+ }
+
+ get popoverNode()
+ {
+ return this._popoverNode;
+ }
+
+ set popoverNode(x)
+ {
+ this._popoverNode = x;
+ }
+
+ get children()
+ {
+ return this._children;
+ }
+
+ appendChild(node)
+ {
+ this._children.push(node);
+ }
+
+ insertChild(node, index)
+ {
+ this._children.splice(index, 0, node);
+ }
+
+ removeChildren()
+ {
+ this._children = [];
+ }
+
+ set sortComparator(comparator)
+ {
+ this._sortComparator = comparator;
+ this.sort();
+ }
+
+ sort()
+ {
+ let children = this._children;
+ children.sort(this._sortComparator);
+
+ for (let i = 0; i < children.length; ++i) {
+ children[i]._recalculateSiblings(i);
+ children[i].sort();
+ }
+ }
+
+ shown()
+ {
+ this._visible = true;
+ }
+
+ hidden()
+ {
+ this._visible = false;
+
+ if (this._popover && this._popover.visible)
+ this._popover.dismiss();
+ }
+
+ // Popover delegate
+
+ willDismissPopover(popover)
+ {
+ this._popoverNode = null;
+ }
+
+ // Protected
+
+ get alwaysShowRetainedSize()
+ {
+ return false;
+ }
+
+ populateTopLevel()
+ {
+ // Implemented by subclasses.
+ }
+
+ didPopulate()
+ {
+ this.sort();
+
+ this.dispatchEventToListeners(WebInspector.HeapSnapshotDataGridTree.Event.DidPopulate);
+ }
+};
+
+WebInspector.HeapSnapshotDataGridTree.Event = {
+ DidPopulate: "heap-snapshot-data-grid-tree-did-populate",
+};
+
+WebInspector.HeapSnapshotInstancesDataGridTree = class HeapSnapshotInstancesDataGridTree extends WebInspector.HeapSnapshotDataGridTree
+{
+ get alwaysShowRetainedSize()
+ {
+ return false;
+ }
+
+ populateTopLevel()
+ {
+ // Populate the first level with the different non-internal classes.
+ for (let [className, {size, retainedSize, count, internalCount}] of this.heapSnapshot.categories) {
+ if (count === internalCount)
+ continue;
+ this.appendChild(new WebInspector.HeapSnapshotClassDataGridNode({className, size, retainedSize, count}, this));
+ }
+
+ this.didPopulate()
+ }
+};
+
+WebInspector.HeapSnapshotObjectGraphDataGridTree = class HeapSnapshotInstancesDataGridTree extends WebInspector.HeapSnapshotDataGridTree
+{
+ get alwaysShowRetainedSize()
+ {
+ return true;
+ }
+
+ populateTopLevel()
+ {
+ this.heapSnapshot.instancesWithClassName("GlobalObject", (instances) => {
+ for (let instance of instances)
+ this.appendChild(new WebInspector.HeapSnapshotInstanceDataGridNode(instance, this));
+ });
+
+ this.heapSnapshot.instancesWithClassName("Window", (instances) => {
+ for (let instance of instances) {
+ // FIXME: Why is the window.Window Function classified as a Window?
+ // In any case, ignore objects not dominated by the root, as they
+ // are probably not what we want.
+ if (instance.dominatorNodeIdentifier === 0)
+ this.appendChild(new WebInspector.HeapSnapshotInstanceDataGridNode(instance, this));
+ }
+
+ this.didPopulate();
+ });
+ }
+};
Modified: trunk/Source/WebInspectorUI/UserInterface/Views/HeapSnapshotInstanceDataGridNode.js (200473 => 200474)
--- trunk/Source/WebInspectorUI/UserInterface/Views/HeapSnapshotInstanceDataGridNode.js 2016-05-05 20:27:12 UTC (rev 200473)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/HeapSnapshotInstanceDataGridNode.js 2016-05-05 20:34:17 UTC (rev 200474)
@@ -82,7 +82,7 @@
if (node.className === "string") {
HeapAgent.getPreview(heapObjectIdentifier, function(error, string, functionDetails, objectPreviewPayload) {
let remoteObject = error ? WebInspector.RemoteObject.fromPrimitiveValue(undefined) : WebInspector.RemoteObject.fromPrimitiveValue(string);
- WebInspector.consoleLogViewController.appendImmediateExecutionWithResult(text, remoteObject, synthetic);
+ WebInspector.consoleLogViewController.appendImmediateExecutionWithResult(text, remoteObject, synthetic);
});
} else {
HeapAgent.getRemoteObject(heapObjectIdentifier, WebInspector.RuntimeManager.ConsoleObjectGroup, function(error, remoteObjectPayload) {
@@ -109,8 +109,8 @@
createCellContent(columnIdentifier)
{
if (columnIdentifier === "retainedSize") {
- let subRetainedSize = false;
- if (this._base) {
+ let subRetainedSize = false;
+ if (this._base && !this._tree.alwaysShowRetainedSize) {
if (this._isDominatedByNonBaseParent())
subRetainedSize = true;
else if (!this._isDominatedByBase())
@@ -164,48 +164,12 @@
let spacerElement = containerElement.appendChild(document.createElement("span"));
spacerElement.textContent = " ";
- HeapAgent.getPreview(id, (error, string, functionDetails, objectPreviewPayload) => {
- if (error) {
- let previewErrorElement = containerElement.appendChild(document.createElement("span"));
- previewErrorElement.classList.add("preview-error");
- previewErrorElement.textContent = internal ? WebInspector.UIString("Internal object") : WebInspector.UIString("No preview available");
- return;
- }
+ if (className === "Window" && this._node.dominatorNodeIdentifier === 0) {
+ containerElement.append("Window ");
+ this._populateWindowPreview(containerElement);
+ } else
+ this._populatePreview(containerElement);
- if (string) {
- let primitiveRemoteObject = WebInspector.RemoteObject.fromPrimitiveValue(string);
- containerElement.appendChild(WebInspector.FormattedValue.createElementForRemoteObject(primitiveRemoteObject));
- return;
- }
-
- if (functionDetails) {
- let {location, name, displayName} = functionDetails;
- let functionNameElement = containerElement.appendChild(document.createElement("span"));
- functionNameElement.classList.add("function-name");
- functionNameElement.textContent = name || displayName || WebInspector.UIString("(anonymous function)");
- let sourceCode = WebInspector.debuggerManager.scriptForIdentifier(location.scriptId);
- if (sourceCode) {
- let locationElement = containerElement.appendChild(document.createElement("span"));
- locationElement.classList.add("location");
- let sourceCodeLocation = sourceCode.createSourceCodeLocation(location.lineNumber, location.columnNumber);
- sourceCodeLocation.populateLiveDisplayLocationString(locationElement, "textContent", WebInspector.SourceCodeLocation.ColumnStyle.Hidden, WebInspector.SourceCodeLocation.NameStyle.Short);
-
- const dontFloat = true;
- const useGoToArrowButton = true;
- let goToArrowButtonLink = WebInspector.createSourceCodeLocationLink(sourceCodeLocation, dontFloat, useGoToArrowButton);
- containerElement.appendChild(goToArrowButtonLink);
- }
- return;
- }
-
- if (objectPreviewPayload) {
- let objectPreview = WebInspector.ObjectPreview.fromPayload(objectPreviewPayload);
- let previewElement = WebInspector.FormattedValue.createObjectPreviewOrFormattedValueForObjectPreview(objectPreview);
- containerElement.appendChild(previewElement);
- return;
- }
- });
-
return containerElement;
}
@@ -261,7 +225,7 @@
for (let instance of instances)
this.appendChild(new WebInspector.HeapSnapshotInstanceDataGridNode(instance, this._tree, instance.__edge, this._base || this));
- });
+ });
}
_contextMenuHandler(event)
@@ -271,6 +235,85 @@
contextMenu.appendItem(WebInspector.UIString("Log Value"), WebInspector.HeapSnapshotInstanceDataGridNode.logHeapSnapshotNode.bind(null, this._node));
}
+ _populateError(containerElement)
+ {
+ if (this._node.internal)
+ return;
+
+ let previewErrorElement = containerElement.appendChild(document.createElement("span"));
+ previewErrorElement.classList.add("preview-error");
+ previewErrorElement.textContent = WebInspector.UIString("No preview available");
+ }
+
+ _populateWindowPreview(containerElement)
+ {
+ HeapAgent.getRemoteObject(this._node.id, (error, remoteObjectPayload) => {
+ if (error) {
+ this._populateError(containerElement)
+ return;
+ }
+
+ function inspectedPage_window_getLocationHref() {
+ return this.location.href;
+ }
+
+ let remoteObject = WebInspector.RemoteObject.fromPayload(remoteObjectPayload);
+ remoteObject.callFunctionJSON(inspectedPage_window_getLocationHref, undefined, (href) => {
+ remoteObject.release();
+
+ if (!href)
+ this._populateError(containerElement);
+ else {
+ let primitiveRemoteObject = WebInspector.RemoteObject.fromPrimitiveValue(href);
+ containerElement.appendChild(WebInspector.FormattedValue.createElementForRemoteObject(primitiveRemoteObject));
+ }
+ });
+ });
+ }
+
+ _populatePreview(containerElement)
+ {
+ HeapAgent.getPreview(this._node.id, (error, string, functionDetails, objectPreviewPayload) => {
+ if (error) {
+ this._populateError(containerElement);
+ return;
+ }
+
+ if (string) {
+ let primitiveRemoteObject = WebInspector.RemoteObject.fromPrimitiveValue(string);
+ containerElement.appendChild(WebInspector.FormattedValue.createElementForRemoteObject(primitiveRemoteObject));
+ return;
+ }
+
+ if (functionDetails) {
+ let {location, name, displayName} = functionDetails;
+ let functionNameElement = containerElement.appendChild(document.createElement("span"));
+ functionNameElement.classList.add("function-name");
+ functionNameElement.textContent = name || displayName || WebInspector.UIString("(anonymous function)");
+ let sourceCode = WebInspector.debuggerManager.scriptForIdentifier(location.scriptId);
+ if (sourceCode) {
+ let locationElement = containerElement.appendChild(document.createElement("span"));
+ locationElement.classList.add("location");
+ let sourceCodeLocation = sourceCode.createSourceCodeLocation(location.lineNumber, location.columnNumber);
+ sourceCodeLocation.populateLiveDisplayLocationString(locationElement, "textContent", WebInspector.SourceCodeLocation.ColumnStyle.Hidden, WebInspector.SourceCodeLocation.NameStyle.Short);
+
+ const dontFloat = true;
+ const useGoToArrowButton = true;
+ let goToArrowButtonLink = WebInspector.createSourceCodeLocationLink(sourceCodeLocation, dontFloat, useGoToArrowButton);
+ containerElement.appendChild(goToArrowButtonLink);
+ }
+ return;
+ }
+
+ if (objectPreviewPayload) {
+ let objectPreview = WebInspector.ObjectPreview.fromPayload(objectPreviewPayload);
+ let previewElement = WebInspector.FormattedValue.createObjectPreviewOrFormattedValueForObjectPreview(objectPreview);
+ containerElement.appendChild(previewElement);
+ return;
+ }
+ });
+ }
+
_mouseoverHandler(event)
{
let targetFrame = WebInspector.Rect.rectFromClientRect(event.target.getBoundingClientRect());
Modified: trunk/Source/WebInspectorUI/UserInterface/Views/HeapSnapshotInstancesContentView.css (200473 => 200474)
--- trunk/Source/WebInspectorUI/UserInterface/Views/HeapSnapshotInstancesContentView.css 2016-05-05 20:27:12 UTC (rev 200473)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/HeapSnapshotInstancesContentView.css 2016-05-05 20:34:17 UTC (rev 200474)
@@ -49,10 +49,6 @@
text-decoration: underline;
}
-.heap-snapshot > .data-grid tr:not(.selected) td .preview-error {
- color: red;
-}
-
.heap-snapshot > .data-grid td .location {
margin-left: 1ex;
color: hsl(0, 0%, 60%);
Deleted: trunk/Source/WebInspectorUI/UserInterface/Views/HeapSnapshotInstancesContentView.js (200473 => 200474)
--- trunk/Source/WebInspectorUI/UserInterface/Views/HeapSnapshotInstancesContentView.js 2016-05-05 20:27:12 UTC (rev 200473)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/HeapSnapshotInstancesContentView.js 2016-05-05 20:34:17 UTC (rev 200474)
@@ -1,107 +0,0 @@
-/*
- * Copyright (C) 2016 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-WebInspector.HeapSnapshotInstancesContentView = class HeapSnapshotInstancesContentView extends WebInspector.ContentView
-{
- constructor(representedObject)
- {
- console.assert(representedObject instanceof WebInspector.HeapSnapshotProxy || representedObject instanceof WebInspector.HeapSnapshotDiffProxy);
-
- super(representedObject);
-
- this.element.classList.add("heap-snapshot");
-
- let columns = {
- retainedSize: {
- title: WebInspector.UIString("Retained Size"),
- tooltip: WebInspector.UIString("Size of the current object plus the size of all objects it keeps alive."),
- width: "140px",
- aligned: "right",
- sortable: true,
- },
- size: {
- title: WebInspector.UIString("Self Size"),
- width: "90px",
- aligned: "right",
- sortable: true,
- },
- count: {
- title: WebInspector.UIString("Count"),
- width: "75px",
- aligned: "right",
- sortable: true,
- },
- className: {
- title: WebInspector.UIString("Class Name"),
- sortable: true,
- disclosure: true,
- }
- };
-
- this._dataGrid = new WebInspector.DataGrid(columns);
- this._dataGrid.sortColumnIdentifierSetting = new WebInspector.Setting("heap-snapshot-content-view-sort", "retainedSize");
- this._dataGrid.sortOrderSetting = new WebInspector.Setting("heap-snapshot-content-view-sort-order", WebInspector.DataGrid.SortOrder.Descending);
- this._dataGrid.addEventListener(WebInspector.DataGrid.Event.SortChanged, this._sortDataGrid, this);
-
- let sortComparator = WebInspector.HeapSnapshotInstancesDataGridTree.buildSortComparator(this._dataGrid.sortColumnIdentifier, this._dataGrid.sortOrder);
- this._heapSnapshotDataGridTree = new WebInspector.HeapSnapshotInstancesDataGridTree(this.representedObject, sortComparator);
-
- for (let child of this._heapSnapshotDataGridTree.children)
- this._dataGrid.appendChild(child);
-
- this.addSubview(this._dataGrid);
- this._dataGrid.updateLayout();
- }
-
- // Protected
-
- shown()
- {
- super.shown();
-
- this._heapSnapshotDataGridTree.shown();
- }
-
- hidden()
- {
- super.hidden();
-
- this._heapSnapshotDataGridTree.hidden();
- }
-
- // Private
-
- _sortDataGrid()
- {
- if (!this._heapSnapshotDataGridTree)
- return;
-
- this._heapSnapshotDataGridTree.sortComparator = WebInspector.HeapSnapshotInstancesDataGridTree.buildSortComparator(this._dataGrid.sortColumnIdentifier, this._dataGrid.sortOrder);
-
- this._dataGrid.removeChildren();
- for (let child of this._heapSnapshotDataGridTree.children)
- this._dataGrid.appendChild(child);
- }
-};
Deleted: trunk/Source/WebInspectorUI/UserInterface/Views/HeapSnapshotInstancesDataGridTree.js (200473 => 200474)
--- trunk/Source/WebInspectorUI/UserInterface/Views/HeapSnapshotInstancesDataGridTree.js 2016-05-05 20:27:12 UTC (rev 200473)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/HeapSnapshotInstancesDataGridTree.js 2016-05-05 20:34:17 UTC (rev 200474)
@@ -1,165 +0,0 @@
-/*
-* Copyright (C) 2016 Apple Inc. All rights reserved.
-*
-* Redistribution and use in source and binary forms, with or without
-* modification, are permitted provided that the following conditions
-* are met:
-* 1. Redistributions of source code must retain the above copyright
-* notice, this list of conditions and the following disclaimer.
-* 2. Redistributions in binary form must reproduce the above copyright
-* notice, this list of conditions and the following disclaimer in the
-* documentation and/or other materials provided with the distribution.
-*
-* THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
-* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
-* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
-* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
-* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
-* THE POSSIBILITY OF SUCH DAMAGE.
-*/
-
-WebInspector.HeapSnapshotInstancesDataGridTree = class HeapSnapshotInstancesDataGridTree extends WebInspector.Object
-{
- constructor(heapSnapshot, sortComparator)
- {
- super();
-
- console.assert(heapSnapshot instanceof WebInspector.HeapSnapshotProxy || heapSnapshot instanceof WebInspector.HeapSnapshotDiffProxy);
-
- this._heapSnapshot = heapSnapshot;
-
- this._children = [];
- this._sortComparator = sortComparator;
-
- this._visible = false;
- this._popover = null;
- this._popoverNode = null;
-
- this._populateTopLevel();
- this.sort();
- }
-
- // Static
-
- static buildSortComparator(columnIdentifier, sortOrder)
- {
- let multiplier = sortOrder === WebInspector.DataGrid.SortOrder.Ascending ? 1 : -1;
- let numberCompare = (columnIdentifier, a, b) => multiplier * (a.data[columnIdentifier] - b.data[columnIdentifier]);
- let localeCompare = (columnIdentifier, a, b) => multiplier * (a.data[columnIdentifier].localeCompare(b.data[columnIdentifier]));
-
- let comparator;
- switch (columnIdentifier) {
- case "retainedSize":
- return numberCompare.bind(this, "retainedSize");
- case "size":
- return numberCompare.bind(this, "size");
- case "count":
- return numberCompare.bind(this, "count");
- case "className":
- return localeCompare.bind(this, "className");
- }
- }
-
- // Public
-
- get heapSnapshot() { return this._heapSnapshot; }
-
- get visible()
- {
- return this._visible;
- }
-
- get popover()
- {
- if (!this._popover)
- this._popover = new WebInspector.Popover(this);
-
- return this._popover;
- }
-
- get popoverNode()
- {
- return this._popoverNode;
- }
-
- set popoverNode(x)
- {
- this._popoverNode = x;
- }
-
- get children()
- {
- return this._children;
- }
-
- appendChild(node)
- {
- this._children.push(node);
- }
-
- insertChild(node, index)
- {
- this._children.splice(index, 0, node);
- }
-
- removeChildren()
- {
- this._children = [];
- }
-
- set sortComparator(comparator)
- {
- this._sortComparator = comparator;
- this.sort();
- }
-
- sort()
- {
- let children = this._children;
- children.sort(this._sortComparator);
-
- for (let i = 0; i < children.length; ++i) {
- children[i]._recalculateSiblings(i);
- children[i].sort();
- }
- }
-
- shown()
- {
- this._visible = true;
- }
-
- hidden()
- {
- this._visible = false;
-
- if (this._popover && this._popover.visible)
- this._popover.dismiss();
- }
-
- // Popover delegate
-
- willDismissPopover(popover)
- {
- this._popoverNode = null;
- }
-
- // Private
-
- _populateTopLevel()
- {
- this.removeChildren();
-
- // Populate the first level with the different non-internal classes.
- for (let [className, {size, retainedSize, count, internalCount}] of this._heapSnapshot.categories) {
- if (count === internalCount)
- continue;
- this.appendChild(new WebInspector.HeapSnapshotClassDataGridNode({className, size, retainedSize, count}, this));
- }
- }
-};
Modified: trunk/Source/WebInspectorUI/UserInterface/Views/PathComponentIcons.css (200473 => 200474)
--- trunk/Source/WebInspectorUI/UserInterface/Views/PathComponentIcons.css 2016-05-05 20:27:12 UTC (rev 200473)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/PathComponentIcons.css 2016-05-05 20:34:17 UTC (rev 200474)
@@ -39,6 +39,10 @@
content: url(../Images/HeapSnapshotInstances.svg);
}
+.heap-snapshot-object-graph-icon .icon {
+ content: url(../Images/HeapSnapshotObjectGraph.svg);
+}
+
.dom-element-icon .icon {
content: url(../Images/DOMElement.svg);
}