<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[197954] trunk/Source</title>
</head>
<body>
<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/197954">197954</a></dd>
<dt>Author</dt> <dd>joepeck@webkit.org</dd>
<dt>Date</dt> <dd>2016-03-10 13:37:56 -0800 (Thu, 10 Mar 2016)</dd>
</dl>
<h3>Log Message</h3>
<pre>Web Inspector: JavaScript Heap Allocations Timeline
https://bugs.webkit.org/show_bug.cgi?id=155287
<rdar://problem/25078088>
Reviewed by Timothy Hatcher.
Source/JavaScriptCore:
* inspector/InjectedScriptSource.js:
(InjectedScript.prototype._describe):
(InjectedScript.prototype._nodeDescription):
Provide the nicer node preview more often.
Source/WebInspectorUI:
Initial JavaScript Heap Allocations Timeline includes:
- Snapshot markers in the timeline
- Initial/Periodic/End snapshots during recording
- Ability to manually take a snapshot
- View of all objects in a Snapshot and Diff between snapshots
- Summary view - rough display of the size/count of large objects
- Instances view - view each of the individual objects
* UserInterface/Main.html:
* UserInterface/Test.html:
* UserInterface/Images/Compare.svg: Added.
* UserInterface/Images/HeapSnapshot.svg: Added.
* UserInterface/Images/HeapSnapshotDiff.svg: Added.
* UserInterface/Images/HeapSnapshotInstances.svg: Added.
* UserInterface/Images/HeapSnapshotSummary.svg: Added.
* Localizations/en.lproj/localizedStrings.js:
New resources and strings.
* UserInterface/Controllers/TimelineManager.js:
(WebInspector.TimelineManager.prototype.heapTrackingStarted):
(WebInspector.TimelineManager.prototype.heapTrackingCompleted):
(WebInspector.TimelineManager.prototype.heapSnapshotAdded):
* UserInterface/Protocol/HeapObserver.js:
(WebInspector.HeapObserver.prototype.trackingStart):
(WebInspector.HeapObserver.prototype.trackingComplete):
(WebInspector.HeapObserver):
Add snapshot records to the active recording's timeline.
* UserInterface/Models/HeapAllocationsInstrument.js: Added.
(WebInspector.HeapAllocationsInstrument):
(WebInspector.HeapAllocationsInstrument.supported):
(WebInspector.HeapAllocationsInstrument.prototype.get timelineRecordType):
(WebInspector.HeapAllocationsInstrument.prototype.startInstrumentation):
(WebInspector.HeapAllocationsInstrument.prototype.stopInstrumentation):
(WebInspector.HeapAllocationsInstrument.prototype._takeHeapSnapshot):
Start, stop, and periodic snapshots.
* UserInterface/Models/HeapAllocationsTimelineRecord.js:
(WebInspector.HeapAllocationsTimelineRecord):
(WebInspector.HeapAllocationsTimelineRecord.prototype.get timestamp):
(WebInspector.HeapAllocationsTimelineRecord.prototype.get heapSnapshot):
* UserInterface/Models/TimelineRecord.js:
* UserInterface/Models/TimelineRecording.js:
(WebInspector.TimelineRecording):
(WebInspector.TimelineRecording.prototype.addRecord):
* UserInterface/Views/TimelineOverviewGraph.js:
(WebInspector.TimelineOverviewGraph.createForTimeline):
* UserInterface/Views/TimelineTabContentView.js:
(WebInspector.TimelineTabContentView.displayNameForTimeline):
(WebInspector.TimelineTabContentView.iconClassNameForTimeline):
(WebInspector.TimelineTabContentView.genericClassNameForTimeline):
(WebInspector.TimelineTabContentView.iconClassNameForRecord):
(WebInspector.TimelineTabContentView.displayNameForRecord):
New timeline and record type.
* UserInterface/Models/HeapSnapshotDiff.js: Added.
(WebInspector.HeapSnapshotDiff):
(WebInspector.HeapSnapshotDiff.prototype.get snapshot1):
(WebInspector.HeapSnapshotDiff.prototype.get snapshot2):
(WebInspector.HeapSnapshotDiff.prototype.get addedInstances):
(WebInspector.HeapSnapshotDiff.prototype.get removedInstances):
(WebInspector.HeapSnapshotDiff.prototype.get sizeDifference):
(WebInspector.HeapSnapshotDiff.prototype.get growth):
(WebInspector.HeapSnapshotDiff.prototype.snapshotForDiff):
Compare two snapshots and create a "diff snapshot" which is just
the newly added objects.
* UserInterface/Views/ContentView.js:
(WebInspector.ContentView.createFromRepresentedObject):
(WebInspector.ContentView.isViewable):
A HeapSnapshot creates a HeapSnapshotClusterView.
* UserInterface/Views/HeapAllocationsTimelineDataGridNode.js: Added.
(WebInspector.HeapAllocationsTimelineDataGridNode):
(WebInspector.HeapAllocationsTimelineDataGridNode.prototype.get record):
(WebInspector.HeapAllocationsTimelineDataGridNode.prototype.get data):
(WebInspector.HeapAllocationsTimelineDataGridNode.prototype.createCellContent):
(WebInspector.HeapAllocationsTimelineDataGridNode.prototype.markAsBaseline):
(WebInspector.HeapAllocationsTimelineDataGridNode.prototype.clearBaseline):
* UserInterface/Views/HeapAllocationsTimelineOverviewGraph.css: Copied from Source/WebInspectorUI/UserInterface/Protocol/HeapObserver.js.
(.timeline-overview-graph.heap-allocations):
(.timeline-overview-graph.heap-allocations > img.snapshot):
* UserInterface/Views/HeapAllocationsTimelineOverviewGraph.js: Added.
(WebInspector.HeapAllocationsTimelineOverviewGraph):
(WebInspector.HeapAllocationsTimelineOverviewGraph.prototype.reset):
(WebInspector.HeapAllocationsTimelineOverviewGraph.prototype.layout.xScale):
(WebInspector.HeapAllocationsTimelineOverviewGraph.prototype.layout):
(WebInspector.HeapAllocationsTimelineOverviewGraph.prototype._visibleRecords):
(WebInspector.HeapAllocationsTimelineOverviewGraph.prototype._heapAllocationTimelineRecordAdded):
* UserInterface/Views/HeapAllocationsTimelineView.css: Copied from Source/WebInspectorUI/UserInterface/Protocol/HeapObserver.js.
(.timeline-view.heap-allocations > .data-grid):
(.timeline-view.heap-allocations > .data-grid td .icon.heap-snapshot):
(.timeline-view.heap-allocations > .data-grid tr.baseline):
(.timeline-view.heap-allocations > .content-view-container):
(.timeline-view.heap-allocations > .content-view-container > .content-view):
* UserInterface/Views/HeapAllocationsTimelineView.js: Added.
(WebInspector.HeapAllocationsTimelineView):
(WebInspector.HeapAllocationsTimelineView.prototype.showHeapSnapshotList):
(WebInspector.HeapAllocationsTimelineView.prototype.showHeapSnapshotTimelineRecord):
(WebInspector.HeapAllocationsTimelineView.prototype.showHeapSnapshotDiff):
(WebInspector.HeapAllocationsTimelineView.prototype.get navigationItems):
(WebInspector.HeapAllocationsTimelineView.prototype.get selectionPathComponents):
(WebInspector.HeapAllocationsTimelineView.prototype.get navigationSidebarTreeOutlineLabel):
(WebInspector.HeapAllocationsTimelineView.prototype.treeElementPathComponentSelected):
(WebInspector.HeapAllocationsTimelineView.prototype.userSelectedRecordFromOverview):
(WebInspector.HeapAllocationsTimelineView.prototype.closed):
(WebInspector.HeapAllocationsTimelineView.prototype.layout):
(WebInspector.HeapAllocationsTimelineView.prototype.reset):
(WebInspector.HeapAllocationsTimelineView.prototype._heapAllocationsTimelineRecordAdded):
(WebInspector.HeapAllocationsTimelineView.prototype._snapshotListPathComponentClicked):
(WebInspector.HeapAllocationsTimelineView.prototype._snapshotPathComponentSelected):
(WebInspector.HeapAllocationsTimelineView.prototype._currentContentViewDidChange):
(WebInspector.HeapAllocationsTimelineView.prototype._contentViewSelectionPathComponentDidChange):
(WebInspector.HeapAllocationsTimelineView.prototype._updateCompareHeapSnapshotButton):
(WebInspector.HeapAllocationsTimelineView.prototype._takeHeapSnapshotClicked):
(WebInspector.HeapAllocationsTimelineView.prototype._cancelSelectComparisonHeapSnapshots):
(WebInspector.HeapAllocationsTimelineView.prototype._compareHeapSnapshotsClicked):
(WebInspector.HeapAllocationsTimelineView.prototype._dataGridNodeSelected):
* UserInterface/Views/HeapSnapshotClassDataGridNode.js: Added.
(WebInspector.HeapSnapshotClassDataGridNode):
(WebInspector.HeapSnapshotClassDataGridNode.prototype.get data):
(WebInspector.HeapSnapshotClassDataGridNode.prototype.createCellContent):
(WebInspector.HeapSnapshotClassDataGridNode.prototype.sort):
(WebInspector.HeapSnapshotClassDataGridNode.prototype._populate):
(WebInspector.HeapSnapshotClassDataGridNode.prototype._fetchBatch):
(WebInspector.HeapSnapshotClassDataGridNode.prototype._updateBatchedSort):
(WebInspector.HeapSnapshotClassDataGridNode.prototype._updateBatchedChildren):
(WebInspector.HeapSnapshotClassDataGridNode.prototype._removeFetchMoreDataGridNode):
(WebInspector.HeapSnapshotClassDataGridNode.prototype._appendFetchMoreDataGridNode):
* UserInterface/Views/HeapSnapshotClusterContentView.js: Added.
(WebInspector.HeapSnapshotClusterContentView.createPathComponent):
(WebInspector.HeapSnapshotClusterContentView):
(WebInspector.HeapSnapshotClusterContentView.iconStyleClassNameForClassName):
(WebInspector.HeapSnapshotClusterContentView.prototype.get heapSnapshot):
(WebInspector.HeapSnapshotClusterContentView.prototype.get summaryContentView):
(WebInspector.HeapSnapshotClusterContentView.prototype.get instancesContentView):
(WebInspector.HeapSnapshotClusterContentView.prototype.get navigationItems):
(WebInspector.HeapSnapshotClusterContentView.prototype.get selectionPathComponents):
(WebInspector.HeapSnapshotClusterContentView.prototype.shown):
(WebInspector.HeapSnapshotClusterContentView.prototype.closed):
(WebInspector.HeapSnapshotClusterContentView.prototype.saveToCookie):
(WebInspector.HeapSnapshotClusterContentView.prototype.restoreFromCookie):
(WebInspector.HeapSnapshotClusterContentView.prototype.showSummary):
(WebInspector.HeapSnapshotClusterContentView.prototype.showInstances):
(WebInspector.HeapSnapshotClusterContentView.prototype._contentViewExtraArguments):
(WebInspector.HeapSnapshotClusterContentView.prototype._pathComponentForContentView):
(WebInspector.HeapSnapshotClusterContentView.prototype._identifierForContentView):
(WebInspector.HeapSnapshotClusterContentView.prototype._showContentViewForIdentifier):
(WebInspector.HeapSnapshotClusterContentView.prototype._pathComponentSelected):
(WebInspector.HeapSnapshotClusterContentView.prototype._toggleShowInternalObjectsSetting):
(WebInspector.HeapSnapshotClusterContentView.prototype._updateViewsForShowInternalObjectsSettingValue):
(WebInspector.HeapSnapshotClusterContentView.prototype._updateShowInternalObjectsButtonNavigationItem):
* UserInterface/Views/HeapSnapshotInstanceDataGridNode.js: Added.
(WebInspector.HeapSnapshotInstanceDataGridNode):
(WebInspector.HeapSnapshotInstanceDataGridNode.prototype.get data):
(WebInspector.HeapSnapshotInstanceDataGridNode.prototype.get selectable):
(WebInspector.HeapSnapshotInstanceDataGridNode.prototype.createCells):
(WebInspector.HeapSnapshotInstanceDataGridNode.prototype.createCellContent):
(WebInspector.HeapSnapshotInstanceDataGridNode.prototype.sort):
(WebInspector.HeapSnapshotInstanceDataGridNode.prototype._contextMenuHandler.):
(WebInspector.HeapSnapshotInstanceDataGridNode.prototype._contextMenuHandler):
* UserInterface/Views/HeapSnapshotInstanceFetchMoreDataGridNode.js: Added.
(WebInspector.HeapSnapshotInstanceFetchMoreDataGridNode):
(WebInspector.HeapSnapshotInstanceFetchMoreDataGridNode.prototype.createCellContent):
(WebInspector.HeapSnapshotInstanceFetchMoreDataGridNode.prototype.sort):
* UserInterface/Views/HeapSnapshotInstancesContentView.css: Added.
* UserInterface/Views/HeapSnapshotInstancesContentView.js: Added.
(WebInspector.HeapSnapshotInstancesContentView):
(WebInspector.HeapSnapshotInstancesContentView.prototype.get showInternalObjects):
(WebInspector.HeapSnapshotInstancesContentView.prototype.set showInternalObjects):
(WebInspector.HeapSnapshotInstancesContentView.prototype._sortDataGrid):
* UserInterface/Views/HeapSnapshotInstancesDataGridTree.js: Added.
(WebInspector.HeapSnapshotInstancesDataGridTree):
(WebInspector.HeapSnapshotInstancesDataGridTree.buildSortComparator):
(WebInspector.HeapSnapshotInstancesDataGridTree.prototype.get heapSnapshot):
(WebInspector.HeapSnapshotInstancesDataGridTree.prototype.get includeInternalObjects):
(WebInspector.HeapSnapshotInstancesDataGridTree.prototype.set includeInternalObjects):
(WebInspector.HeapSnapshotInstancesDataGridTree.prototype.get children):
(WebInspector.HeapSnapshotInstancesDataGridTree.prototype.appendChild):
(WebInspector.HeapSnapshotInstancesDataGridTree.prototype.insertChild):
(WebInspector.HeapSnapshotInstancesDataGridTree.prototype.removeChildren):
(WebInspector.HeapSnapshotInstancesDataGridTree.prototype.set sortComparator):
(WebInspector.HeapSnapshotInstancesDataGridTree.prototype.sort):
(WebInspector.HeapSnapshotInstancesDataGridTree.prototype._populateTopLevel):
* UserInterface/Views/HeapSnapshotSummaryContentView.css: Added.
* UserInterface/Views/HeapSnapshotSummaryContentView.js: Added.
(WebInspector.HeapSnapshotSummaryContentView.createChartContainer):
(WebInspector.HeapSnapshotSummaryContentView.appendLegendRow):
(WebInspector.HeapSnapshotSummaryContentView.appendEmptyMessage):
(WebInspector.HeapSnapshotSummaryContentView):
(WebInspector.HeapSnapshotSummaryContentView.prototype.layout):
* UserInterface/Views/PathComponentIcons.css:
(.heap-snapshot-summary-icon .icon):
(.heap-snapshot-instances-icon .icon):
(.snapshot-list-icon .icon):
(.snapshot-diff-icon .icon):
(body:not(.mac-platform, .windows-platform) .snapshot-diff-icon .icon):
(body:not(.mac-platform, .windows-platform) .call-trees-icon .icon): Deleted.
* UserInterface/Views/TextNavigationItem.css:
(.navigation-bar .item.text):
* UserInterface/Views/TextNavigationItem.js:
(WebInspector.TextNavigationItem):
(WebInspector.TextNavigationItem.prototype.get text):
(WebInspector.TextNavigationItem.prototype.set text):
* UserInterface/Views/TimelineIcons.css:
(.heap-snapshot-record .icon):
* UserInterface/Views/Variables.css:
(:root):
New views.
* UserInterface/Views/FormattedValue.js:
(WebInspector.FormattedValue.createElementForNodePreview):
(WebInspector.FormattedValue.createElementForFunctionWithName):
(WebInspector.FormattedValue.createObjectPreviewOrFormattedValueForObjectPreview):
Better display for a raw object preview.
* UserInterface/Views/TimelineOverview.js:
(WebInspector.TimelineOverview):
(WebInspector.TimelineOverview.prototype.userSelectedRecord):
* UserInterface/Views/TimelineRecordingContentView.js:
(WebInspector.TimelineRecordingContentView):
(WebInspector.TimelineRecordingContentView.prototype.timelineOverviewUserSelectedRecord):
* UserInterface/Views/TimelineRuler.js:
(WebInspector.TimelineRuler.prototype.set allowsTimeRangeSelection):
(WebInspector.TimelineRuler.prototype._handleClick):
(WebInspector.TimelineRuler.prototype._handleMouseDown):
(WebInspector.TimelineRuler.prototype._handleMouseMove):
* UserInterface/Views/TimelineView.js:
(WebInspector.TimelineView.prototype.userSelectedRecordFromOverview):
Hook up a way for clicking in the TimelineOverview / TimelineRuler
to redispatch to an OverviewGraph element, and provide a patch for
the Overview -> RecordingContentView -> TimelineView for records.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceJavaScriptCoreChangeLog">trunk/Source/JavaScriptCore/ChangeLog</a></li>
<li><a href="#trunkSourceJavaScriptCoreinspectorInjectedScriptSourcejs">trunk/Source/JavaScriptCore/inspector/InjectedScriptSource.js</a></li>
<li><a href="#trunkSourceWebInspectorUIChangeLog">trunk/Source/WebInspectorUI/ChangeLog</a></li>
<li><a href="#trunkSourceWebInspectorUILocalizationsenlprojlocalizedStringsjs">trunk/Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceControllersTimelineManagerjs">trunk/Source/WebInspectorUI/UserInterface/Controllers/TimelineManager.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceMainhtml">trunk/Source/WebInspectorUI/UserInterface/Main.html</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceModelsTimelineRecordjs">trunk/Source/WebInspectorUI/UserInterface/Models/TimelineRecord.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceModelsTimelineRecordingjs">trunk/Source/WebInspectorUI/UserInterface/Models/TimelineRecording.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceProtocolHeapObserverjs">trunk/Source/WebInspectorUI/UserInterface/Protocol/HeapObserver.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceTesthtml">trunk/Source/WebInspectorUI/UserInterface/Test.html</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsContentViewjs">trunk/Source/WebInspectorUI/UserInterface/Views/ContentView.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsFormattedValuejs">trunk/Source/WebInspectorUI/UserInterface/Views/FormattedValue.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsPathComponentIconscss">trunk/Source/WebInspectorUI/UserInterface/Views/PathComponentIcons.css</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsTimelineIconscss">trunk/Source/WebInspectorUI/UserInterface/Views/TimelineIcons.css</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsTimelineOverviewjs">trunk/Source/WebInspectorUI/UserInterface/Views/TimelineOverview.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsTimelineOverviewGraphjs">trunk/Source/WebInspectorUI/UserInterface/Views/TimelineOverviewGraph.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsTimelineRecordingContentViewjs">trunk/Source/WebInspectorUI/UserInterface/Views/TimelineRecordingContentView.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsTimelineRulerjs">trunk/Source/WebInspectorUI/UserInterface/Views/TimelineRuler.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsTimelineTabContentViewjs">trunk/Source/WebInspectorUI/UserInterface/Views/TimelineTabContentView.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsTimelineViewjs">trunk/Source/WebInspectorUI/UserInterface/Views/TimelineView.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsVariablescss">trunk/Source/WebInspectorUI/UserInterface/Views/Variables.css</a></li>
</ul>
<h3>Added Paths</h3>
<ul>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceImagesComparesvg">trunk/Source/WebInspectorUI/UserInterface/Images/Compare.svg</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceImagesHeapSnapshotsvg">trunk/Source/WebInspectorUI/UserInterface/Images/HeapSnapshot.svg</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceImagesHeapSnapshotDiffsvg">trunk/Source/WebInspectorUI/UserInterface/Images/HeapSnapshotDiff.svg</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceImagesHeapSnapshotInstancessvg">trunk/Source/WebInspectorUI/UserInterface/Images/HeapSnapshotInstances.svg</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceImagesHeapSnapshotSummarysvg">trunk/Source/WebInspectorUI/UserInterface/Images/HeapSnapshotSummary.svg</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceModelsHeapAllocationsInstrumentjs">trunk/Source/WebInspectorUI/UserInterface/Models/HeapAllocationsInstrument.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceModelsHeapAllocationsTimelineRecordjs">trunk/Source/WebInspectorUI/UserInterface/Models/HeapAllocationsTimelineRecord.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceModelsHeapSnapshotDiffjs">trunk/Source/WebInspectorUI/UserInterface/Models/HeapSnapshotDiff.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsHeapAllocationsTimelineDataGridNodejs">trunk/Source/WebInspectorUI/UserInterface/Views/HeapAllocationsTimelineDataGridNode.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsHeapAllocationsTimelineOverviewGraphcss">trunk/Source/WebInspectorUI/UserInterface/Views/HeapAllocationsTimelineOverviewGraph.css</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsHeapAllocationsTimelineOverviewGraphjs">trunk/Source/WebInspectorUI/UserInterface/Views/HeapAllocationsTimelineOverviewGraph.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsHeapAllocationsTimelineViewcss">trunk/Source/WebInspectorUI/UserInterface/Views/HeapAllocationsTimelineView.css</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsHeapAllocationsTimelineViewjs">trunk/Source/WebInspectorUI/UserInterface/Views/HeapAllocationsTimelineView.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsHeapSnapshotClassDataGridNodejs">trunk/Source/WebInspectorUI/UserInterface/Views/HeapSnapshotClassDataGridNode.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsHeapSnapshotClusterContentViewjs">trunk/Source/WebInspectorUI/UserInterface/Views/HeapSnapshotClusterContentView.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsHeapSnapshotInstanceDataGridNodejs">trunk/Source/WebInspectorUI/UserInterface/Views/HeapSnapshotInstanceDataGridNode.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsHeapSnapshotInstanceFetchMoreDataGridNodejs">trunk/Source/WebInspectorUI/UserInterface/Views/HeapSnapshotInstanceFetchMoreDataGridNode.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsHeapSnapshotInstancesContentViewcss">trunk/Source/WebInspectorUI/UserInterface/Views/HeapSnapshotInstancesContentView.css</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsHeapSnapshotInstancesContentViewjs">trunk/Source/WebInspectorUI/UserInterface/Views/HeapSnapshotInstancesContentView.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsHeapSnapshotInstancesDataGridTreejs">trunk/Source/WebInspectorUI/UserInterface/Views/HeapSnapshotInstancesDataGridTree.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsHeapSnapshotSummaryContentViewcss">trunk/Source/WebInspectorUI/UserInterface/Views/HeapSnapshotSummaryContentView.css</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsHeapSnapshotSummaryContentViewjs">trunk/Source/WebInspectorUI/UserInterface/Views/HeapSnapshotSummaryContentView.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsTextNavigationItemcss">trunk/Source/WebInspectorUI/UserInterface/Views/TextNavigationItem.css</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsTextNavigationItemjs">trunk/Source/WebInspectorUI/UserInterface/Views/TextNavigationItem.js</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceJavaScriptCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/ChangeLog (197953 => 197954)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/ChangeLog        2016-03-10 21:35:10 UTC (rev 197953)
+++ trunk/Source/JavaScriptCore/ChangeLog        2016-03-10 21:37:56 UTC (rev 197954)
</span><span class="lines">@@ -1,3 +1,16 @@
</span><ins>+2016-03-09 Joseph Pecoraro <pecoraro@apple.com>
+
+ Web Inspector: JavaScript Heap Allocations Timeline
+ https://bugs.webkit.org/show_bug.cgi?id=155287
+ <rdar://problem/25078088>
+
+ Reviewed by Timothy Hatcher.
+
+ * inspector/InjectedScriptSource.js:
+ (InjectedScript.prototype._describe):
+ (InjectedScript.prototype._nodeDescription):
+ Provide the nicer node preview more often.
+
</ins><span class="cx"> 2016-03-10 Saam barati <sbarati@apple.com>
</span><span class="cx">
</span><span class="cx"> Assignment to new.target should be an early error
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreinspectorInjectedScriptSourcejs"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/inspector/InjectedScriptSource.js (197953 => 197954)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/inspector/InjectedScriptSource.js        2016-03-10 21:35:10 UTC (rev 197953)
+++ trunk/Source/JavaScriptCore/inspector/InjectedScriptSource.js        2016-03-10 21:37:56 UTC (rev 197954)
</span><span class="lines">@@ -803,27 +803,6 @@
</span><span class="cx"> return null;
</span><span class="cx"> },
</span><span class="cx">
</span><del>- _nodeDescription: function(node)
- {
- var isXMLDocument = node.ownerDocument && !!node.ownerDocument.xmlVersion;
- var description = isXMLDocument ? node.nodeName : node.nodeName.toLowerCase();
-
- switch (node.nodeType) {
- case 1: // Node.ELEMENT_NODE
- if (node.id)
- description += "#" + node.id;
- if (node.hasAttribute("class")) {
- // Using .getAttribute() is a workaround for SVG*Element.className returning SVGAnimatedString,
- // which doesn't have any useful String methods. See <https://webkit.org/b/145363/>.
- description += "." + node.getAttribute("class").trim().replace(/\s+/g, ".");
- }
- return description;
-
- default:
- return description;
- }
- },
-
</del><span class="cx"> _classPreview: function(classConstructorValue)
</span><span class="cx"> {
</span><span class="cx"> return "class " + classConstructorValue.name;
</span><span class="lines">@@ -878,7 +857,7 @@
</span><span class="cx"> return toString(obj);
</span><span class="cx">
</span><span class="cx"> if (subtype === "node")
</span><del>- return this._nodeDescription(obj);
</del><ins>+ return this._nodePreview(obj);
</ins><span class="cx">
</span><span class="cx"> var className = InjectedScriptHost.internalConstructorName(obj);
</span><span class="cx"> if (subtype === "array")
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/ChangeLog (197953 => 197954)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/ChangeLog        2016-03-10 21:35:10 UTC (rev 197953)
+++ trunk/Source/WebInspectorUI/ChangeLog        2016-03-10 21:37:56 UTC (rev 197954)
</span><span class="lines">@@ -1,3 +1,245 @@
</span><ins>+2016-03-09 Joseph Pecoraro <pecoraro@apple.com>
+
+ Web Inspector: JavaScript Heap Allocations Timeline
+ https://bugs.webkit.org/show_bug.cgi?id=155287
+ <rdar://problem/25078088>
+
+ Reviewed by Timothy Hatcher.
+
+ Initial JavaScript Heap Allocations Timeline includes:
+
+ - Snapshot markers in the timeline
+ - Initial/Periodic/End snapshots during recording
+ - Ability to manually take a snapshot
+ - View of all objects in a Snapshot and Diff between snapshots
+ - Summary view - rough display of the size/count of large objects
+ - Instances view - view each of the individual objects
+
+ * UserInterface/Main.html:
+ * UserInterface/Test.html:
+ * UserInterface/Images/Compare.svg: Added.
+ * UserInterface/Images/HeapSnapshot.svg: Added.
+ * UserInterface/Images/HeapSnapshotDiff.svg: Added.
+ * UserInterface/Images/HeapSnapshotInstances.svg: Added.
+ * UserInterface/Images/HeapSnapshotSummary.svg: Added.
+ * Localizations/en.lproj/localizedStrings.js:
+ New resources and strings.
+
+ * UserInterface/Controllers/TimelineManager.js:
+ (WebInspector.TimelineManager.prototype.heapTrackingStarted):
+ (WebInspector.TimelineManager.prototype.heapTrackingCompleted):
+ (WebInspector.TimelineManager.prototype.heapSnapshotAdded):
+ * UserInterface/Protocol/HeapObserver.js:
+ (WebInspector.HeapObserver.prototype.trackingStart):
+ (WebInspector.HeapObserver.prototype.trackingComplete):
+ (WebInspector.HeapObserver):
+ Add snapshot records to the active recording's timeline.
+
+ * UserInterface/Models/HeapAllocationsInstrument.js: Added.
+ (WebInspector.HeapAllocationsInstrument):
+ (WebInspector.HeapAllocationsInstrument.supported):
+ (WebInspector.HeapAllocationsInstrument.prototype.get timelineRecordType):
+ (WebInspector.HeapAllocationsInstrument.prototype.startInstrumentation):
+ (WebInspector.HeapAllocationsInstrument.prototype.stopInstrumentation):
+ (WebInspector.HeapAllocationsInstrument.prototype._takeHeapSnapshot):
+ Start, stop, and periodic snapshots.
+
+ * UserInterface/Models/HeapAllocationsTimelineRecord.js:
+ (WebInspector.HeapAllocationsTimelineRecord):
+ (WebInspector.HeapAllocationsTimelineRecord.prototype.get timestamp):
+ (WebInspector.HeapAllocationsTimelineRecord.prototype.get heapSnapshot):
+ * UserInterface/Models/TimelineRecord.js:
+ * UserInterface/Models/TimelineRecording.js:
+ (WebInspector.TimelineRecording):
+ (WebInspector.TimelineRecording.prototype.addRecord):
+ * UserInterface/Views/TimelineOverviewGraph.js:
+ (WebInspector.TimelineOverviewGraph.createForTimeline):
+ * UserInterface/Views/TimelineTabContentView.js:
+ (WebInspector.TimelineTabContentView.displayNameForTimeline):
+ (WebInspector.TimelineTabContentView.iconClassNameForTimeline):
+ (WebInspector.TimelineTabContentView.genericClassNameForTimeline):
+ (WebInspector.TimelineTabContentView.iconClassNameForRecord):
+ (WebInspector.TimelineTabContentView.displayNameForRecord):
+ New timeline and record type.
+
+ * UserInterface/Models/HeapSnapshotDiff.js: Added.
+ (WebInspector.HeapSnapshotDiff):
+ (WebInspector.HeapSnapshotDiff.prototype.get snapshot1):
+ (WebInspector.HeapSnapshotDiff.prototype.get snapshot2):
+ (WebInspector.HeapSnapshotDiff.prototype.get addedInstances):
+ (WebInspector.HeapSnapshotDiff.prototype.get removedInstances):
+ (WebInspector.HeapSnapshotDiff.prototype.get sizeDifference):
+ (WebInspector.HeapSnapshotDiff.prototype.get growth):
+ (WebInspector.HeapSnapshotDiff.prototype.snapshotForDiff):
+ Compare two snapshots and create a "diff snapshot" which is just
+ the newly added objects.
+
+ * UserInterface/Views/ContentView.js:
+ (WebInspector.ContentView.createFromRepresentedObject):
+ (WebInspector.ContentView.isViewable):
+ A HeapSnapshot creates a HeapSnapshotClusterView.
+
+ * UserInterface/Views/HeapAllocationsTimelineDataGridNode.js: Added.
+ (WebInspector.HeapAllocationsTimelineDataGridNode):
+ (WebInspector.HeapAllocationsTimelineDataGridNode.prototype.get record):
+ (WebInspector.HeapAllocationsTimelineDataGridNode.prototype.get data):
+ (WebInspector.HeapAllocationsTimelineDataGridNode.prototype.createCellContent):
+ (WebInspector.HeapAllocationsTimelineDataGridNode.prototype.markAsBaseline):
+ (WebInspector.HeapAllocationsTimelineDataGridNode.prototype.clearBaseline):
+ * UserInterface/Views/HeapAllocationsTimelineOverviewGraph.css: Copied from Source/WebInspectorUI/UserInterface/Protocol/HeapObserver.js.
+ (.timeline-overview-graph.heap-allocations):
+ (.timeline-overview-graph.heap-allocations > img.snapshot):
+ * UserInterface/Views/HeapAllocationsTimelineOverviewGraph.js: Added.
+ (WebInspector.HeapAllocationsTimelineOverviewGraph):
+ (WebInspector.HeapAllocationsTimelineOverviewGraph.prototype.reset):
+ (WebInspector.HeapAllocationsTimelineOverviewGraph.prototype.layout.xScale):
+ (WebInspector.HeapAllocationsTimelineOverviewGraph.prototype.layout):
+ (WebInspector.HeapAllocationsTimelineOverviewGraph.prototype._visibleRecords):
+ (WebInspector.HeapAllocationsTimelineOverviewGraph.prototype._heapAllocationTimelineRecordAdded):
+ * UserInterface/Views/HeapAllocationsTimelineView.css: Copied from Source/WebInspectorUI/UserInterface/Protocol/HeapObserver.js.
+ (.timeline-view.heap-allocations > .data-grid):
+ (.timeline-view.heap-allocations > .data-grid td .icon.heap-snapshot):
+ (.timeline-view.heap-allocations > .data-grid tr.baseline):
+ (.timeline-view.heap-allocations > .content-view-container):
+ (.timeline-view.heap-allocations > .content-view-container > .content-view):
+ * UserInterface/Views/HeapAllocationsTimelineView.js: Added.
+ (WebInspector.HeapAllocationsTimelineView):
+ (WebInspector.HeapAllocationsTimelineView.prototype.showHeapSnapshotList):
+ (WebInspector.HeapAllocationsTimelineView.prototype.showHeapSnapshotTimelineRecord):
+ (WebInspector.HeapAllocationsTimelineView.prototype.showHeapSnapshotDiff):
+ (WebInspector.HeapAllocationsTimelineView.prototype.get navigationItems):
+ (WebInspector.HeapAllocationsTimelineView.prototype.get selectionPathComponents):
+ (WebInspector.HeapAllocationsTimelineView.prototype.get navigationSidebarTreeOutlineLabel):
+ (WebInspector.HeapAllocationsTimelineView.prototype.treeElementPathComponentSelected):
+ (WebInspector.HeapAllocationsTimelineView.prototype.userSelectedRecordFromOverview):
+ (WebInspector.HeapAllocationsTimelineView.prototype.closed):
+ (WebInspector.HeapAllocationsTimelineView.prototype.layout):
+ (WebInspector.HeapAllocationsTimelineView.prototype.reset):
+ (WebInspector.HeapAllocationsTimelineView.prototype._heapAllocationsTimelineRecordAdded):
+ (WebInspector.HeapAllocationsTimelineView.prototype._snapshotListPathComponentClicked):
+ (WebInspector.HeapAllocationsTimelineView.prototype._snapshotPathComponentSelected):
+ (WebInspector.HeapAllocationsTimelineView.prototype._currentContentViewDidChange):
+ (WebInspector.HeapAllocationsTimelineView.prototype._contentViewSelectionPathComponentDidChange):
+ (WebInspector.HeapAllocationsTimelineView.prototype._updateCompareHeapSnapshotButton):
+ (WebInspector.HeapAllocationsTimelineView.prototype._takeHeapSnapshotClicked):
+ (WebInspector.HeapAllocationsTimelineView.prototype._cancelSelectComparisonHeapSnapshots):
+ (WebInspector.HeapAllocationsTimelineView.prototype._compareHeapSnapshotsClicked):
+ (WebInspector.HeapAllocationsTimelineView.prototype._dataGridNodeSelected):
+ * UserInterface/Views/HeapSnapshotClassDataGridNode.js: Added.
+ (WebInspector.HeapSnapshotClassDataGridNode):
+ (WebInspector.HeapSnapshotClassDataGridNode.prototype.get data):
+ (WebInspector.HeapSnapshotClassDataGridNode.prototype.createCellContent):
+ (WebInspector.HeapSnapshotClassDataGridNode.prototype.sort):
+ (WebInspector.HeapSnapshotClassDataGridNode.prototype._populate):
+ (WebInspector.HeapSnapshotClassDataGridNode.prototype._fetchBatch):
+ (WebInspector.HeapSnapshotClassDataGridNode.prototype._updateBatchedSort):
+ (WebInspector.HeapSnapshotClassDataGridNode.prototype._updateBatchedChildren):
+ (WebInspector.HeapSnapshotClassDataGridNode.prototype._removeFetchMoreDataGridNode):
+ (WebInspector.HeapSnapshotClassDataGridNode.prototype._appendFetchMoreDataGridNode):
+ * UserInterface/Views/HeapSnapshotClusterContentView.js: Added.
+ (WebInspector.HeapSnapshotClusterContentView.createPathComponent):
+ (WebInspector.HeapSnapshotClusterContentView):
+ (WebInspector.HeapSnapshotClusterContentView.iconStyleClassNameForClassName):
+ (WebInspector.HeapSnapshotClusterContentView.prototype.get heapSnapshot):
+ (WebInspector.HeapSnapshotClusterContentView.prototype.get summaryContentView):
+ (WebInspector.HeapSnapshotClusterContentView.prototype.get instancesContentView):
+ (WebInspector.HeapSnapshotClusterContentView.prototype.get navigationItems):
+ (WebInspector.HeapSnapshotClusterContentView.prototype.get selectionPathComponents):
+ (WebInspector.HeapSnapshotClusterContentView.prototype.shown):
+ (WebInspector.HeapSnapshotClusterContentView.prototype.closed):
+ (WebInspector.HeapSnapshotClusterContentView.prototype.saveToCookie):
+ (WebInspector.HeapSnapshotClusterContentView.prototype.restoreFromCookie):
+ (WebInspector.HeapSnapshotClusterContentView.prototype.showSummary):
+ (WebInspector.HeapSnapshotClusterContentView.prototype.showInstances):
+ (WebInspector.HeapSnapshotClusterContentView.prototype._contentViewExtraArguments):
+ (WebInspector.HeapSnapshotClusterContentView.prototype._pathComponentForContentView):
+ (WebInspector.HeapSnapshotClusterContentView.prototype._identifierForContentView):
+ (WebInspector.HeapSnapshotClusterContentView.prototype._showContentViewForIdentifier):
+ (WebInspector.HeapSnapshotClusterContentView.prototype._pathComponentSelected):
+ (WebInspector.HeapSnapshotClusterContentView.prototype._toggleShowInternalObjectsSetting):
+ (WebInspector.HeapSnapshotClusterContentView.prototype._updateViewsForShowInternalObjectsSettingValue):
+ (WebInspector.HeapSnapshotClusterContentView.prototype._updateShowInternalObjectsButtonNavigationItem):
+ * UserInterface/Views/HeapSnapshotInstanceDataGridNode.js: Added.
+ (WebInspector.HeapSnapshotInstanceDataGridNode):
+ (WebInspector.HeapSnapshotInstanceDataGridNode.prototype.get data):
+ (WebInspector.HeapSnapshotInstanceDataGridNode.prototype.get selectable):
+ (WebInspector.HeapSnapshotInstanceDataGridNode.prototype.createCells):
+ (WebInspector.HeapSnapshotInstanceDataGridNode.prototype.createCellContent):
+ (WebInspector.HeapSnapshotInstanceDataGridNode.prototype.sort):
+ (WebInspector.HeapSnapshotInstanceDataGridNode.prototype._contextMenuHandler.):
+ (WebInspector.HeapSnapshotInstanceDataGridNode.prototype._contextMenuHandler):
+ * UserInterface/Views/HeapSnapshotInstanceFetchMoreDataGridNode.js: Added.
+ (WebInspector.HeapSnapshotInstanceFetchMoreDataGridNode):
+ (WebInspector.HeapSnapshotInstanceFetchMoreDataGridNode.prototype.createCellContent):
+ (WebInspector.HeapSnapshotInstanceFetchMoreDataGridNode.prototype.sort):
+ * UserInterface/Views/HeapSnapshotInstancesContentView.css: Added.
+ * UserInterface/Views/HeapSnapshotInstancesContentView.js: Added.
+ (WebInspector.HeapSnapshotInstancesContentView):
+ (WebInspector.HeapSnapshotInstancesContentView.prototype.get showInternalObjects):
+ (WebInspector.HeapSnapshotInstancesContentView.prototype.set showInternalObjects):
+ (WebInspector.HeapSnapshotInstancesContentView.prototype._sortDataGrid):
+ * UserInterface/Views/HeapSnapshotInstancesDataGridTree.js: Added.
+ (WebInspector.HeapSnapshotInstancesDataGridTree):
+ (WebInspector.HeapSnapshotInstancesDataGridTree.buildSortComparator):
+ (WebInspector.HeapSnapshotInstancesDataGridTree.prototype.get heapSnapshot):
+ (WebInspector.HeapSnapshotInstancesDataGridTree.prototype.get includeInternalObjects):
+ (WebInspector.HeapSnapshotInstancesDataGridTree.prototype.set includeInternalObjects):
+ (WebInspector.HeapSnapshotInstancesDataGridTree.prototype.get children):
+ (WebInspector.HeapSnapshotInstancesDataGridTree.prototype.appendChild):
+ (WebInspector.HeapSnapshotInstancesDataGridTree.prototype.insertChild):
+ (WebInspector.HeapSnapshotInstancesDataGridTree.prototype.removeChildren):
+ (WebInspector.HeapSnapshotInstancesDataGridTree.prototype.set sortComparator):
+ (WebInspector.HeapSnapshotInstancesDataGridTree.prototype.sort):
+ (WebInspector.HeapSnapshotInstancesDataGridTree.prototype._populateTopLevel):
+ * UserInterface/Views/HeapSnapshotSummaryContentView.css: Added.
+ * UserInterface/Views/HeapSnapshotSummaryContentView.js: Added.
+ (WebInspector.HeapSnapshotSummaryContentView.createChartContainer):
+ (WebInspector.HeapSnapshotSummaryContentView.appendLegendRow):
+ (WebInspector.HeapSnapshotSummaryContentView.appendEmptyMessage):
+ (WebInspector.HeapSnapshotSummaryContentView):
+ (WebInspector.HeapSnapshotSummaryContentView.prototype.layout):
+ * UserInterface/Views/PathComponentIcons.css:
+ (.heap-snapshot-summary-icon .icon):
+ (.heap-snapshot-instances-icon .icon):
+ (.snapshot-list-icon .icon):
+ (.snapshot-diff-icon .icon):
+ (body:not(.mac-platform, .windows-platform) .snapshot-diff-icon .icon):
+ (body:not(.mac-platform, .windows-platform) .call-trees-icon .icon): Deleted.
+ * UserInterface/Views/TextNavigationItem.css:
+ (.navigation-bar .item.text):
+ * UserInterface/Views/TextNavigationItem.js:
+ (WebInspector.TextNavigationItem):
+ (WebInspector.TextNavigationItem.prototype.get text):
+ (WebInspector.TextNavigationItem.prototype.set text):
+ * UserInterface/Views/TimelineIcons.css:
+ (.heap-snapshot-record .icon):
+ * UserInterface/Views/Variables.css:
+ (:root):
+ New views.
+
+ * UserInterface/Views/FormattedValue.js:
+ (WebInspector.FormattedValue.createElementForNodePreview):
+ (WebInspector.FormattedValue.createElementForFunctionWithName):
+ (WebInspector.FormattedValue.createObjectPreviewOrFormattedValueForObjectPreview):
+ Better display for a raw object preview.
+
+ * UserInterface/Views/TimelineOverview.js:
+ (WebInspector.TimelineOverview):
+ (WebInspector.TimelineOverview.prototype.userSelectedRecord):
+ * UserInterface/Views/TimelineRecordingContentView.js:
+ (WebInspector.TimelineRecordingContentView):
+ (WebInspector.TimelineRecordingContentView.prototype.timelineOverviewUserSelectedRecord):
+ * UserInterface/Views/TimelineRuler.js:
+ (WebInspector.TimelineRuler.prototype.set allowsTimeRangeSelection):
+ (WebInspector.TimelineRuler.prototype._handleClick):
+ (WebInspector.TimelineRuler.prototype._handleMouseDown):
+ (WebInspector.TimelineRuler.prototype._handleMouseMove):
+ * UserInterface/Views/TimelineView.js:
+ (WebInspector.TimelineView.prototype.userSelectedRecordFromOverview):
+ Hook up a way for clicking in the TimelineOverview / TimelineRuler
+ to redispatch to an OverviewGraph element, and provide a patch for
+ the Overview -> RecordingContentView -> TimelineView for records.
+
</ins><span class="cx"> 2016-03-09 Matt Baker <mattbaker@apple.com>
</span><span class="cx">
</span><span class="cx"> Web Inspector: LayoutTimelineView path components should reflect grid row nesting
</span></span></pre></div>
<a id="trunkSourceWebInspectorUILocalizationsenlprojlocalizedStringsjs"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js (197953 => 197954)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js        2016-03-10 21:35:10 UTC (rev 197953)
+++ trunk/Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js        2016-03-10 21:37:56 UTC (rev 197954)
</span><span class="lines">@@ -68,6 +68,7 @@
</span><span class="cx"> localizedStrings["All Resources"] = "All Resources";
</span><span class="cx"> localizedStrings["All Storage"] = "All Storage";
</span><span class="cx"> localizedStrings["All Uncaught Exceptions"] = "All Uncaught Exceptions";
</span><ins>+localizedStrings["Allocation Size Breakdown"] = "Allocation Size Breakdown";
</ins><span class="cx"> localizedStrings["Alternates"] = "Alternates";
</span><span class="cx"> localizedStrings["An error occurred trying to load the resource."] = "An error occurred trying to load the resource.";
</span><span class="cx"> localizedStrings["An error occurred trying to read the %s table."] = "An error occurred trying to read the %s table.";
</span><span class="lines">@@ -96,6 +97,7 @@
</span><span class="cx"> localizedStrings["Author Stylesheet"] = "Author Stylesheet";
</span><span class="cx"> localizedStrings["Automatically continue after evaluating"] = "Automatically continue after evaluating";
</span><span class="cx"> localizedStrings["Average Time"] = "Average Time";
</span><ins>+localizedStrings["Average allocation size"] = "Average allocation size";
</ins><span class="cx"> localizedStrings["Back (%s)"] = "Back (%s)";
</span><span class="cx"> localizedStrings["Background"] = "Background";
</span><span class="cx"> localizedStrings["Basis"] = "Basis";
</span><span class="lines">@@ -110,7 +112,10 @@
</span><span class="cx"> localizedStrings["Box Model"] = "Box Model";
</span><span class="cx"> localizedStrings["Box Shadow"] = "Box Shadow";
</span><span class="cx"> localizedStrings["Breakdown"] = "Breakdown";
</span><ins>+localizedStrings["Breakdown of allocations into size classes"] = "Breakdown of allocations into size classes";
</ins><span class="cx"> localizedStrings["Breakdown of each memory category at the end of the selected time range"] = "Breakdown of each memory category at the end of the selected time range";
</span><ins>+localizedStrings["Breakdown of object counts by class"] = "Breakdown of object counts by class";
+localizedStrings["Breakdown of total allocation size by class"] = "Breakdown of total allocation size by class";
</ins><span class="cx"> localizedStrings["Bubbling"] = "Bubbling";
</span><span class="cx"> localizedStrings["Busy"] = "Busy";
</span><span class="cx"> localizedStrings["Cached"] = "Cached";
</span><span class="lines">@@ -118,6 +123,7 @@
</span><span class="cx"> localizedStrings["Call Trees"] = "Call Trees";
</span><span class="cx"> localizedStrings["Calls"] = "Calls";
</span><span class="cx"> localizedStrings["Cancel Automatic Continue"] = "Cancel Automatic Continue";
</span><ins>+localizedStrings["Cancel comparison"] = "Cancel comparison";
</ins><span class="cx"> localizedStrings["Caps"] = "Caps";
</span><span class="cx"> localizedStrings["Capturing"] = "Capturing";
</span><span class="cx"> localizedStrings["Catch Variables"] = "Catch Variables";
</span><span class="lines">@@ -127,6 +133,9 @@
</span><span class="cx"> localizedStrings["Checked"] = "Checked";
</span><span class="cx"> localizedStrings["Child Layers"] = "Child Layers";
</span><span class="cx"> localizedStrings["Children"] = "Children";
</span><ins>+localizedStrings["Class Count Breakdown"] = "Class Count Breakdown";
+localizedStrings["Class Name"] = "Class Name";
+localizedStrings["Class Size Breakdown"] = "Class Size Breakdown";
</ins><span class="cx"> localizedStrings["Classes"] = "Classes";
</span><span class="cx"> localizedStrings["Clear"] = "Clear";
</span><span class="cx"> localizedStrings["Clear Log"] = "Clear Log";
</span><span class="lines">@@ -164,6 +173,7 @@
</span><span class="cx"> localizedStrings["Color"] = "Color";
</span><span class="cx"> localizedStrings["Comment"] = "Comment";
</span><span class="cx"> localizedStrings["Comment All Properties"] = "Comment All Properties";
</span><ins>+localizedStrings["Compare snapshots"] = "Compare snapshots";
</ins><span class="cx"> localizedStrings["Comparison of total memory size at the end of the selected time range to the maximum memory size in this recording"] = "Comparison of total memory size at the end of the selected time range to the maximum memory size in this recording";
</span><span class="cx"> localizedStrings["Composite"] = "Composite";
</span><span class="cx"> localizedStrings["Compressed"] = "Compressed";
</span><span class="lines">@@ -189,6 +199,7 @@
</span><span class="cx"> localizedStrings["Copy Table"] = "Copy Table";
</span><span class="cx"> localizedStrings["Copy as HTML"] = "Copy as HTML";
</span><span class="cx"> localizedStrings["Could not fetch properties. Object may no longer exist."] = "Could not fetch properties. Object may no longer exist.";
</span><ins>+localizedStrings["Count"] = "Count";
</ins><span class="cx"> localizedStrings["Create %s Rule"] = "Create %s Rule";
</span><span class="cx"> localizedStrings["Create a new tab"] = "Create a new tab";
</span><span class="cx"> localizedStrings["Current"] = "Current";
</span><span class="lines">@@ -362,9 +373,11 @@
</span><span class="cx"> localizedStrings["Grow"] = "Grow";
</span><span class="cx"> localizedStrings["HTML Attributes"] = "HTML Attributes";
</span><span class="cx"> localizedStrings["HTTP"] = "HTTP";
</span><ins>+localizedStrings["Heap Snapshot Object (@%d)"] = "Heap Snapshot Object (@%d)";
</ins><span class="cx"> localizedStrings["Height"] = "Height";
</span><span class="cx"> localizedStrings["Hide Replay Controls"] = "Hide Replay Controls";
</span><span class="cx"> localizedStrings["Hide compositing borders"] = "Hide compositing borders";
</span><ins>+localizedStrings["Hide internal objects"] = "Hide internal objects";
</ins><span class="cx"> localizedStrings["Hide shadow DOM nodes"] = "Hide shadow DOM nodes";
</span><span class="cx"> localizedStrings["Hide the details sidebar (%s)"] = "Hide the details sidebar (%s)";
</span><span class="cx"> localizedStrings["Hide the navigation sidebar (%s)"] = "Hide the navigation sidebar (%s)";
</span><span class="lines">@@ -393,15 +406,19 @@
</span><span class="cx"> localizedStrings["Initiator"] = "Initiator";
</span><span class="cx"> localizedStrings["Input: "] = "Input: ";
</span><span class="cx"> localizedStrings["Inset"] = "Inset";
</span><ins>+localizedStrings["Instances"] = "Instances";
+localizedStrings["Internal object"] = "Internal object";
</ins><span class="cx"> localizedStrings["Invalid"] = "Invalid";
</span><span class="cx"> localizedStrings["Invoke getter"] = "Invoke getter";
</span><span class="cx"> localizedStrings["Iterations"] = "Iterations";
</span><span class="cx"> localizedStrings["JavaScript"] = "JavaScript";
</span><span class="cx"> localizedStrings["JavaScript & Events"] = "JavaScript & Events";
</span><ins>+localizedStrings["JavaScript Allocations"] = "JavaScript Allocations";
</ins><span class="cx"> localizedStrings["Jump to Definition"] = "Jump to Definition";
</span><span class="cx"> localizedStrings["Keep Log on Navigation"] = "Keep Log on Navigation";
</span><span class="cx"> localizedStrings["Key"] = "Key";
</span><span class="cx"> localizedStrings["Label"] = "Label";
</span><ins>+localizedStrings["Large %s"] = "Large %s";
</ins><span class="cx"> localizedStrings["Latency"] = "Latency";
</span><span class="cx"> localizedStrings["Layer"] = "Layer";
</span><span class="cx"> localizedStrings["Layer Count: %d"] = "Layer Count: %d";
</span><span class="lines">@@ -442,6 +459,7 @@
</span><span class="cx"> localizedStrings["Maximum Size: %s"] = "Maximum Size: %s";
</span><span class="cx"> localizedStrings["Maximum maximum memory size in this recording"] = "Maximum maximum memory size in this recording";
</span><span class="cx"> localizedStrings["Media: "] = "Media: ";
</span><ins>+localizedStrings["Medium %s"] = "Medium %s";
</ins><span class="cx"> localizedStrings["Memory"] = "Memory";
</span><span class="cx"> localizedStrings["Memory: %s"] = "Memory: %s";
</span><span class="cx"> localizedStrings["Message"] = "Message";
</span><span class="lines">@@ -481,6 +499,8 @@
</span><span class="cx"> localizedStrings["No Watch Expressions"] = "No Watch Expressions";
</span><span class="cx"> localizedStrings["No exact ARIA role match."] = "No exact ARIA role match.";
</span><span class="cx"> localizedStrings["No message"] = "No message";
</span><ins>+localizedStrings["No objects"] = "No objects";
+localizedStrings["No preview available"] = "No preview available";
</ins><span class="cx"> localizedStrings["No properties."] = "No properties.";
</span><span class="cx"> localizedStrings["Node"] = "Node";
</span><span class="cx"> localizedStrings["Not found"] = "Not found";
</span><span class="lines">@@ -591,6 +611,8 @@
</span><span class="cx"> localizedStrings["Secure"] = "Secure";
</span><span class="cx"> localizedStrings["Security Issue"] = "Security Issue";
</span><span class="cx"> localizedStrings["Select %s Rule"] = "Select %s Rule";
</span><ins>+localizedStrings["Select baseline snapshot"] = "Select baseline snapshot";
+localizedStrings["Select comparison snapshot"] = "Select comparison snapshot";
</ins><span class="cx"> localizedStrings["Selected"] = "Selected";
</span><span class="cx"> localizedStrings["Selected Element"] = "Selected Element";
</span><span class="cx"> localizedStrings["Selected Frames"] = "Selected Frames";
</span><span class="lines">@@ -609,12 +631,15 @@
</span><span class="cx"> localizedStrings["Shadow"] = "Shadow";
</span><span class="cx"> localizedStrings["Shadow Content"] = "Shadow Content";
</span><span class="cx"> localizedStrings["Shared Focus"] = "Shared Focus";
</span><ins>+localizedStrings["Show %d More"] = "Show %d More";
</ins><span class="cx"> localizedStrings["Show All"] = "Show All";
</span><span class="cx"> localizedStrings["Show All Nodes (%d More)"] = "Show All Nodes (%d More)";
</span><ins>+localizedStrings["Show Remaining (%d)"] = "Show Remaining (%d)";
</ins><span class="cx"> localizedStrings["Show Replay Controls"] = "Show Replay Controls";
</span><span class="cx"> localizedStrings["Show Source"] = "Show Source";
</span><span class="cx"> localizedStrings["Show compositing borders"] = "Show compositing borders";
</span><span class="cx"> localizedStrings["Show console tab"] = "Show console tab";
</span><ins>+localizedStrings["Show internal objects"] = "Show internal objects";
</ins><span class="cx"> localizedStrings["Show only resources with issues."] = "Show only resources with issues.";
</span><span class="cx"> localizedStrings["Show resources with and without issues."] = "Show resources with and without issues.";
</span><span class="cx"> localizedStrings["Show shadow DOM nodes"] = "Show shadow DOM nodes";
</span><span class="lines">@@ -625,7 +650,12 @@
</span><span class="cx"> localizedStrings["Size"] = "Size";
</span><span class="cx"> localizedStrings["Sizing"] = "Sizing";
</span><span class="cx"> localizedStrings["Slice"] = "Slice";
</span><ins>+localizedStrings["Small %s"] = "Small %s";
</ins><span class="cx"> localizedStrings["Small Icons"] = "Small Icons";
</span><ins>+localizedStrings["Snapshot %d"] = "Snapshot %d";
+localizedStrings["Snapshot Comparison (%d and %d)"] = "Snapshot Comparison (%d and %d)";
+localizedStrings["Snapshot List"] = "Snapshot List";
+localizedStrings["Snapshots"] = "Snapshots";
</ins><span class="cx"> localizedStrings["Socket"] = "Socket";
</span><span class="cx"> localizedStrings["Sockets"] = "Sockets";
</span><span class="cx"> localizedStrings["Sort Ascending"] = "Sort Ascending";
</span><span class="lines">@@ -659,6 +689,8 @@
</span><span class="cx"> localizedStrings["Styles \u2014 Visual"] = "Styles \u2014 Visual";
</span><span class="cx"> localizedStrings["Stylesheet"] = "Stylesheet";
</span><span class="cx"> localizedStrings["Stylesheets"] = "Stylesheets";
</span><ins>+localizedStrings["Summary"] = "Summary";
+localizedStrings["Take snapshot"] = "Take snapshot";
</ins><span class="cx"> localizedStrings["Text"] = "Text";
</span><span class="cx"> localizedStrings["Text Node"] = "Text Node";
</span><span class="cx"> localizedStrings["Text Only"] = "Text Only";
</span><span class="lines">@@ -688,10 +720,13 @@
</span><span class="cx"> localizedStrings["Toggle Classes"] = "Toggle Classes";
</span><span class="cx"> localizedStrings["Top"] = "Top";
</span><span class="cx"> localizedStrings["Top Down"] = "Top Down";
</span><ins>+localizedStrings["Total Size"] = "Total Size";
</ins><span class="cx"> localizedStrings["Total Time"] = "Total Time";
</span><span class="cx"> localizedStrings["Total memory size at the end of the selected time range"] = "Total memory size at the end of the selected time range";
</span><span class="cx"> localizedStrings["Total number of resources, click to show the Resources tab"] = "Total number of resources, click to show the Resources tab";
</span><ins>+localizedStrings["Total object count"] = "Total object count";
</ins><span class="cx"> localizedStrings["Total size of all resources, click to show the Network Requests timeline"] = "Total size of all resources, click to show the Network Requests timeline";
</span><ins>+localizedStrings["Total size of heap"] = "Total size of heap";
</ins><span class="cx"> localizedStrings["Trace"] = "Trace";
</span><span class="cx"> localizedStrings["Trace: %s"] = "Trace: %s";
</span><span class="cx"> localizedStrings["Transferred"] = "Transferred";
</span><span class="lines">@@ -714,6 +749,7 @@
</span><span class="cx"> localizedStrings["Value"] = "Value";
</span><span class="cx"> localizedStrings["Variants"] = "Variants";
</span><span class="cx"> localizedStrings["Vertical"] = "Vertical";
</span><ins>+localizedStrings["Very Large"] = "Very Large";
</ins><span class="cx"> localizedStrings["Visibility"] = "Visibility";
</span><span class="cx"> localizedStrings["Warning: "] = "Warning: ";
</span><span class="cx"> localizedStrings["Warnings"] = "Warnings";
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceControllersTimelineManagerjs"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/Controllers/TimelineManager.js (197953 => 197954)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Controllers/TimelineManager.js        2016-03-10 21:35:10 UTC (rev 197953)
+++ trunk/Source/WebInspectorUI/UserInterface/Controllers/TimelineManager.js        2016-03-10 21:37:56 UTC (rev 197954)
</span><span class="lines">@@ -305,6 +305,29 @@
</span><span class="cx"> // Called from WebInspector.MemoryObserver.
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+ heapTrackingStarted(timestamp, snapshot)
+ {
+ // Called from WebInspector.HeapObserver.
+
+ this._addRecord(new WebInspector.HeapAllocationsTimelineRecord(timestamp, snapshot));
+
+ this.capturingStarted(timestamp);
+ }
+
+ heapTrackingCompleted(timestamp, snapshot)
+ {
+ // Called from WebInspector.HeapObserver.
+
+ this._addRecord(new WebInspector.HeapAllocationsTimelineRecord(timestamp, snapshot));
+ }
+
+ heapSnapshotAdded(timestamp, snapshot)
+ {
+ // Called from WebInspector.HeapAllocationsInstrument.
+
+ this._addRecord(new WebInspector.HeapAllocationsTimelineRecord(timestamp, snapshot));
+ }
+
</ins><span class="cx"> // Private
</span><span class="cx">
</span><span class="cx"> _processRecord(recordPayload, parentRecordPayload)
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceImagesComparesvg"></a>
<div class="addfile"><h4>Added: trunk/Source/WebInspectorUI/UserInterface/Images/Compare.svg (0 => 197954)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Images/Compare.svg         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Images/Compare.svg        2016-03-10 21:37:56 UTC (rev 197954)
</span><span class="lines">@@ -0,0 +1,11 @@
</span><ins>+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright © 2016 Apple Inc. All rights reserved. -->
+<svg xmlns="http://www.w3.org/2000/svg" id="root" version="1.1" viewBox="0 0 16 16">
+ <rect fill="none" stroke="currentColor" x="0.5" y="0.5" width="15" height="15" rx="2"/>
+ <path fill="none" stroke-linecap="round" stroke="currentColor" d="M 3.5 5.5 L 12.5 5.5"/>
+ <path fill="none" stroke-linecap="round" stroke="currentColor" d="M 12.5 5.5 L 9.5 2.5"/>
+ <path fill="none" stroke-linecap="round" stroke="currentColor" d="M 12.5 5.5 L 9.5 8.5"/>
+ <path fill="none" stroke-linecap="round" stroke="currentColor" d="M 3.5 10.5 L 12.5 10.5"/>
+ <path fill="none" stroke-linecap="round" stroke="currentColor" d="M 3.5 10.5 L 6.5 7.5"/>
+ <path fill="none" stroke-linecap="round" stroke="currentColor" d="M 3.5 10.5 L 6.5 13.5"/>
+</svg>
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceImagesHeapSnapshotsvg"></a>
<div class="addfile"><h4>Added: trunk/Source/WebInspectorUI/UserInterface/Images/HeapSnapshot.svg (0 => 197954)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Images/HeapSnapshot.svg         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Images/HeapSnapshot.svg        2016-03-10 21:37:56 UTC (rev 197954)
</span><span class="lines">@@ -0,0 +1,8 @@
</span><ins>+<?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(228, 198, 172)" d="M 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 L 3 1 Z M 3 1"/>
+ <path fill="rgb(186, 157, 132)" 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="rgb(186, 157, 132)" d="M 5.19849793 12.6584609 C 5.2831472 12.676395 6.98277851 12.9487305 7.62939453 12.9487305 C 8.79640591 12.9487305 9.76331344 12.6806542 10.5034462 12.1146703 C 11.3037555 11.5026691 11.7177734 10.6286312 11.7177734 9.58544922 C 11.7177734 8.84534902 11.4998181 8.18341061 11.0628295 7.63852362 C 10.6767371 7.15709971 10.0557113 6.69185669 9.18734192 6.20492057 L 8.61524891 5.88648574 C 8.27558142 5.69523066 8.15431716 5.69238281 8.23632812 5.69238281 C 8.56703836 5.69238281 9.10333246 5.81936052 9.8138795 6.08542439 L 11.1645508 6.59118236 L 11.1645508 5.14892578 L 11.1645508 3.87597656 L 11.1645508 3.07965768 L 10.3884483 2.90136387 C 9.52406853 2.70279014 8.73593121 2.60205078 8.02148438 2.60205078 C 7.01081351 2.60205078 6.14909735 2.87110984 5.47554965 3.42697448 C 4.76046595 4.01711791 4.38964844 4.82767811 4.38964844 5.77734375 C 4.38964844 6.49239045 4.61205052 7.14196725 5.04920932 7.68841575 C 5.43639142 8.1723
9338 6.03437082 8.62885808 6.84888633 9.08727887 L 7.38545082 9.38538774 C 7.71699471 9.57330366 7.92926232 9.72631865 7.99164827 9.79813503 C 7.94460492 9.81851991 7.82252674 9.85302734 7.60253906 9.85302734 C 7.14294036 9.85302734 6.53493744 9.70437137 5.79174704 9.39341305 L 4.40576172 8.81350287 L 4.40576172 10.315918 L 4.40576172 11.6801758 L 4.40576172 12.4905083 L 5.19849793 12.6584609 C 5.52713094 12.7280865 5.52713094 12.7280865 5.57407851 12.738033 L 5.19849793 12.6584609 Z M 5.19849793 12.6584609"/>
+ <path fill="white" d="M 5.40576172 11.6801758 L 5.40576172 10.315918 C 6.26156027 10.6739927 6.99381206 10.8530273 7.60253906 10.8530273 C 8.02864796 10.8530273 8.36433797 10.758139 8.60961914 10.5683594 C 8.85490031 10.3785798 8.97753906 10.1207699 8.97753906 9.79492188 C 8.97753906 9.53710809 8.90055416 9.31958096 8.74658203 9.14233398 C 8.59260991 8.965087 8.3007834 8.75472127 7.87109375 8.51123047 L 7.33935547 8.21582031 C 6.6267868 7.81477664 6.12369938 7.43074728 5.83007812 7.0637207 C 5.53645687 6.69669413 5.38964844 6.2679061 5.38964844 5.77734375 C 5.38964844 5.12206704 5.63045007 4.59570511 6.11206055 4.19824219 C 6.59367103 3.80077926 7.23013927 3.60205078 8.02148438 3.60205078 C 8.65527661 3.60205078 9.36962493 3.69335846 10.1645508 3.87597656 L 10.1645508 5.14892578 C 9.3517212 4.84456228 8.70898674 4.69238281 8.23632812 4.69238281 C 7.87109192 4.69238281 7.57837024 4.77384359 7.3581543 4.93676758 C 7.13793835 5.09969157 7.02783203 5.313638
7.02783203 5.57861328 C 7.02783203 5.79703885 7.10481694 5.98860595 7.25878906 6.15332031 C 7.41276119 6.31803468 7.70279735 6.52034385 8.12890625 6.76025391 L 8.69824219 7.07714844 C 9.46452206 7.50683809 9.99267433 7.9025047 10.2827148 8.26416016 C 10.5727554 8.62581561 10.7177734 9.06624089 10.7177734 9.58544922 C 10.7177734 10.3230831 10.4438504 10.9013651 9.89599609 11.3203125 C 9.34814179 11.7392599 8.59261549 11.9487305 7.62939453 11.9487305 C 6.99202155 11.9487305 6.25081803 11.8592131 5.40576172 11.6801758 C 5.40576172 11.6801758 6.25081803 11.8592131 5.40576172 11.6801758 L 5.40576172 11.6801758 L 5.40576172 11.6801758 Z M 5.40576172 11.6801758"/>
+</svg>
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceImagesHeapSnapshotDiffsvg"></a>
<div class="addfile"><h4>Added: trunk/Source/WebInspectorUI/UserInterface/Images/HeapSnapshotDiff.svg (0 => 197954)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Images/HeapSnapshotDiff.svg         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Images/HeapSnapshotDiff.svg        2016-03-10 21:37:56 UTC (rev 197954)
</span><span class="lines">@@ -0,0 +1,8 @@
</span><ins>+<?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(165, 202, 164)" 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(118, 153, 116)" 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="rgb(128, 166, 126)" d="M 4.445312 12.742188 C 3.890625 12.742188 3.445312 12.292969 3.445312 11.742188 L 3.445312 3.792969 C 3.445312 3.242188 3.890625 2.792969 4.445312 2.792969 L 7.867188 2.792969 C 9.367188 2.792969 10.554688 3.222656 11.402344 4.0625 C 12.25 4.910156 12.679688 6.101562 12.679688 7.601562 C 12.679688 9.171875 12.234375 10.429688 11.359375 11.347656 C 10.472656 12.273438 9.246094 12.742188 7.71875 12.742188 L 4.445312 12.742188 M 7.335938 9.613281 C 8.1875 9.613281 8.449219 9.324219 8.535156 9.226562 C 8.789062 8.941406 8.921875 8.414062 8.921875 7.699219 C 8.921875 7.140625 8.8125 6.703125 8.578125 6.363281 C 8.457031 6.183594 8.328125 6.070312 8.1875 6.011719 C 8.0625 5.964844 7.761719 5.882812 7.097656 5.882812 C 7.097656 6.960938 7.097656 8.539062 7.097656 9.613281 C 7.171875 9.613281 7.335938 9.613281 7.335938 9.613281"/>
+ <path fill="white" d="M 4.445312 11.742188 L 4.445312 3.792969 L 7.867188 3.792969 C 9.097656 3.792969 10.039062 4.121094 10.695312 4.773438 C 11.351562 5.425781 11.679688 6.371094 11.679688 7.601562 C 11.679688 8.910156 11.332031 9.929688 10.636719 10.65625 C 9.941406 11.378906 8.96875 11.742188 7.71875 11.742188 Z M 6.097656 10.613281 L 7.332031 10.613281 C 8.203125 10.613281 8.851562 10.375 9.28125 9.890625 C 9.707031 9.410156 9.921875 8.679688 9.921875 7.699219 C 9.921875 6.9375 9.75 6.308594 9.40625 5.800781 C 9.171875 5.453125 8.886719 5.214844 8.554688 5.082031 C 8.21875 4.949219 7.734375 4.882812 7.097656 4.882812 L 6.097656 4.882812 Z"/>
+</svg>
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceImagesHeapSnapshotInstancessvg"></a>
<div class="addfile"><h4>Added: trunk/Source/WebInspectorUI/UserInterface/Images/HeapSnapshotInstances.svg (0 => 197954)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Images/HeapSnapshotInstances.svg         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Images/HeapSnapshotInstances.svg        2016-03-10 21:37:56 UTC (rev 197954)
</span><span class="lines">@@ -0,0 +1,8 @@
</span><ins>+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright © 2015 Apple Inc. All rights reserved. -->
+<svg xmlns="http://www.w3.org/2000/svg" id="root" version="1.1" viewBox="0 0 16 16">
+ <path d="M 13 1 L 3 1 C 1.9 1 1 1.9 1 3 L 1 13 C 1 14.1 1.9 15 3 15 L 13 15 C 14.1 15 15 14.1 15 13 L 15 3 C 15 1.9 14.1 1 13 1 L 13 1 Z" fill="rgb(246, 222, 146)"/>
+ <path d="M 13 1 L 3 1 C 1.9 1 1 1.9 1 3 L 1 13 C 1 14.1 1.9 15 3 15 L 13 15 C 14.1 15 15 14.1 15 13 L 15 3 C 15 1.9 14.1 1 13 1 M 13 2 C 13.552 2 14 2.449 14 3 L 14 13 C 14 13.552 13.552 14 13 14 L 3 14 C 2.449 14 2 13.552 2 13 L 2 3 C 2 2.449 2.449 2 3 2 L 13 2" fill="rgb(204, 181, 108)"/>
+ <path d="M 7.9736 11.041 C 8.6766 11.041 9.2346 10.757999 9.6436 10.193 C 10.0536 9.629 10.2586 8.864 10.2586 7.898 C 10.2586 6.962 10.0526 6.210999 9.6406 5.645 C 9.2286 5.079 8.683599 4.795 8.0056 4.795 C 7.3206 4.795 6.7726 5.079 6.3626 5.645 C 5.9526 6.210999 5.7476 6.967999 5.7476 7.915 C 5.7476 8.855 5.9516 9.611 6.3596 10.183 C 6.7676 10.754999 7.3066 11.041 7.9736 11.041 M 7.9526 12.15 C 6.7556 12.15 5.7986 11.766 5.0816 10.997 C 4.3646 10.226999 4.0056 9.202 4.0056 7.92 C 4.0056 6.624 4.3666 5.596 5.0866 4.833 C 5.8076 4.071 6.7806 3.69 8.0056 3.69 C 9.223599 3.69 10.1936 4.071 10.9156 4.833 C 11.6386 5.596 11.9996 6.62 11.9996 7.903999 C 11.9996 9.217999 11.6386 10.254999 10.9156 11.013 C 10.1936 11.771 9.2056 12.15 7.9526 12.15" fill="white"/>
+ <path d="M 7.9736 10.041 C 7.6326 10.041 7.3936 9.91 7.1736 9.601999 C 6.8906 9.205999 6.7476 8.638 6.7476 7.915 C 6.7476 7.186999 6.8906 6.620999 7.1726 6.23 C 7.3936 5.926 7.6426 5.795 8.0056 5.795 C 8.3616 5.795 8.6086 5.926 8.8316 6.233 C 9.1156 6.622 9.2586 7.183 9.2586 7.898 C 9.2586 8.643999 9.1166 9.217999 8.834599 9.605 C 8.6136 9.910999 8.355599 10.041 7.9736 10.041 M 8.0056 2.69 C 6.5006 2.69 5.2736 3.18 4.3606 4.146 C 3.4616 5.097 3.0056 6.367 3.0056 7.92 C 3.0056 9.455999 3.4576 10.721 4.3496 11.679 C 5.2616 12.655 6.4736 13.15 7.9526 13.15 C 9.4846 13.15 10.7246 12.663 11.6406 11.702 C 12.5416 10.756 12.9996 9.478 12.9996 7.903999 C 12.9996 6.360999 12.5426 5.096 11.6416 4.145 C 10.7256 3.18 9.5026 2.69 8.0056 2.69 M 7.9736 11.041 C 8.6766 11.041 9.2346 10.757999 9.6436 10.193 C 10.0536 9.629 10.2586 8.864 10.2586 7.898 C 10.2586 6.962 10.0526 6.210999 9.6406 5.645 C 9.2286 5.079 8.683599 4.795 8.0056 4.795 C 7.3206 4.795 6.7726 5.079 6.3626 5.645 C
5.9526 6.210999 5.7476 6.967999 5.7476 7.915 C 5.7476 8.855 5.9516 9.611 6.3596 10.183 C 6.7676 10.754999 7.3066 11.041 7.9736 11.041 M 8.0056 3.69 C 9.223599 3.69 10.1936 4.071 10.9156 4.833 C 11.6386 5.596 11.9996 6.62 11.9996 7.903999 C 11.9996 9.217999 11.6386 10.254999 10.9156 11.013 C 10.1936 11.771 9.2056 12.15 7.9526 12.15 C 6.7556 12.15 5.7986 11.766 5.0816 10.997 C 4.3646 10.226999 4.0056 9.202 4.0056 7.92 C 4.0056 6.624 4.3666 5.596 5.0866 4.833 C 5.8076 4.071 6.7806 3.69 8.0056 3.69" fill="rgb(216, 193, 115)"/>
+</svg>
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceImagesHeapSnapshotSummarysvg"></a>
<div class="addfile"><h4>Added: trunk/Source/WebInspectorUI/UserInterface/Images/HeapSnapshotSummary.svg (0 => 197954)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Images/HeapSnapshotSummary.svg         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Images/HeapSnapshotSummary.svg        2016-03-10 21:37:56 UTC (rev 197954)
</span><span class="lines">@@ -0,0 +1,9 @@
</span><ins>+<?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(245, 245, 245)" 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, 191, 191)" 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="rgb(203, 203, 203)" d="M 12 6 L 4 6 L 4 4 L 12 4 Z"/>
+ <path fill="rgb(175, 178, 217)" d="M 12 9 L 4 9 L 4 7 L 12 7 Z"/>
+ <path fill="rgb(203, 203, 203)" d="M 12 12 L 4 12 L 4 10 L 12 10 Z"/>
+</svg>
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceMainhtml"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/Main.html (197953 => 197954)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Main.html        2016-03-10 21:35:10 UTC (rev 197953)
+++ trunk/Source/WebInspectorUI/UserInterface/Main.html        2016-03-10 21:37:56 UTC (rev 197954)
</span><span class="lines">@@ -90,6 +90,10 @@
</span><span class="cx"> <link rel="stylesheet" href="Views/GoToLineDialog.css">
</span><span class="cx"> <link rel="stylesheet" href="Views/GradientEditor.css">
</span><span class="cx"> <link rel="stylesheet" href="Views/GradientSlider.css">
</span><ins>+ <link rel="stylesheet" href="Views/HeapAllocationsTimelineOverviewGraph.css">
+ <link rel="stylesheet" href="Views/HeapAllocationsTimelineView.css">
+ <link rel="stylesheet" href="Views/HeapSnapshotInstancesContentView.css">
+ <link rel="stylesheet" href="Views/HeapSnapshotSummaryContentView.css">
</ins><span class="cx"> <link rel="stylesheet" href="Views/HierarchicalPathComponent.css">
</span><span class="cx"> <link rel="stylesheet" href="Views/HoverMenu.css">
</span><span class="cx"> <link rel="stylesheet" href="Views/ImageResourceContentView.css">
</span><span class="lines">@@ -155,6 +159,7 @@
</span><span class="cx"> <link rel="stylesheet" href="Views/TabBrowser.css">
</span><span class="cx"> <link rel="stylesheet" href="Views/TextContentView.css">
</span><span class="cx"> <link rel="stylesheet" href="Views/TextEditor.css">
</span><ins>+ <link rel="stylesheet" href="Views/TextNavigationItem.css">
</ins><span class="cx"> <link rel="stylesheet" href="Views/TextResourceContentView.css">
</span><span class="cx"> <link rel="stylesheet" href="Views/TimelineDataGrid.css">
</span><span class="cx"> <link rel="stylesheet" href="Views/TimelineIcons.css">
</span><span class="lines">@@ -308,7 +313,10 @@
</span><span class="cx"> <script src="Models/GarbageCollection.js"></script>
</span><span class="cx"> <script src="Models/Geometry.js"></script>
</span><span class="cx"> <script src="Models/Gradient.js"></script>
</span><ins>+ <script src="Models/HeapAllocationsInstrument.js"></script>
+ <script src="Models/HeapAllocationsTimelineRecord.js"></script>
</ins><span class="cx"> <script src="Models/HeapSnapshot.js"></script>
</span><ins>+ <script src="Models/HeapSnapshotDiff.js"></script>
</ins><span class="cx"> <script src="Models/HeapSnapshotEdge.js"></script>
</span><span class="cx"> <script src="Models/HeapSnapshotNode.js"></script>
</span><span class="cx"> <script src="Models/IndexedDatabase.js"></script>
</span><span class="lines">@@ -508,6 +516,16 @@
</span><span class="cx"> <script src="Views/GoToLineDialog.js"></script>
</span><span class="cx"> <script src="Views/GradientEditor.js"></script>
</span><span class="cx"> <script src="Views/GradientSlider.js"></script>
</span><ins>+ <script src="Views/HeapAllocationsTimelineOverviewGraph.js"></script>
+ <script src="Views/HeapAllocationsTimelineView.js"></script>
+ <script src="Views/HeapAllocationsTimelineDataGridNode.js"></script>
+ <script src="Views/HeapSnapshotClassDataGridNode.js"></script>
+ <script src="Views/HeapSnapshotClusterContentView.js"></script>
+ <script src="Views/HeapSnapshotInstanceDataGridNode.js"></script>
+ <script src="Views/HeapSnapshotInstanceFetchMoreDataGridNode.js"></script>
+ <script src="Views/HeapSnapshotInstancesContentView.js"></script>
+ <script src="Views/HeapSnapshotInstancesDataGridTree.js"></script>
+ <script src="Views/HeapSnapshotSummaryContentView.js"></script>
</ins><span class="cx"> <script src="Views/HierarchicalPathNavigationItem.js"></script>
</span><span class="cx"> <script src="Views/HoverMenu.js"></script>
</span><span class="cx"> <script src="Views/ImageResourceContentView.js"></script>
</span><span class="lines">@@ -594,6 +612,7 @@
</span><span class="cx"> <script src="Views/StorageSidebarPanel.js"></script>
</span><span class="cx"> <script src="Views/SyntaxHighlightingSupport.js"></script>
</span><span class="cx"> <script src="Views/TextContentView.js"></script>
</span><ins>+ <script src="Views/TextNavigationItem.js"></script>
</ins><span class="cx"> <script src="Views/TextResourceContentView.js"></script>
</span><span class="cx"> <script src="Views/TimelineDataGridNodePathComponent.js"></script>
</span><span class="cx"> <script src="Views/TimelineRecordBar.js"></script>
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceModelsHeapAllocationsInstrumentjs"></a>
<div class="addfile"><h4>Added: trunk/Source/WebInspectorUI/UserInterface/Models/HeapAllocationsInstrument.js (0 => 197954)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Models/HeapAllocationsInstrument.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Models/HeapAllocationsInstrument.js        2016-03-10 21:37:56 UTC (rev 197954)
</span><span class="lines">@@ -0,0 +1,82 @@
</span><ins>+/*
+ * 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.HeapAllocationsInstrument = class HeapAllocationsInstrument extends WebInspector.Instrument
+{
+ constructor()
+ {
+ super();
+
+ console.assert(WebInspector.HeapAllocationsInstrument.supported());
+
+ this._snapshotIntervalIdentifier = undefined;
+ }
+
+ // Static
+
+ static supported()
+ {
+ // COMPATIBILITY (iOS 9): HeapAgent did not exist.
+ return window.HeapAgent;
+ }
+
+ // Protected
+
+ get timelineRecordType()
+ {
+ return WebInspector.TimelineRecord.Type.HeapAllocations;
+ }
+
+ startInstrumentation()
+ {
+ // FIXME: Include a "track allocations" option for this instrument.
+ // FIXME: Include a periodic snapshot interval option for this instrument.
+
+ HeapAgent.startTracking();
+
+ // Periodic snapshots.
+ const snapshotInterval = 10000;
+ this._snapshotIntervalIdentifier = setInterval(this._takeHeapSnapshot.bind(this), snapshotInterval);
+ }
+
+ stopInstrumentation()
+ {
+ HeapAgent.stopTracking();
+
+ window.clearInterval(this._snapshotIntervalIdentifier);
+ this._snapshotIntervalIdentifier = undefined;
+ }
+
+ // Private
+
+ _takeHeapSnapshot()
+ {
+ HeapAgent.snapshot(function(error, timestamp, snapshotStringData) {
+ let payload = JSON.parse(snapshotStringData);
+ let snapshot = WebInspector.HeapSnapshot.fromPayload(payload);
+ WebInspector.timelineManager.heapSnapshotAdded(timestamp, snapshot);
+ });
+ }
+};
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceModelsHeapAllocationsTimelineRecordjsfromrev197953trunkSourceWebInspectorUIUserInterfaceProtocolHeapObserverjs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Models/HeapAllocationsTimelineRecord.js (from rev 197953, trunk/Source/WebInspectorUI/UserInterface/Protocol/HeapObserver.js) (0 => 197954)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Models/HeapAllocationsTimelineRecord.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Models/HeapAllocationsTimelineRecord.js        2016-03-10 21:37:56 UTC (rev 197954)
</span><span class="lines">@@ -0,0 +1,43 @@
</span><ins>+/*
+ * 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.HeapAllocationsTimelineRecord = class HeapAllocationsTimelineRecord extends WebInspector.TimelineRecord
+{
+ constructor(timestamp, heapSnapshot)
+ {
+ super(WebInspector.TimelineRecord.Type.HeapAllocations, timestamp, timestamp);
+
+ console.assert(typeof timestamp === "number");
+ console.assert(heapSnapshot instanceof WebInspector.HeapSnapshot);
+
+ this._timestamp = timestamp;
+ this._heapSnapshot = heapSnapshot;
+ }
+
+ // Public
+
+ get timestamp() { return this._timestamp; }
+ get heapSnapshot() { return this._heapSnapshot; }
+};
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceModelsHeapSnapshotDiffjs"></a>
<div class="addfile"><h4>Added: trunk/Source/WebInspectorUI/UserInterface/Models/HeapSnapshotDiff.js (0 => 197954)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Models/HeapSnapshotDiff.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Models/HeapSnapshotDiff.js        2016-03-10 21:37:56 UTC (rev 197954)
</span><span class="lines">@@ -0,0 +1,78 @@
</span><ins>+/*
+ * 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.HeapSnapshotDiff = class HeapSnapshotDiff extends WebInspector.Object
+{
+ constructor(snapshot1, snapshot2)
+ {
+ super();
+
+ console.assert(snapshot1 instanceof WebInspector.HeapSnapshot);
+ console.assert(snapshot2 instanceof WebInspector.HeapSnapshot);
+
+ this._snapshot1 = snapshot1;
+ this._snapshot2 = snapshot2;
+
+ let known = new Map;
+ for (let instance of snapshot1.instances)
+ known.set(instance.id, instance);
+
+ let added = [];
+ for (let instance of snapshot2.instances) {
+ if (known.has(instance.id))
+ known.delete(instance.id);
+ else
+ added.push(instance);
+ }
+
+ let removed = [...known.values()];
+
+ this._addedInstances = added;
+ this._removedInstances = removed;
+ }
+
+ // Public
+
+ get snapshot1() { return this._snapshot1; }
+ get snapshot2() { return this._snapshot2; }
+ get addedInstances() { return this._addedInstances; }
+ get removedInstances() { return this._removedInstances; }
+
+ get sizeDifference()
+ {
+ return this._snapshot2.totalSize - this._snapshot1.totalSize;
+ }
+
+ get growth()
+ {
+ return this._addedInstances.reduce((sum, x) => sum += x.size, 0);
+ }
+
+ snapshotForDiff()
+ {
+ // FIXME: This only includes the newly added instances. Should we do anything with the removed instances?
+ return new WebInspector.HeapSnapshot(null, this._addedInstances, this._snapshot2.nodeMap);
+ }
+};
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceModelsTimelineRecordjs"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/Models/TimelineRecord.js (197953 => 197954)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Models/TimelineRecord.js        2016-03-10 21:35:10 UTC (rev 197953)
+++ trunk/Source/WebInspectorUI/UserInterface/Models/TimelineRecord.js        2016-03-10 21:37:56 UTC (rev 197954)
</span><span class="lines">@@ -159,6 +159,7 @@
</span><span class="cx"> Script: "timeline-record-type-script",
</span><span class="cx"> RenderingFrame: "timeline-record-type-rendering-frame",
</span><span class="cx"> Memory: "timeline-record-type-memory",
</span><ins>+ HeapAllocations: "timeline-record-type-heap-allocations",
</ins><span class="cx"> };
</span><span class="cx">
</span><span class="cx"> WebInspector.TimelineRecord.TypeIdentifier = "timeline-record";
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceModelsTimelineRecordingjs"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/Models/TimelineRecording.js (197953 => 197954)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Models/TimelineRecording.js        2016-03-10 21:35:10 UTC (rev 197953)
+++ trunk/Source/WebInspectorUI/UserInterface/Models/TimelineRecording.js        2016-03-10 21:37:56 UTC (rev 197954)
</span><span class="lines">@@ -44,6 +44,7 @@
</span><span class="cx"> WebInspector.TimelineRecord.Type.Script,
</span><span class="cx"> WebInspector.TimelineRecord.Type.RenderingFrame,
</span><span class="cx"> WebInspector.TimelineRecord.Type.Memory,
</span><ins>+ WebInspector.TimelineRecord.Type.HeapAllocations,
</ins><span class="cx"> ];
</span><span class="cx">
</span><span class="cx"> for (let type of timelines) {
</span><span class="lines">@@ -243,7 +244,8 @@
</span><span class="cx"> // Some records don't have source code timelines.
</span><span class="cx"> if (record.type === WebInspector.TimelineRecord.Type.Network
</span><span class="cx"> || record.type === WebInspector.TimelineRecord.Type.RenderingFrame
</span><del>- || record.type === WebInspector.TimelineRecord.Type.Memory)
</del><ins>+ || record.type === WebInspector.TimelineRecord.Type.Memory
+ || record.type === WebInspector.TimelineRecord.Type.HeapAllocations)
</ins><span class="cx"> return;
</span><span class="cx">
</span><span class="cx"> if (!WebInspector.TimelineRecording.sourceCodeTimelinesSupported())
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceProtocolHeapObserverjs"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/Protocol/HeapObserver.js (197953 => 197954)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Protocol/HeapObserver.js        2016-03-10 21:35:10 UTC (rev 197953)
+++ trunk/Source/WebInspectorUI/UserInterface/Protocol/HeapObserver.js        2016-03-10 21:37:56 UTC (rev 197954)
</span><span class="lines">@@ -36,13 +36,13 @@
</span><span class="cx"> {
</span><span class="cx"> let payload = JSON.parse(snapshotData);
</span><span class="cx"> let snapshot = WebInspector.HeapSnapshot.fromPayload(payload);
</span><del>- // FIXME: Heap Allocations Timeline.
</del><ins>+ WebInspector.timelineManager.heapTrackingStarted(timestamp, snapshot);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> trackingComplete(timestamp, snapshotData)
</span><span class="cx"> {
</span><span class="cx"> let payload = JSON.parse(snapshotData);
</span><span class="cx"> let snapshot = WebInspector.HeapSnapshot.fromPayload(payload);
</span><del>- // FIXME: Heap Allocations Timeline.
</del><ins>+ WebInspector.timelineManager.heapTrackingCompleted(timestamp, snapshot);
</ins><span class="cx"> }
</span><span class="cx"> };
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceTesthtml"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/Test.html (197953 => 197954)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Test.html        2016-03-10 21:35:10 UTC (rev 197953)
+++ trunk/Source/WebInspectorUI/UserInterface/Test.html        2016-03-10 21:37:56 UTC (rev 197954)
</span><span class="lines">@@ -112,7 +112,10 @@
</span><span class="cx"> <script src="Models/Frame.js"></script>
</span><span class="cx"> <script src="Models/GarbageCollection.js"></script>
</span><span class="cx"> <script src="Models/Geometry.js"></script>
</span><ins>+ <script src="Models/HeapAllocationsInstrument.js"></script>
+ <script src="Models/HeapAllocationsTimelineRecord.js"></script>
</ins><span class="cx"> <script src="Models/HeapSnapshot.js"></script>
</span><ins>+ <script src="Models/HeapSnapshotDiff.js"></script>
</ins><span class="cx"> <script src="Models/HeapSnapshotEdge.js"></script>
</span><span class="cx"> <script src="Models/HeapSnapshotNode.js"></script>
</span><span class="cx"> <script src="Models/IndexedDatabase.js"></script>
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsContentViewjs"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/Views/ContentView.js (197953 => 197954)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/ContentView.js        2016-03-10 21:35:10 UTC (rev 197953)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/ContentView.js        2016-03-10 21:37:56 UTC (rev 197954)
</span><span class="lines">@@ -73,6 +73,9 @@
</span><span class="cx">
</span><span class="cx"> if (timelineType === WebInspector.TimelineRecord.Type.Memory)
</span><span class="cx"> return new WebInspector.MemoryTimelineView(representedObject, extraArguments);
</span><ins>+
+ if (timelineType === WebInspector.TimelineRecord.Type.HeapAllocations)
+ return new WebInspector.HeapAllocationsTimelineView(representedObject, extraArguments);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> if (representedObject instanceof WebInspector.Breakpoint) {
</span><span class="lines">@@ -135,6 +138,9 @@
</span><span class="cx"> if (representedObject instanceof WebInspector.CallingContextTree)
</span><span class="cx"> return new WebInspector.ProfileView(representedObject, extraArguments);
</span><span class="cx">
</span><ins>+ if (representedObject instanceof WebInspector.HeapSnapshot)
+ return new WebInspector.HeapSnapshotClusterContentView(representedObject, extraArguments);
+
</ins><span class="cx"> if (typeof representedObject === "string" || representedObject instanceof String)
</span><span class="cx"> return new WebInspector.TextContentView(representedObject, extraArguments);
</span><span class="cx">
</span><span class="lines">@@ -231,6 +237,8 @@
</span><span class="cx"> return true;
</span><span class="cx"> if (representedObject instanceof WebInspector.CallingContextTree)
</span><span class="cx"> return true;
</span><ins>+ if (representedObject instanceof WebInspector.HeapSnapshot)
+ return true;
</ins><span class="cx"> if (typeof representedObject === "string" || representedObject instanceof String)
</span><span class="cx"> return true;
</span><span class="cx"> return false;
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsFormattedValuejs"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/Views/FormattedValue.js (197953 => 197954)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/FormattedValue.js        2016-03-10 21:35:10 UTC (rev 197953)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/FormattedValue.js        2016-03-10 21:37:56 UTC (rev 197954)
</span><span class="lines">@@ -94,7 +94,7 @@
</span><span class="cx">
</span><span class="cx"> WebInspector.FormattedValue.createElementForNodePreview = function(preview)
</span><span class="cx"> {
</span><del>- var value = preview.value;
</del><ins>+ var value = preview.value || preview.description;
</ins><span class="cx"> var span = document.createElement("span");
</span><span class="cx"> span.className = "formatted-node-preview syntax-highlighted";
</span><span class="cx">
</span><span class="lines">@@ -153,6 +153,14 @@
</span><span class="cx"> return span;
</span><span class="cx"> };
</span><span class="cx">
</span><ins>+WebInspector.FormattedValue.createElementForFunctionWithName = function(description)
+{
+ var span = document.createElement("span");
+ span.classList.add("formatted-function");
+ span.textContent = description.substring(0, description.indexOf("("));
+ return span;
+}
+
</ins><span class="cx"> WebInspector.FormattedValue.createElementForTypesAndValue = function(type, subtype, displayString, size, isPreview, hadException)
</span><span class="cx"> {
</span><span class="cx"> var span = document.createElement("span");
</span><span class="lines">@@ -208,6 +216,17 @@
</span><span class="cx"> return WebInspector.FormattedValue.createElementForTypesAndValue(propertyPreview.type, propertyPreview.subtype, propertyPreview.value, undefined, true, false);
</span><span class="cx"> };
</span><span class="cx">
</span><ins>+WebInspector.FormattedValue.createObjectPreviewOrFormattedValueForObjectPreview = function(objectPreview, previewViewMode)
+{
+ if (objectPreview.subtype === "node")
+ return WebInspector.FormattedValue.createElementForNodePreview(objectPreview);
+
+ if (objectPreview.type === "function")
+ return WebInspector.FormattedValue.createElementForFunctionWithName(objectPreview.description);
+
+ return new WebInspector.ObjectPreviewView(objectPreview, previewViewMode).element;
+}
+
</ins><span class="cx"> WebInspector.FormattedValue.createObjectPreviewOrFormattedValueForRemoteObject = function(object, previewViewMode)
</span><span class="cx"> {
</span><span class="cx"> if (object.subtype === "node")
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsHeapAllocationsTimelineDataGridNodejs"></a>
<div class="addfile"><h4>Added: trunk/Source/WebInspectorUI/UserInterface/Views/HeapAllocationsTimelineDataGridNode.js (0 => 197954)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/HeapAllocationsTimelineDataGridNode.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/HeapAllocationsTimelineDataGridNode.js        2016-03-10 21:37:56 UTC (rev 197954)
</span><span class="lines">@@ -0,0 +1,81 @@
</span><ins>+/*
+ * 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.HeapAllocationsTimelineDataGridNode = class HeapAllocationsTimelineDataGridNode extends WebInspector.TimelineDataGridNode
+{
+ constructor(heapAllocationsTimelineRecord, zeroTime, heapAllocationsView)
+ {
+ super(false, null);
+
+ this._record = heapAllocationsTimelineRecord;
+ this._heapAllocationsView = heapAllocationsView;
+
+ this._data = {
+ name: WebInspector.UIString("Snapshot %d").format(this._record.heapSnapshot.identifier),
+ timestamp: this._record.timestamp - zeroTime,
+ size: this._record.heapSnapshot.totalSize,
+ };
+ }
+
+ // Public
+
+ get record() { return this._record; }
+ get data() { return this._data; }
+
+ createCellContent(columnIdentifier, cell)
+ {
+ switch (columnIdentifier) {
+ case "name":
+ let fragment = document.createDocumentFragment();
+ let iconElement = fragment.appendChild(document.createElement("img"));
+ iconElement.classList.add("icon", "heap-snapshot");
+ let titleElement = fragment.appendChild(document.createElement("span"));
+ titleElement.textContent = this._data.name;
+ let goToButton = fragment.appendChild(WebInspector.createGoToArrowButton());
+ goToButton.addEventListener("click", (event) => {
+ this._heapAllocationsView.showHeapSnapshotTimelineRecord(this._record);
+ });
+ return fragment;
+
+ case "timestamp":
+ return Number.secondsToString(this._data.timestamp, true);
+
+ case "size":
+ return Number.bytesToString(this._data.size);
+ }
+
+ return super.createCellContent(columnIdentifier, cell);
+ }
+
+ markAsBaseline()
+ {
+ this.element.classList.add("baseline");
+ }
+
+ clearBaseline()
+ {
+ this.element.classList.remove("baseline");
+ }
+};
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsHeapAllocationsTimelineOverviewGraphcssfromrev197953trunkSourceWebInspectorUIUserInterfaceProtocolHeapObserverjs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Views/HeapAllocationsTimelineOverviewGraph.css (from rev 197953, trunk/Source/WebInspectorUI/UserInterface/Protocol/HeapObserver.js) (0 => 197954)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/HeapAllocationsTimelineOverviewGraph.css         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/HeapAllocationsTimelineOverviewGraph.css        2016-03-10 21:37:56 UTC (rev 197954)
</span><span class="lines">@@ -0,0 +1,36 @@
</span><ins>+/*
+ * 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.
+ */
+
+.timeline-overview-graph.heap-allocations {
+ position: relative;
+}
+
+.timeline-overview-graph.heap-allocations > img.snapshot {
+ content: url(../Images/HeapSnapshot.svg);
+ position: absolute;
+ top: 9px;
+ width: 16px;
+ height: 16px;
+}
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsHeapAllocationsTimelineOverviewGraphjs"></a>
<div class="addfile"><h4>Added: trunk/Source/WebInspectorUI/UserInterface/Views/HeapAllocationsTimelineOverviewGraph.js (0 => 197954)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/HeapAllocationsTimelineOverviewGraph.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/HeapAllocationsTimelineOverviewGraph.js        2016-03-10 21:37:56 UTC (rev 197954)
</span><span class="lines">@@ -0,0 +1,94 @@
</span><ins>+/*
+ * 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.HeapAllocationsTimelineOverviewGraph = class HeapAllocationsTimelineOverviewGraph extends WebInspector.TimelineOverviewGraph
+{
+ constructor(timeline, timelineOverview)
+ {
+ super(timelineOverview);
+
+ this.element.classList.add("heap-allocations");
+
+ this._heapAllocationsTimeline = timeline;
+ this._heapAllocationsTimeline.addEventListener(WebInspector.Timeline.Event.RecordAdded, this._heapAllocationTimelineRecordAdded, this);
+
+ this.reset();
+ }
+
+ // Protected
+
+ reset()
+ {
+ super.reset();
+
+ this.element.removeChildren();
+ }
+
+ layout()
+ {
+ this.element.removeChildren();
+
+ // This may display records past the current time marker.
+ let visibleRecords = this._visibleRecords(this.startTime, this.endTime);
+ if (!visibleRecords.length)
+ return;
+
+ let graphStartTime = this.startTime;
+ let secondsPerPixel = this.timelineOverview.secondsPerPixel;
+
+ function xScale(time) {
+ return (time - graphStartTime) / secondsPerPixel;
+ }
+
+ for (let record of visibleRecords) {
+ const halfImageWidth = 8;
+ let x = xScale(record.timestamp) - halfImageWidth;
+ if (x <= 1)
+ x = 1;
+
+ let imageElement = this.element.appendChild(document.createElement("img"));
+ imageElement.classList.add("snapshot");
+ imageElement.style.left = x + "px";
+ imageElement.addEventListener("click", (event) => {
+ this.timelineOverview.userSelectedRecord(record);
+ });
+ }
+ }
+
+ // Private
+
+ _visibleRecords(startTime, endTime)
+ {
+ let records = this._heapAllocationsTimeline.records;
+ let lowerIndex = records.lowerBound(startTime, (time, record) => time - record.timestamp);
+ let upperIndex = records.upperBound(endTime, (time, record) => time - record.timestamp);
+ return records.slice(lowerIndex, upperIndex);
+ }
+
+ _heapAllocationTimelineRecordAdded(event)
+ {
+ this.needsLayout();
+ }
+};
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsHeapAllocationsTimelineViewcssfromrev197953trunkSourceWebInspectorUIUserInterfaceProtocolHeapObserverjs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Views/HeapAllocationsTimelineView.css (from rev 197953, trunk/Source/WebInspectorUI/UserInterface/Protocol/HeapObserver.js) (0 => 197954)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/HeapAllocationsTimelineView.css         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/HeapAllocationsTimelineView.css        2016-03-10 21:37:56 UTC (rev 197954)
</span><span class="lines">@@ -0,0 +1,52 @@
</span><ins>+/*
+ * 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.
+ */
+
+.timeline-view.heap-allocations > .data-grid {
+ position: absolute;
+ top: 0;
+ left: 0;
+ right: 0;
+ bottom: 0;
+}
+
+.timeline-view.heap-allocations > .data-grid td .icon.heap-snapshot {
+ content: url(../Images/HeapSnapshot.svg);
+}
+
+.timeline-view.heap-allocations > .data-grid tr.baseline {
+ background: hsl(129, 29%, 77%);
+}
+
+.timeline-view.heap-allocations > .content-view-container {
+ position: absolute;
+ top: 0;
+ bottom: 0;
+ left: 0;
+ right: 0;
+}
+
+.timeline-view.heap-allocations > .content-view-container > .content-view {
+ border-top: 1px solid var(--border-color);
+}
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsHeapAllocationsTimelineViewjs"></a>
<div class="addfile"><h4>Added: trunk/Source/WebInspectorUI/UserInterface/Views/HeapAllocationsTimelineView.js (0 => 197954)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/HeapAllocationsTimelineView.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/HeapAllocationsTimelineView.js        2016-03-10 21:37:56 UTC (rev 197954)
</span><span class="lines">@@ -0,0 +1,357 @@
</span><ins>+/*
+ * 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.HeapAllocationsTimelineView = class HeapAllocationsTimelineView extends WebInspector.TimelineView
+{
+ constructor(timeline, extraArguments)
+ {
+ super(timeline, extraArguments);
+
+ console.assert(timeline.type === WebInspector.TimelineRecord.Type.HeapAllocations, timeline);
+
+ this.element.classList.add("heap-allocations");
+
+ let columns = {
+ name: {
+ title: WebInspector.UIString("Name"),
+ width: "150px",
+ },
+ timestamp: {
+ title: WebInspector.UIString("Time"),
+ width: "80px",
+ sortable: true,
+ aligned: "right",
+ },
+ size: {
+ title: WebInspector.UIString("Size"),
+ width: "80px",
+ sortable: true,
+ aligned: "right",
+ },
+ };
+
+ let snapshotTooltip = WebInspector.UIString("Take snapshot");
+ this._takeHeapSnapshotButtonItem = new WebInspector.ButtonNavigationItem("take-snapshot", snapshotTooltip, "Images/HeapSnapshot.svg", 16, 16);
+ this._takeHeapSnapshotButtonItem.addEventListener(WebInspector.ButtonNavigationItem.Event.Clicked, this._takeHeapSnapshotClicked, this);
+
+ let defaultToolTip = WebInspector.UIString("Compare snapshots");
+ let activatedToolTip = WebInspector.UIString("Cancel comparison");
+ this._compareHeapSnapshotsButtonItem = new WebInspector.ActivateButtonNavigationItem("compare-heap-snapshots", defaultToolTip, activatedToolTip, "Images/Compare.svg", 16, 16);
+ this._compareHeapSnapshotsButtonItem.addEventListener(WebInspector.ButtonNavigationItem.Event.Clicked, this._compareHeapSnapshotsClicked, this);
+ this._compareHeapSnapshotsButtonItem.enabled = false;
+ this._compareHeapSnapshotsButtonItem.activated = false;
+
+ this._compareHeapSnapshotHelpTextItem = new WebInspector.TextNavigationItem("compare-heap-snapshot-help-text", "");
+
+ this._selectingComparisonHeapSnapshots = false;
+ this._baselineDataGridNode = null;
+ this._baselineHeapSnapshotTimelineRecord = null;
+ this._heapSnapshotDiff = null;
+
+ this._showingSnapshotList = true;
+
+ this._snapshotListPathComponent = new WebInspector.HierarchicalPathComponent(WebInspector.UIString("Snapshot List"), "snapshot-list-icon", "snapshot-list", false, false);
+ this._snapshotListPathComponent.addEventListener(WebInspector.HierarchicalPathComponent.Event.Clicked, this._snapshotListPathComponentClicked, this);
+
+ this._dataGrid = new WebInspector.TimelineDataGrid(this.navigationSidebarTreeOutline, columns);
+ this._dataGrid.sortColumnIdentifierSetting = new WebInspector.Setting("heap-allocations-timeline-view-sort", "timestamp");
+ this._dataGrid.sortOrderSetting = new WebInspector.Setting("heap-allocations-timeline-view-sort-order", WebInspector.DataGrid.SortOrder.Ascending);
+ this._dataGrid.addEventListener(WebInspector.DataGrid.Event.SelectedNodeChanged, this._dataGridNodeSelected, this);
+ this.addSubview(this._dataGrid);
+
+ this._contentViewContainer = new WebInspector.ContentViewContainer;
+ this._contentViewContainer.addEventListener(WebInspector.ContentViewContainer.Event.CurrentContentViewDidChange, this._currentContentViewDidChange, this);
+ WebInspector.ContentView.addEventListener(WebInspector.ContentView.Event.SelectionPathComponentsDidChange, this._contentViewSelectionPathComponentDidChange, this);
+
+ this._pendingRecords = [];
+
+ timeline.addEventListener(WebInspector.Timeline.Event.RecordAdded, this._heapAllocationsTimelineRecordAdded, this);
+ }
+
+ // Public
+
+ showHeapSnapshotList()
+ {
+ if (this._showingSnapshotList)
+ return;
+
+ this._showingSnapshotList = true;
+ this._heapSnapshotDiff = null;
+ this._cancelSelectComparisonHeapSnapshots();
+
+ this.removeSubview(this._contentViewContainer);
+ this.addSubview(this._dataGrid);
+
+ this.dispatchEventToListeners(WebInspector.ContentView.Event.SelectionPathComponentsDidChange);
+ this.dispatchEventToListeners(WebInspector.ContentView.Event.NavigationItemsDidChange);
+ }
+
+ showHeapSnapshotTimelineRecord(heapSnapshotTimelineRecord)
+ {
+ if (this._showingSnapshotList) {
+ this.removeSubview(this._dataGrid);
+ this.addSubview(this._contentViewContainer);
+ }
+
+ this._showingSnapshotList = false;
+ this._heapSnapshotDiff = null;
+ this._cancelSelectComparisonHeapSnapshots();
+
+ let treeElement = this.navigationSidebarTreeOutline.findTreeElement(heapSnapshotTimelineRecord);
+ console.assert(treeElement, "Should have a TreeElement for the HeapSnapshot");
+ if (treeElement)
+ treeElement.select();
+
+ let shouldManuallyTriggerContentViewUpdate = this._contentViewContainer.currentContentView && this._contentViewContainer.currentContentView.representedObject === heapSnapshotTimelineRecord.heapSnapshot;
+
+ this._contentViewContainer.showContentViewForRepresentedObject(heapSnapshotTimelineRecord.heapSnapshot);
+
+ if (shouldManuallyTriggerContentViewUpdate)
+ this._currentContentViewDidChange();
+ }
+
+ showHeapSnapshotDiff(heapSnapshotDiff)
+ {
+ if (this._showingSnapshotList) {
+ this.removeSubview(this._dataGrid);
+ this.addSubview(this._contentViewContainer);
+ }
+
+ this._showingSnapshotList = false;
+ this._heapSnapshotDiff = heapSnapshotDiff;
+
+ this._contentViewContainer.showContentViewForRepresentedObject(heapSnapshotDiff.snapshotForDiff());
+ }
+
+ // Protected
+
+ get navigationItems()
+ {
+ if (this._showingSnapshotList) {
+ let items = [this._takeHeapSnapshotButtonItem, this._compareHeapSnapshotsButtonItem];
+ if (this._selectingComparisonHeapSnapshots)
+ items.push(this._compareHeapSnapshotHelpTextItem);
+ return items;
+ }
+
+ return this._contentViewContainer.currentContentView.navigationItems;
+ }
+
+ get selectionPathComponents()
+ {
+ let components = [this._snapshotListPathComponent];
+
+ if (this._showingSnapshotList)
+ return components;
+
+ if (this._heapSnapshotDiff) {
+ let firstSnapshotIdentifier = this._heapSnapshotDiff.snapshot1.identifier;
+ let secondSnapshotIdentifier = this._heapSnapshotDiff.snapshot2.identifier;
+ let diffComponent = new WebInspector.HierarchicalPathComponent(WebInspector.UIString("Snapshot Comparison (%d and %d)").format(firstSnapshotIdentifier, secondSnapshotIdentifier), "snapshot-diff-icon", "snapshot-diff");
+ components.push(diffComponent);
+ } else {
+ if (this.navigationSidebarTreeOutline.selectedTreeElement) {
+ let heapSnapshotPathComponent = new WebInspector.GeneralTreeElementPathComponent(this.navigationSidebarTreeOutline.selectedTreeElement);
+ heapSnapshotPathComponent.addEventListener(WebInspector.HierarchicalPathComponent.Event.SiblingWasSelected, this._snapshotPathComponentSelected, this);
+ components.push(heapSnapshotPathComponent);
+ }
+ }
+
+ return components.concat(this._contentViewContainer.currentContentView.selectionPathComponents);
+ }
+
+ get navigationSidebarTreeOutlineLabel()
+ {
+ // FIXME: Nothing. The sidebar will soon be removed.
+ return WebInspector.UIString("Snapshots");
+ }
+
+ userSelectedRecordFromOverview(timelineRecord)
+ {
+ this.showHeapSnapshotTimelineRecord(timelineRecord);
+ }
+
+ closed()
+ {
+ console.assert(this.representedObject instanceof WebInspector.Timeline);
+ this.representedObject.removeEventListener(null, null, this);
+ }
+
+ layout()
+ {
+ // Wait to show records until our zeroTime has been set.
+ if (this._pendingRecords.length && this.zeroTime) {
+ for (let heapAllocationsTimelineRecord of this._pendingRecords) {
+ let treeElement = new WebInspector.TimelineRecordTreeElement(heapAllocationsTimelineRecord);
+ let dataGridNode = new WebInspector.HeapAllocationsTimelineDataGridNode(heapAllocationsTimelineRecord, this.zeroTime, this);
+ this._dataGrid.addRowInSortOrder(treeElement, dataGridNode);
+ }
+
+ this._pendingRecords = [];
+ this._updateCompareHeapSnapshotButton();
+ }
+ }
+
+ reset()
+ {
+ super.reset();
+
+ this.showHeapSnapshotList();
+ this._pendingRecords = [];
+ this._updateCompareHeapSnapshotButton();
+ }
+
+ // Private
+
+ _heapAllocationsTimelineRecordAdded(event)
+ {
+ this._pendingRecords.push(event.data.record);
+
+ this.needsLayout();
+ }
+
+ _snapshotListPathComponentClicked(event)
+ {
+ this.showHeapSnapshotList();
+ }
+
+ _snapshotPathComponentSelected(event)
+ {
+ console.assert(event.data.pathComponent.representedObject instanceof WebInspector.HeapAllocationsTimelineRecord);
+ this.showHeapSnapshotTimelineRecord(event.data.pathComponent.representedObject);
+ }
+
+ _currentContentViewDidChange(event)
+ {
+ this.dispatchEventToListeners(WebInspector.ContentView.Event.SelectionPathComponentsDidChange);
+ this.dispatchEventToListeners(WebInspector.ContentView.Event.NavigationItemsDidChange);
+ }
+
+ _contentViewSelectionPathComponentDidChange(event)
+ {
+ if (event.target !== this._contentViewContainer.currentContentView)
+ return;
+ this.dispatchEventToListeners(WebInspector.ContentView.Event.SelectionPathComponentsDidChange);
+ }
+
+ _updateCompareHeapSnapshotButton()
+ {
+ let hasAtLeastTwoSnapshots = false;
+
+ let count = 0;
+ for (let node of this._dataGrid.children) {
+ if (node.revealed && !node.hidden) {
+ count++;
+ if (count === 2) {
+ hasAtLeastTwoSnapshots = true;
+ break;
+ }
+ }
+ }
+
+ this._compareHeapSnapshotsButtonItem.enabled = hasAtLeastTwoSnapshots;
+ }
+
+ _takeHeapSnapshotClicked()
+ {
+ HeapAgent.snapshot(function(error, timestamp, snapshotStringData) {
+ let payload = JSON.parse(snapshotStringData);
+ let snapshot = WebInspector.HeapSnapshot.fromPayload(payload);
+ WebInspector.timelineManager.heapSnapshotAdded(timestamp, snapshot);
+ });
+ }
+
+ _cancelSelectComparisonHeapSnapshots()
+ {
+ if (!this._selectingComparisonHeapSnapshots)
+ return;
+
+ if (this._baselineDataGridNode)
+ this._baselineDataGridNode.clearBaseline();
+
+ this._selectingComparisonHeapSnapshots = false;
+ this._baselineDataGridNode = null;
+ this._baselineHeapSnapshotTimelineRecord = null;
+
+ this._compareHeapSnapshotsButtonItem.activated = false;
+
+ this.dispatchEventToListeners(WebInspector.ContentView.Event.NavigationItemsDidChange);
+ }
+
+ _compareHeapSnapshotsClicked(event)
+ {
+ let newActivated = !this._compareHeapSnapshotsButtonItem.activated;
+ this._compareHeapSnapshotsButtonItem.activated = newActivated;
+
+ if (!newActivated) {
+ this._cancelSelectComparisonHeapSnapshots();
+ return;
+ }
+
+ if (this.navigationSidebarTreeOutline.selectedTreeElement)
+ this.navigationSidebarTreeOutline.selectedTreeElement.deselect();
+
+ this._selectingComparisonHeapSnapshots = true;
+ this._baselineHeapSnapshotTimelineRecord = null;
+ this._compareHeapSnapshotHelpTextItem.text = WebInspector.UIString("Select baseline snapshot");
+
+ this.dispatchEventToListeners(WebInspector.ContentView.Event.NavigationItemsDidChange);
+ }
+
+ _dataGridNodeSelected(event)
+ {
+ if (!this._selectingComparisonHeapSnapshots)
+ return;
+
+ let dataGridNode = this._dataGrid.selectedNode;
+ if (!dataGridNode)
+ return;
+
+ let heapAllocationsTimelineRecord = dataGridNode.record;
+ if (this._baselineHeapSnapshotTimelineRecord === heapAllocationsTimelineRecord) {
+ this.navigationSidebarTreeOutline.selectedTreeElement.deselect();
+ return;
+ }
+
+ // Selected Baseline.
+ if (!this._baselineHeapSnapshotTimelineRecord) {
+ this._baselineDataGridNode = dataGridNode;
+ this._baselineDataGridNode.markAsBaseline();
+ this._baselineHeapSnapshotTimelineRecord = heapAllocationsTimelineRecord;
+ this.navigationSidebarTreeOutline.selectedTreeElement.deselect();
+ this._compareHeapSnapshotHelpTextItem.text = WebInspector.UIString("Select comparison snapshot");
+ this.dispatchEventToListeners(WebInspector.ContentView.Event.NavigationItemsDidChange);
+ return;
+ }
+
+ // Selected Comparison.
+ let diff = new WebInspector.HeapSnapshotDiff(this._baselineHeapSnapshotTimelineRecord.heapSnapshot, heapAllocationsTimelineRecord.heapSnapshot);
+ this.showHeapSnapshotDiff(diff);
+
+ this._baselineDataGridNode.clearBaseline();
+ this._selectingComparisonHeapSnapshots = false;
+ this._compareHeapSnapshotsButtonItem.activated = false;
+ }
+};
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsHeapSnapshotClassDataGridNodejs"></a>
<div class="addfile"><h4>Added: trunk/Source/WebInspectorUI/UserInterface/Views/HeapSnapshotClassDataGridNode.js (0 => 197954)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/HeapSnapshotClassDataGridNode.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/HeapSnapshotClassDataGridNode.js        2016-03-10 21:37:56 UTC (rev 197954)
</span><span class="lines">@@ -0,0 +1,181 @@
</span><ins>+/*
+* 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.HeapSnapshotClassDataGridNode = class HeapSnapshotClassDataGridNode extends WebInspector.DataGridNode
+{
+ constructor(data, tree)
+ {
+ super(data, true);
+
+ this._data = data;
+ this._tree = tree;
+
+ this._batched = false;
+ this._instances = null;
+
+ this.addEventListener("populate", this._populate, this);
+ }
+
+ // Protected
+
+ get data() { return this._data; }
+
+ createCellContent(columnIdentifier)
+ {
+ if (columnIdentifier === "size") {
+ let {size, percent} = this._data;
+ let fragment = document.createDocumentFragment();
+ let timeElement = fragment.appendChild(document.createElement("span"));
+ timeElement.classList.add("size");
+ timeElement.textContent = Number.bytesToString(size);
+ let percentElement = fragment.appendChild(document.createElement("span"));
+ percentElement.classList.add("percentage");
+ percentElement.textContent = Number.percentageString(percent);
+ return fragment;
+ }
+
+ if (columnIdentifier === "className") {
+ let {className, allInternal} = this._data;
+ let fragment = document.createDocumentFragment();
+ let iconElement = fragment.appendChild(document.createElement("img"));
+ iconElement.classList.add("icon", WebInspector.HeapSnapshotClusterContentView.iconStyleClassNameForClassName(className, allInternal));
+ let nameElement = fragment.appendChild(document.createElement("span"));
+ nameElement.classList.add("class-name");
+ nameElement.textContent = className;
+ return fragment;
+ }
+
+ return super.createCellContent(columnIdentifier);
+ }
+
+ sort()
+ {
+ if (this._batched) {
+ this._removeFetchMoreDataGridNode();
+ this._updateBatchedSort();
+ this._updateBatchedChildren();
+ this._appendFetchMoreDataGridNode();
+ return;
+ }
+
+ let children = this.children;
+ children.sort(this._tree._sortComparator);
+
+ for (let i = 0; i < children.length; ++i) {
+ children[i]._recalculateSiblings(i);
+ children[i].sort();
+ }
+ }
+
+ // Private
+
+ _populate()
+ {
+ this.removeEventListener("populate", this._populate, this);
+
+ let instances = this._tree.heapSnapshot.instancesWithClassName(this._data.className);
+
+ // Batch.
+ if (instances.length > WebInspector.HeapSnapshotClassDataGridNode.ChildrenBatchLimit) {
+ // FIXME: This should respect the this._tree.includeInternalObjects setting.
+ this._instances = instances;
+ this._batched = true;
+ this._updateBatchedSort();
+ this._fetchBatch(WebInspector.HeapSnapshotClassDataGridNode.ChildrenBatchLimit);
+ return;
+ }
+
+ for (let instance of instances) {
+ if (instance.internal && !this._tree.includeInternalObjects)
+ continue;
+ this.appendChild(new WebInspector.HeapSnapshotInstanceDataGridNode(instance, this._tree));
+ }
+
+ this.sort();
+ }
+
+ _fetchBatch(batchSize)
+ {
+ if (this._batched && this.children.length)
+ this._removeFetchMoreDataGridNode();
+
+ let oldCount = this.children.length;
+ let newCount = oldCount + batchSize;
+
+ if (newCount >= this._instances.length) {
+ newCount = this._instances.length - 1;
+ this._batched = false;
+ }
+
+ let count = newCount - oldCount;
+ for (let i = 0; i <= count; ++i) {
+ let instance = this._instances[oldCount + i];
+ this.appendChild(new WebInspector.HeapSnapshotInstanceDataGridNode(instance, this._tree));
+ }
+
+ if (this._batched)
+ this._appendFetchMoreDataGridNode();
+ }
+
+ _updateBatchedSort()
+ {
+ this._instances.sort((a, b) => {
+ let fakeDataGridNodeA = {data: a};
+ let fakeDataGridNodeB = {data: b};
+ return this._tree._sortComparator(fakeDataGridNodeA, fakeDataGridNodeB);
+ });
+ }
+
+ _updateBatchedChildren()
+ {
+ let count = this.children.length;
+
+ this.removeChildren();
+
+ for (let i = 0; i < count; ++i)
+ this.appendChild(new WebInspector.HeapSnapshotInstanceDataGridNode(this._instances[i], this._tree));
+ }
+
+ _removeFetchMoreDataGridNode()
+ {
+ console.assert(this.children[this.children.length - 1] instanceof WebInspector.HeapSnapshotInstanceFetchMoreDataGridNode);
+
+ this.removeChild(this.children[this.children.length - 1]);
+ }
+
+ _appendFetchMoreDataGridNode()
+ {
+ console.assert(!(this.children[this.children.length - 1] instanceof WebInspector.HeapSnapshotInstanceFetchMoreDataGridNode));
+
+ let count = this.children.length;
+ let totalCount = this._instances.length;
+ let remainingCount = totalCount - count;
+ let batchSize = remainingCount >= WebInspector.HeapSnapshotClassDataGridNode.ChildrenBatchLimit ? WebInspector.HeapSnapshotClassDataGridNode.ChildrenBatchLimit : 0;
+
+ this.appendChild(new WebInspector.HeapSnapshotInstanceFetchMoreDataGridNode(this._tree, batchSize, remainingCount, this._fetchBatch.bind(this)));
+ }
+};
+
+WebInspector.HeapSnapshotClassDataGridNode.ChildrenBatchLimit = 100;
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsHeapSnapshotClusterContentViewjs"></a>
<div class="addfile"><h4>Added: trunk/Source/WebInspectorUI/UserInterface/Views/HeapSnapshotClusterContentView.js (0 => 197954)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/HeapSnapshotClusterContentView.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/HeapSnapshotClusterContentView.js        2016-03-10 21:37:56 UTC (rev 197954)
</span><span class="lines">@@ -0,0 +1,276 @@
</span><ins>+/*
+ * 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.HeapSnapshotClusterContentView = class HeapSnapshotClusterContentView extends WebInspector.ClusterContentView
+{
+ constructor(heapSnapshot)
+ {
+ super(heapSnapshot);
+
+ console.assert(heapSnapshot instanceof WebInspector.HeapSnapshot);
+
+ this._heapSnapshot = heapSnapshot;
+
+ function createPathComponent(displayName, className, identifier)
+ {
+ let pathComponent = new WebInspector.HierarchicalPathComponent(displayName, className, identifier, false, true);
+ pathComponent.addEventListener(WebInspector.HierarchicalPathComponent.Event.SiblingWasSelected, this._pathComponentSelected, this);
+ return pathComponent;
+ }
+
+ this._shownInitialContent = false;
+ this._summaryContentView = null;
+ this._instancesContentView = null;
+
+ if (!WebInspector.HeapSnapshotClusterContentView.showInternalObjectsSetting)
+ WebInspector.HeapSnapshotClusterContentView.showInternalObjectsSetting = new WebInspector.Setting("heap-snapshot-cluster-content-view-show-internal-objects", false);
+
+ // FIXME: Need an image for showing / hiding internal objects.
+ this._showInternalObjectsButtonNavigationItem = new WebInspector.ActivateButtonNavigationItem("show-internal-objects", WebInspector.UIString("Show internal objects"), WebInspector.UIString("Hide internal objects"), "Images/ShadowDOM.svg", 13, 13);
+ this._showInternalObjectsButtonNavigationItem.addEventListener(WebInspector.ButtonNavigationItem.Event.Clicked, this._toggleShowInternalObjectsSetting, this);
+ this._updateShowInternalObjectsButtonNavigationItem();
+
+ 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._summaryPathComponent.nextSibling = this._instancesPathComponent;
+ this._instancesPathComponent.previousSibling = this._summaryPathComponent;
+
+ this._currentContentViewSetting = new WebInspector.Setting("heap-snapshot-cluster-current-view", WebInspector.HeapSnapshotClusterContentView.SummaryIdentifier);
+ }
+
+ // Static
+
+ static iconStyleClassNameForClassName(className, internal)
+ {
+ if (internal)
+ return "unknown";
+
+ switch (className) {
+ case "Object":
+ case "Array":
+ case "Map":
+ case "Set":
+ case "WeakMap":
+ case "WeakSet":
+ case "Promise":
+ case "Error":
+ case "Window":
+ case "Map Iterator":
+ case "Set Iterator":
+ case "Math":
+ case "JSON":
+ case "GlobalObject":
+ return "object";
+ case "Function":
+ return "function";
+ case "RegExp":
+ return "regex";
+ case "Number":
+ return "number";
+ case "Boolean":
+ return "boolean";
+ case "String":
+ case "string":
+ return "string";
+ case "Symbol":
+ case "symbol":
+ return "symbol";
+ }
+
+ if (className.endsWith("Prototype"))
+ return "object";
+ if (className.endsWith("Element") || className === "Node" || className === "Text")
+ return "node";
+
+ return "native";
+ }
+
+ // Public
+
+ get heapSnapshot() { return this._heapSnapshot; }
+
+ get summaryContentView()
+ {
+ if (!this._summaryContentView)
+ this._summaryContentView = new WebInspector.HeapSnapshotSummaryContentView(this._heapSnapshot, this._contentViewExtraArguments());
+ return this._summaryContentView;
+ }
+
+ get instancesContentView()
+ {
+ if (!this._instancesContentView)
+ this._instancesContentView = new WebInspector.HeapSnapshotInstancesContentView(this._heapSnapshot, this._contentViewExtraArguments());
+ return this._instancesContentView;
+ }
+
+ get navigationItems()
+ {
+ return [this._showInternalObjectsButtonNavigationItem];
+ }
+
+ get selectionPathComponents()
+ {
+ let currentContentView = this._contentViewContainer.currentContentView;
+ if (!currentContentView)
+ return [];
+
+ let components = [this._pathComponentForContentView(currentContentView)];
+ return components.concat(currentContentView.selectionPathComponents);
+ }
+
+ shown()
+ {
+ super.shown();
+
+ if (this._shownInitialContent) {
+ this._updateViewsForShowInternalObjectsSettingValue();
+ return;
+ }
+
+ this._showContentViewForIdentifier(this._currentContentViewSetting.value);
+ }
+
+ closed()
+ {
+ super.closed();
+
+ this._shownInitialContent = false;
+ }
+
+ saveToCookie(cookie)
+ {
+ cookie[WebInspector.HeapSnapshotClusterContentView.ContentViewIdentifierCookieKey] = this._currentContentViewSetting.value;
+ }
+
+ restoreFromCookie(cookie)
+ {
+ this._showContentViewForIdentifier(cookie[WebInspector.HeapSnapshotClusterContentView.ContentViewIdentifierCookieKey]);
+ }
+
+ showSummary()
+ {
+ this._shownInitialContent = true;
+ return this._showContentViewForIdentifier(WebInspector.HeapSnapshotClusterContentView.SummaryIdentifier);
+ }
+
+ showInstances()
+ {
+ this._shownInitialContent = true;
+ return this._showContentViewForIdentifier(WebInspector.HeapSnapshotClusterContentView.InstancesIdentifier);
+ }
+
+ // Private
+
+ _contentViewExtraArguments()
+ {
+ return {showInternalObjects: WebInspector.HeapSnapshotClusterContentView.showInternalObjectsSetting.value};
+ }
+
+ _pathComponentForContentView(contentView)
+ {
+ console.assert(contentView);
+ if (!contentView)
+ return null;
+ if (contentView === this._summaryContentView)
+ return this._summaryPathComponent;
+ if (contentView === this._instancesContentView)
+ return this._instancesPathComponent;
+ console.error("Unknown contentView.");
+ return null;
+ }
+
+ _identifierForContentView(contentView)
+ {
+ console.assert(contentView);
+ if (!contentView)
+ return null;
+ if (contentView === this._summaryContentView)
+ return WebInspector.HeapSnapshotClusterContentView.SummaryIdentifier;
+ if (contentView === this._instancesContentView)
+ return WebInspector.HeapSnapshotClusterContentView.InstancesIdentifier;
+ console.error("Unknown contentView.");
+ return null;
+ }
+
+ _showContentViewForIdentifier(identifier)
+ {
+ let contentViewToShow = null;
+
+ switch (identifier) {
+ case WebInspector.HeapSnapshotClusterContentView.SummaryIdentifier:
+ contentViewToShow = this.summaryContentView;
+ break;
+ case WebInspector.HeapSnapshotClusterContentView.InstancesIdentifier:
+ contentViewToShow = this.instancesContentView;
+ break;
+ }
+
+ if (!contentViewToShow)
+ contentViewToShow = this.instancesContentView;
+
+ console.assert(contentViewToShow);
+
+ this._shownInitialContent = true;
+
+ this._currentContentViewSetting.value = this._identifierForContentView(contentViewToShow);
+
+ return this.contentViewContainer.showContentView(contentViewToShow);
+ }
+
+ _pathComponentSelected(event)
+ {
+ this._showContentViewForIdentifier(event.data.pathComponent.representedObject);
+ }
+
+ _toggleShowInternalObjectsSetting(event)
+ {
+ WebInspector.HeapSnapshotClusterContentView.showInternalObjectsSetting.value = !WebInspector.HeapSnapshotClusterContentView.showInternalObjectsSetting.value;
+
+ this._updateViewsForShowInternalObjectsSettingValue();
+ }
+
+ _updateViewsForShowInternalObjectsSettingValue(force)
+ {
+ let value = WebInspector.HeapSnapshotClusterContentView.showInternalObjectsSetting.value;
+ if (this._showInternalObjectsButtonNavigationItem.activated === value)
+ return;
+
+ if (this._instancesContentView)
+ this._instancesContentView.showInternalObjects = value;
+
+ this._updateShowInternalObjectsButtonNavigationItem();
+ }
+
+ _updateShowInternalObjectsButtonNavigationItem()
+ {
+ this._showInternalObjectsButtonNavigationItem.activated = WebInspector.HeapSnapshotClusterContentView.showInternalObjectsSetting.value;
+ }
+};
+
+WebInspector.HeapSnapshotClusterContentView.ContentViewIdentifierCookieKey = "heap-snapshot-cluster-content-view-identifier";
+
+WebInspector.HeapSnapshotClusterContentView.SummaryIdentifier = "summary";
+WebInspector.HeapSnapshotClusterContentView.InstancesIdentifier = "instances";
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsHeapSnapshotInstanceDataGridNodejs"></a>
<div class="addfile"><h4>Added: trunk/Source/WebInspectorUI/UserInterface/Views/HeapSnapshotInstanceDataGridNode.js (0 => 197954)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/HeapSnapshotInstanceDataGridNode.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/HeapSnapshotInstanceDataGridNode.js        2016-03-10 21:37:56 UTC (rev 197954)
</span><span class="lines">@@ -0,0 +1,153 @@
</span><ins>+/*
+* 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.HeapSnapshotInstanceDataGridNode = class HeapSnapshotInstanceDataGridNode extends WebInspector.DataGridNode
+{
+ constructor(node, tree)
+ {
+ super(node, false);
+
+ console.assert(node instanceof WebInspector.HeapSnapshotNode);
+
+ this._node = node;
+ this._tree = tree;
+
+ // FIXME: Make instance grid nodes copyable.
+ this.copyable = false;
+
+ this._percent = (this._node.size / this._tree._heapSnapshot.totalSize) * 100;
+ }
+
+ // Protected
+
+ get data() { return this._node; }
+ get selectable() { return false; }
+
+ createCells()
+ {
+ super.createCells();
+
+ this.element.classList.add("instance");
+ }
+
+ createCellContent(columnIdentifier)
+ {
+ if (columnIdentifier === "size") {
+ let size = this._node.size;
+ let percent = this._percent;
+ let fragment = document.createDocumentFragment();
+ let timeElement = fragment.appendChild(document.createElement("span"));
+ timeElement.classList.add("size");
+ timeElement.textContent = Number.bytesToString(size);
+ let percentElement = fragment.appendChild(document.createElement("span"));
+ percentElement.classList.add("percentage");
+ percentElement.textContent = Number.percentageString(percent);
+ return fragment;
+ }
+
+ if (columnIdentifier === "className") {
+ let {className, id, internal} = this._node;
+ let containerElement = document.createElement("span");
+ containerElement.addEventListener("contextmenu", this._contextMenuHandler.bind(this));
+
+ let iconElement = containerElement.appendChild(document.createElement("img"));
+ iconElement.classList.add("icon", WebInspector.HeapSnapshotClusterContentView.iconStyleClassNameForClassName(className, internal));
+
+ let idElement = containerElement.appendChild(document.createElement("span"));
+ idElement.classList.add("object-id");
+ idElement.textContent = "@" + id + " ";
+
+ 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 (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;
+ }
+
+ return super.createCellContent(columnIdentifier);
+ }
+
+ sort()
+ {
+ // No children to sort.
+ }
+
+ // Private
+
+ _contextMenuHandler(event)
+ {
+ let contextMenu = WebInspector.ContextMenu.createFromEvent(event);
+
+ contextMenu.appendSeparator();
+
+ contextMenu.appendItem(WebInspector.UIString("Log Value"), () => {
+ let heapObjectIdentifier = this._node.id;
+ HeapAgent.getRemoteObject(heapObjectIdentifier, WebInspector.RuntimeManager.ConsoleObjectGroup, function(error, remoteObjectPayload) {
+ const synthetic = true;
+ let remoteObject = error ? WebInspector.RemoteObject.fromPrimitive(undefined) : WebInspector.RemoteObject.fromPayload(remoteObjectPayload);
+ let text = WebInspector.UIString("Heap Snapshot Object (@%d)").format(heapObjectIdentifier);
+ WebInspector.consoleLogViewController.appendImmediateExecutionWithResult(text, remoteObject, synthetic);
+ });
+ });
+ }
+};
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsHeapSnapshotInstanceFetchMoreDataGridNodejs"></a>
<div class="addfile"><h4>Added: trunk/Source/WebInspectorUI/UserInterface/Views/HeapSnapshotInstanceFetchMoreDataGridNode.js (0 => 197954)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/HeapSnapshotInstanceFetchMoreDataGridNode.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/HeapSnapshotInstanceFetchMoreDataGridNode.js        2016-03-10 21:37:56 UTC (rev 197954)
</span><span class="lines">@@ -0,0 +1,70 @@
</span><ins>+/*
+* 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.HeapSnapshotInstanceFetchMoreDataGridNode = class HeapSnapshotInstanceFetchMoreDataGridNode extends WebInspector.DataGridNode
+{
+ constructor(tree, batchCount, remainingCount, fetchCallback)
+ {
+ super({}, false);
+
+ console.assert(typeof batchCount === "number");
+ console.assert(typeof remainingCount === "number");
+ console.assert(typeof fetchCallback === "function");
+
+ this._tree = tree;
+ this._batchCount = batchCount;
+ this._remainingCount = remainingCount;
+ this._fetchCallback = fetchCallback;
+ }
+
+ // Protected
+
+ createCellContent(columnIdentifier)
+ {
+ if (columnIdentifier !== "className")
+ return "";
+
+ let fragment = document.createDocumentFragment();
+
+ if (this._batchCount) {
+ let buttonElement = fragment.appendChild(document.createElement("span"));
+ buttonElement.classList.add("more");
+ buttonElement.textContent = WebInspector.UIString("Show %d More").format(this._batchCount);
+ buttonElement.addEventListener("click", (event) => { this._fetchCallback(this._batchCount); });
+ }
+
+ let buttonElement = fragment.appendChild(document.createElement("span"));
+ buttonElement.classList.add("more");
+ buttonElement.textContent = WebInspector.UIString("Show Remaining (%d)").format(this._remainingCount);
+ buttonElement.addEventListener("click", (event) => { this._fetchCallback(this._remainingCount); });
+
+ return fragment;
+ }
+
+ sort()
+ {
+ // No children to sort.
+ }
+};
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsHeapSnapshotInstancesContentViewcss"></a>
<div class="addfile"><h4>Added: trunk/Source/WebInspectorUI/UserInterface/Views/HeapSnapshotInstancesContentView.css (0 => 197954)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/HeapSnapshotInstancesContentView.css         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/HeapSnapshotInstancesContentView.css        2016-03-10 21:37:56 UTC (rev 197954)
</span><span class="lines">@@ -0,0 +1,123 @@
</span><ins>+/*
+ * 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.
+ */
+
+.heap-snapshot > .data-grid {
+ position: absolute;
+ top: 0;
+ left: 0;
+ right: 0;
+ bottom: 0;
+}
+
+.heap-snapshot > .data-grid td .percentage {
+ width: 45px;
+ margin-left: 4px;
+ display: inline-block;
+}
+
+.heap-snapshot > .data-grid tr:not(.selected) td .object-id {
+ color: gray;
+}
+
+.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%);
+}
+
+.heap-snapshot > .data-grid:matches(:focus, .force-focus) tr.selected td .location {
+ color: hsl(0, 0%, 85%);
+}
+
+.heap-snapshot > .data-grid tr:matches(.selected, :hover) td .go-to-arrow {
+ float: none;
+ display: inline-block;
+ vertical-align: top;
+ position: relative;
+ width: 16px;
+ height: 16px;
+ margin-top: 1px;
+ margin-left: 2px;
+}
+
+.heap-snapshot > .data-grid td .more {
+ text-decoration: underline;
+ margin-right: 1ex;
+}
+
+.heap-snapshot .icon {
+ position: relative;
+ width: 16px;
+ height: 16px;
+ margin-top: 1px;
+ margin-right: 3px;
+ content: url(../Images/TypeUndefined.svg);
+}
+
+.heap-snapshot .icon.native {
+ content: url(../Images/Native.svg);
+}
+
+.heap-snapshot .icon.boolean {
+ content: url(../Images/TypeBoolean.svg);
+}
+
+.heap-snapshot .icon.function {
+ content: url(../Images/Function.svg);
+}
+
+.heap-snapshot .icon.number {
+ content: url(../Images/TypeNumber.svg);
+}
+
+.heap-snapshot .icon.object {
+ content: url(../Images/TypeObject.svg);
+}
+
+.heap-snapshot .icon.node {
+ content: url(../Images/DOMElement.svg);
+}
+
+.heap-snapshot .icon.regex {
+ content: url(../Images/TypeRegex.svg);
+}
+
+.heap-snapshot .icon.string {
+ content: url(../Images/TypeString.svg);
+}
+
+.heap-snapshot .icon.symbol {
+ content: url(../Images/TypeSymbol.svg);
+}
+
+.heap-snapshot > .data-grid td .formatted-node-preview,
+.heap-snapshot > .data-grid td .object-preview {
+ text-indent: 0; /* Do not inherit the DataGrid's indent. */
+ display: inline-block;
+ height: 16px;
+}
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsHeapSnapshotInstancesContentViewjs"></a>
<div class="addfile"><h4>Added: trunk/Source/WebInspectorUI/UserInterface/Views/HeapSnapshotInstancesContentView.js (0 => 197954)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/HeapSnapshotInstancesContentView.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/HeapSnapshotInstancesContentView.js        2016-03-10 21:37:56 UTC (rev 197954)
</span><span class="lines">@@ -0,0 +1,103 @@
</span><ins>+/*
+ * 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, extraArguments)
+ {
+ console.assert(representedObject instanceof WebInspector.HeapSnapshot);
+
+ super(representedObject);
+
+ this.element.classList.add("heap-snapshot");
+
+ let {showInternalObjects} = extraArguments;
+
+ let columns = {
+ size: {
+ title: WebInspector.UIString("Total Size"),
+ width: "140px",
+ aligned: "right",
+ sortable: true,
+ },
+ count: {
+ title: WebInspector.UIString("Count"),
+ width: "80px",
+ 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", "size");
+ 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, showInternalObjects);
+
+ for (let child of this._heapSnapshotDataGridTree.children)
+ this._dataGrid.appendChild(child);
+
+ this.addSubview(this._dataGrid);
+ this._dataGrid.updateLayout();
+ }
+
+ // Public
+
+ get showInternalObjects()
+ {
+ return this._heapSnapshotDataGridTree.includeInternalObjects;
+ }
+
+ set showInternalObjects(showInternalObjects)
+ {
+ if (this.showInternalObjects === showInternalObjects)
+ return;
+
+ this._heapSnapshotDataGridTree.includeInternalObjects = showInternalObjects;
+
+ this._sortDataGrid();
+ }
+
+ // 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);
+ }
+};
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsHeapSnapshotInstancesDataGridTreejs"></a>
<div class="addfile"><h4>Added: trunk/Source/WebInspectorUI/UserInterface/Views/HeapSnapshotInstancesDataGridTree.js (0 => 197954)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/HeapSnapshotInstancesDataGridTree.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/HeapSnapshotInstancesDataGridTree.js        2016-03-10 21:37:56 UTC (rev 197954)
</span><span class="lines">@@ -0,0 +1,136 @@
</span><ins>+/*
+* 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, includeInternalObjects)
+ {
+ super();
+
+ console.assert(heapSnapshot instanceof WebInspector.HeapSnapshot);
+
+ this._heapSnapshot = heapSnapshot;
+
+ this._children = [];
+ this._sortComparator = sortComparator;
+ this._includeInternalObjects = includeInternalObjects;
+
+ 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 "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 includeInternalObjects()
+ {
+ return this._includeInternalObjects;
+ }
+
+ set includeInternalObjects(includeInternal)
+ {
+ if (this._includeInternalObjects === includeInternal)
+ return;
+
+ this._includeInternalObjects = includeInternal;
+
+ this._populateTopLevel();
+ this.sort();
+ }
+
+ 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();
+ }
+ }
+
+ // Private
+
+ _populateTopLevel()
+ {
+ this.removeChildren();
+
+ // Populate the first level with the different classes.
+ let totalSize = this._heapSnapshot.totalSize;
+ for (let [className, {size, count, internalCount}] of this._heapSnapshot.categories) {
+ let allInternal = count === internalCount;
+ if (!this._includeInternalObjects && allInternal)
+ continue;
+ let percent = (size / totalSize) * 100;
+ this.appendChild(new WebInspector.HeapSnapshotClassDataGridNode({className, size, count, percent, allInternal}, this));
+ }
+ }
+};
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsHeapSnapshotSummaryContentViewcss"></a>
<div class="addfile"><h4>Added: trunk/Source/WebInspectorUI/UserInterface/Views/HeapSnapshotSummaryContentView.css (0 => 197954)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/HeapSnapshotSummaryContentView.css         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/HeapSnapshotSummaryContentView.css        2016-03-10 21:37:56 UTC (rev 197954)
</span><span class="lines">@@ -0,0 +1,174 @@
</span><ins>+/*
+ * 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.
+ */
+
+.content-view-container > .content-view.heap-snapshot-summary {
+ overflow: scroll;
+}
+
+.heap-snapshot-summary > .content {
+ width: 470px;
+ margin: 10px auto;
+}
+
+.heap-snapshot-summary > .content > .overview {
+ padding: 10px;
+ margin-bottom: 10px;
+ border-bottom: 1px solid var(--border-color);
+}
+
+.heap-snapshot-summary > .content .subtitle {
+ font-family: '-webkit-system-font';
+ font-size: 14px;
+}
+
+.heap-snapshot-summary > .content > .overview {
+ display: flex;
+ justify-content: center;
+}
+
+.heap-snapshot-summary > .content > .overview > .chart {
+ width: 420px;
+ text-align: center;
+}
+
+.heap-snapshot-summary > .content > .overview > .chart > .subtitle {
+ margin-bottom: 1em;
+}
+
+.heap-snapshot-summary > .content > .overview > .chart > .container {
+ display: flex;
+ justify-content: center;
+}
+
+.heap-snapshot-summary > .content > .overview .total-size,
+.heap-snapshot-summary > .content > .overview .total-count,
+.heap-snapshot-summary > .content > .overview .average-allocation-size {
+ margin: auto;
+ color: hsl(0, 0%, 70%);
+}
+
+.heap-snapshot-summary .legend {
+ width: 120px;
+ padding-left: 20px;
+ text-align: left;
+}
+
+.heap-snapshot-summary .legend > .row {
+ position: relative;
+ height: 27px;
+}
+
+.heap-snapshot-summary .legend > .row > .swatch {
+ position: absolute;
+ top: 1px;
+ left: 0;
+ width: 1em;
+ height: 1em;
+}
+
+.heap-snapshot-summary .legend > .row > p {
+ margin: 0;
+}
+
+.heap-snapshot-summary .legend > .row > .label {
+ position: absolute;
+ top: 0;
+ left: 20px;
+}
+
+.heap-snapshot-summary .legend > .row > .size {
+ position: absolute;
+ top: 12px;
+ left: 20px;
+ color: hsl(0, 0%, 70%);
+}
+
+.heap-snapshot-summary .legend > .row > .swatch.top-class-1,
+.heap-snapshot-summary .legend > .row > .swatch.small {
+ border: 1px solid var(--memory-javascript-stroke-color);
+ background: var(--memory-javascript-fill-color);
+}
+
+.heap-snapshot-summary .legend > .row > .swatch.top-class-2,
+.heap-snapshot-summary .legend > .row > .swatch.medium {
+ border: 1px solid var(--memory-images-stroke-color);
+ background: var(--memory-images-fill-color);
+}
+
+.heap-snapshot-summary .legend > .row > .swatch.top-class-3,
+.heap-snapshot-summary .legend > .row > .swatch.large {
+ border: 1px solid var(--memory-layers-stroke-color);
+ background: var(--memory-layers-fill-color);
+}
+
+.heap-snapshot-summary .legend > .row > .swatch.top-class-4,
+.heap-snapshot-summary .legend > .row > .swatch.very-large {
+ border: 1px solid var(--memory-page-stroke-color);
+ background: var(--memory-page-fill-color);
+}
+
+.heap-snapshot-summary .legend > .row > .swatch.top-class-5 {
+ border: 1px solid var(--memory-extra-stroke-color);
+ background: var(--memory-extra-fill-color);
+}
+
+.heap-snapshot-summary .legend > .row > .swatch.other {
+ border: 1px solid var(--memory-max-comparison-stroke-color);
+ background: var(--memory-max-comparison-fill-color);
+}
+
+.heap-snapshot-summary .circle-chart > svg > path.top-class-1,
+.heap-snapshot-summary .circle-chart > svg > path.small {
+ stroke: var(--memory-javascript-stroke-color);
+ fill: var(--memory-javascript-fill-color);
+}
+
+.heap-snapshot-summary .circle-chart > svg > path.top-class-2,
+.heap-snapshot-summary .circle-chart > svg > path.medium {
+ stroke: var(--memory-images-stroke-color);
+ fill: var(--memory-images-fill-color);
+}
+
+.heap-snapshot-summary .circle-chart > svg > path.top-class-3,
+.heap-snapshot-summary .circle-chart > svg > path.large {
+ stroke: var(--memory-layers-stroke-color);
+ fill: var(--memory-layers-fill-color);
+}
+
+.heap-snapshot-summary .circle-chart > svg > path.top-class-4,
+.heap-snapshot-summary .circle-chart > svg > path.very-large {
+ stroke: var(--memory-page-stroke-color);
+ fill: var(--memory-page-fill-color);
+}
+
+.heap-snapshot-summary .circle-chart > svg > path.top-class-5 {
+ stroke: var(--memory-extra-stroke-color);
+ fill: var(--memory-extra-fill-color);
+}
+
+.heap-snapshot-summary .circle-chart > svg > path.other {
+ stroke: var(--memory-max-comparison-stroke-color);
+ fill: var(--memory-max-comparison-fill-color);
+}
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsHeapSnapshotSummaryContentViewjs"></a>
<div class="addfile"><h4>Added: trunk/Source/WebInspectorUI/UserInterface/Views/HeapSnapshotSummaryContentView.js (0 => 197954)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/HeapSnapshotSummaryContentView.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/HeapSnapshotSummaryContentView.js        2016-03-10 21:37:56 UTC (rev 197954)
</span><span class="lines">@@ -0,0 +1,234 @@
</span><ins>+/*
+ * 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.HeapSnapshotSummaryContentView = class HeapSnapshotSummaryContentView extends WebInspector.ContentView
+{
+ constructor(heapSnapshot, extraArguments)
+ {
+ console.assert(heapSnapshot instanceof WebInspector.HeapSnapshot);
+
+ super(heapSnapshot);
+
+ this._heapSnapshot = heapSnapshot;
+
+ // FIXME: Show/hide internal objects.
+ let {showInternalObjects} = extraArguments;
+
+ this.element.classList.add("heap-snapshot-summary");
+
+ let contentElement = this.element.appendChild(document.createElement("div"));
+ contentElement.classList.add("content");
+
+ let overviewElement = contentElement.appendChild(document.createElement("div"));
+ overviewElement.classList.add("overview");
+
+ function createChartContainer(parentElement, subtitle, tooltip)
+ {
+ let chartElement = parentElement.appendChild(document.createElement("div"));
+ chartElement.classList.add("chart");
+
+ let chartSubtitleElement = chartElement.appendChild(document.createElement("div"));
+ chartSubtitleElement.classList.add("subtitle");
+ chartSubtitleElement.textContent = subtitle;
+ chartSubtitleElement.title = tooltip;
+
+ let chartFlexContainerElement = chartElement.appendChild(document.createElement("div"));
+ chartFlexContainerElement.classList.add("container");
+ return chartFlexContainerElement;
+ }
+
+ const circleChartConfig = {size: 120, innerRadiusRatio: 0.5};
+
+ let classSizeBreakdownTooltip = WebInspector.UIString("Breakdown of total allocation size by class");
+ let classSizeBreakdownChartContainerElement = createChartContainer(overviewElement, WebInspector.UIString("Class Size Breakdown"), classSizeBreakdownTooltip);
+ this._classSizeBreakdownCircleChart = new WebInspector.CircleChart(circleChartConfig);
+ classSizeBreakdownChartContainerElement.appendChild(this._classSizeBreakdownCircleChart.element);
+ this._classSizeBreakdownLegendElement = classSizeBreakdownChartContainerElement.appendChild(document.createElement("div"));
+ this._classSizeBreakdownLegendElement.classList.add("legend", "class-breakdown");
+
+ let secondOverviewElement = contentElement.appendChild(document.createElement("div"));
+ secondOverviewElement.classList.add("overview");
+
+ let classCountBreakdownTooltip = WebInspector.UIString("Breakdown of object counts by class");
+ let classCountBreakdownChartContainerElement = createChartContainer(secondOverviewElement, WebInspector.UIString("Class Count Breakdown"), classCountBreakdownTooltip);
+ this._classCountBreakdownCircleChart = new WebInspector.CircleChart(circleChartConfig);
+ classCountBreakdownChartContainerElement.appendChild(this._classCountBreakdownCircleChart.element);
+ this._classCountBreakdownLegendElement = classCountBreakdownChartContainerElement.appendChild(document.createElement("div"));
+ this._classCountBreakdownLegendElement.classList.add("legend", "count-breakdown");
+
+ let thirdOverviewElement = contentElement.appendChild(document.createElement("div"));
+ thirdOverviewElement.classList.add("overview");
+
+ let allocationSizeBreakdownTooltip = WebInspector.UIString("Breakdown of allocations into size classes");
+ let allocationSizeBreakdownChartContainerElement = createChartContainer(thirdOverviewElement, WebInspector.UIString("Allocation Size Breakdown"), allocationSizeBreakdownTooltip);
+ this._allocationSizeBreakdownCircleChart = new WebInspector.CircleChart(circleChartConfig);
+ allocationSizeBreakdownChartContainerElement.appendChild(this._allocationSizeBreakdownCircleChart.element);
+ this._allocationSizeBreakdownLegendElement = allocationSizeBreakdownChartContainerElement.appendChild(document.createElement("div"));
+ this._allocationSizeBreakdownLegendElement.classList.add("legend", "allocation-size-breakdown");
+
+ function appendLegendRow(legendElement, swatchClass, label, subtitle, tooltip) {
+ let rowElement = legendElement.appendChild(document.createElement("div"));
+ rowElement.classList.add("row");
+ let swatchElement = rowElement.appendChild(document.createElement("div"));
+ swatchElement.classList.add("swatch", swatchClass);
+ let labelElement = rowElement.appendChild(document.createElement("p"));
+ labelElement.classList.add("label");
+ labelElement.textContent = label;
+ let sizeElement = rowElement.appendChild(document.createElement("p"));
+ sizeElement.classList.add("size");
+ sizeElement.textContent = subtitle;
+ if (tooltip)
+ rowElement.title = tooltip;
+ }
+
+ function appendEmptyMessage(legendElement, text) {
+ let emptyElement = legendElement.appendChild(document.createElement("div"));
+ emptyElement.classList.add("empty");
+ emptyElement.textContent = text;
+ }
+
+ // Largest classes by size.
+ let categoriesBySize = [...this._heapSnapshot.categories.values()].sort((a, b) => b.size - a.size);
+ let categoriesBySizeLimit = Math.min(categoriesBySize.length, 5);
+ if (categoriesBySizeLimit) {
+ let topClassSizes = categoriesBySize.splice(0, categoriesBySizeLimit);
+ let otherClassSize = categoriesBySize.reduce((sum, category) => sum += category.size, 0);
+
+ let segments = [];
+ let values = [];
+
+ for (let i = 0; i < categoriesBySizeLimit; ++i) {
+ let topClassSize = topClassSizes[i];
+ let segmentName = "top-class-" + (i + 1);
+ segments.push(segmentName);
+ values.push(topClassSize.size);
+ appendLegendRow.call(this, this._classSizeBreakdownLegendElement, segmentName, topClassSize.className, Number.bytesToString(topClassSize.size));
+ }
+
+ if (otherClassSize) {
+ let otherSegmentName = "other";
+ segments.push(otherSegmentName);
+ values.push(otherClassSize);
+ appendLegendRow.call(this, this._classSizeBreakdownLegendElement, otherSegmentName, WebInspector.UIString("Other"), Number.bytesToString(otherClassSize));
+ }
+
+ this._classSizeBreakdownCircleChart.segments = segments;
+ this._classSizeBreakdownCircleChart.values = values;
+ this._classSizeBreakdownCircleChart.updateLayout();
+
+ let totalSizeElement = this._classSizeBreakdownCircleChart.centerElement.appendChild(document.createElement("div"));
+ totalSizeElement.classList.add("total-size");
+ totalSizeElement.appendChild(document.createElement("span")); // firstChild
+ totalSizeElement.appendChild(document.createElement("br"));
+ totalSizeElement.appendChild(document.createElement("span")); // lastChild
+ let totalSize = Number.bytesToString(this._heapSnapshot.totalSize).split(/\s+/);
+ totalSizeElement.firstChild.textContent = totalSize[0];
+ totalSizeElement.lastChild.textContent = totalSize[1];
+ totalSizeElement.title = WebInspector.UIString("Total size of heap");
+ } else
+ appendEmptyMessage.call(this, this._classSizeBreakdownLegendElement, WebInspector.UIString("No objects"));
+
+ // Largest classes by count.
+ let categoriesByCount = [...this._heapSnapshot.categories.values()].sort((a, b) => b.count - a.count);
+ let categoriesByCountLimit = Math.min(categoriesByCount.length, 5);
+ if (categoriesByCountLimit) {
+ let topClassCounts = categoriesByCount.splice(0, categoriesByCountLimit);
+ let otherClassCount = categoriesByCount.reduce((sum, category) => sum += category.count, 0);
+
+ let segments = [];
+ let values = [];
+
+ for (let i = 0; i < categoriesByCountLimit; ++i) {
+ let topClassCount = topClassCounts[i];
+ let segmentName = "top-class-" + (i + 1);
+ segments.push(segmentName);
+ values.push(topClassCount.count);
+ appendLegendRow.call(this, this._classCountBreakdownLegendElement, segmentName, topClassCount.className, topClassCount.count);
+ }
+
+ if (otherClassCount) {
+ let otherSegmentName = "other";
+ segments.push(otherSegmentName);
+ values.push(otherClassCount);
+ appendLegendRow.call(this, this._classCountBreakdownLegendElement, otherSegmentName, WebInspector.UIString("Other"), otherClassCount);
+ }
+
+ this._classCountBreakdownCircleChart.segments = segments;
+ this._classCountBreakdownCircleChart.values = values;
+ this._classCountBreakdownCircleChart.updateLayout();
+
+ let totalCountElement = this._classCountBreakdownCircleChart.centerElement.appendChild(document.createElement("div"));
+ totalCountElement.classList.add("total-count");
+ totalCountElement.textContent = this._heapSnapshot.totalObjectCount;
+ totalCountElement.title = WebInspector.UIString("Total object count");
+ } else
+ appendEmptyMessage.call(this, this._classCountBreakdownLegendElement, WebInspector.UIString("No objects"));
+
+ // Allocation size groups.
+ let small = 0;
+ let medium = 0;
+ let large = 0;
+ let veryLarge = 0;
+
+ const smallAllocationSize = 48;
+ const mediumAllocationSize = 128;
+ const largeAllocationSize = 512;
+
+ this._heapSnapshot.instances.forEach(({size}) => {
+ if (size < smallAllocationSize)
+ small++;
+ else if (size < mediumAllocationSize)
+ medium++;
+ else if (size < largeAllocationSize)
+ large++;
+ else
+ veryLarge++;
+ });
+
+ if (small + medium + large + veryLarge) {
+ appendLegendRow.call(this, this._allocationSizeBreakdownLegendElement, "small", WebInspector.UIString("Small %s").format(Number.bytesToString(smallAllocationSize)), small);
+ appendLegendRow.call(this, this._allocationSizeBreakdownLegendElement, "medium", WebInspector.UIString("Medium %s").format(Number.bytesToString(mediumAllocationSize)), medium);
+ appendLegendRow.call(this, this._allocationSizeBreakdownLegendElement, "large", WebInspector.UIString("Large %s").format(Number.bytesToString(largeAllocationSize)), large);
+ appendLegendRow.call(this, this._allocationSizeBreakdownLegendElement, "very-large", WebInspector.UIString("Very Large"), veryLarge);
+
+ this._allocationSizeBreakdownCircleChart.segments = ["small", "medium", "large", "very-large"];
+ this._allocationSizeBreakdownCircleChart.values = [small, medium, large, veryLarge];
+ this._allocationSizeBreakdownCircleChart.updateLayout();
+
+ let averageAllocationSizeElement = this._allocationSizeBreakdownCircleChart.centerElement.appendChild(document.createElement("div"));
+ averageAllocationSizeElement.classList.add("average-allocation-size");
+ averageAllocationSizeElement.textContent = Number.bytesToString(this._heapSnapshot.totalSize / this._heapSnapshot.totalObjectCount);
+ averageAllocationSizeElement.title = WebInspector.UIString("Average allocation size");
+ } else
+ appendEmptyMessage.call(this, this._allocationSizeBreakdownLegendElement, WebInspector.UIString("No objects"));
+ }
+
+ // Protected
+
+ layout()
+ {
+ // Nothing to change.
+ }
+};
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsPathComponentIconscss"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/Views/PathComponentIcons.css (197953 => 197954)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/PathComponentIcons.css        2016-03-10 21:35:10 UTC (rev 197953)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/PathComponentIcons.css        2016-03-10 21:37:56 UTC (rev 197954)
</span><span class="lines">@@ -31,6 +31,14 @@
</span><span class="cx"> content: url(../Images/Response.svg);
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+.heap-snapshot-summary-icon .icon {
+ content: url(../Images/HeapSnapshotSummary.svg);
+}
+
+.heap-snapshot-instances-icon .icon {
+ content: url(../Images/HeapSnapshotInstances.svg);
+}
+
</ins><span class="cx"> .dom-element-icon .icon {
</span><span class="cx"> content: url(../Images/DOMElement.svg);
</span><span class="cx"> }
</span><span class="lines">@@ -83,8 +91,22 @@
</span><span class="cx"> content: url(../Images/CallTrees.svg);
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+.snapshot-list-icon .icon {
+ content: url(../Images/Events.svg);
+}
+
+.snapshot-diff-icon .icon {
+ content: url(../Images/HeapSnapshotDiff.svg);
+}
+
</ins><span class="cx"> /* FIXME: <https://webkit.org/b/155077> [GTK] Web Inspector: Add new GTK+ icons for different Script Timeline Views */
</span><ins>+/* FIXME: <https://webkit.org/b/155282> [GTK] Web Inspector: Add new GTK+ icons for different Heap Allocations Timeline Views (Heap Snapshots) */
</ins><span class="cx"> body:not(.mac-platform, .windows-platform) .events-icon .icon,
</span><del>-body:not(.mac-platform, .windows-platform) .call-trees-icon .icon {
</del><ins>+body:not(.mac-platform, .windows-platform) .call-trees-icon .icon,
+body:not(.mac-platform, .windows-platform) .heap-snapshot-record .icon,
+body:not(.mac-platform, .windows-platform) .heap-snapshot-summary-icon .icon,
+body:not(.mac-platform, .windows-platform) .heap-snapshot-instances-icon .icon,
+body:not(.mac-platform, .windows-platform) .snapshot-list-icon .icon,
+body:not(.mac-platform, .windows-platform) .snapshot-diff-icon .icon {
</ins><span class="cx"> content: url(../Images/ResultLine.svg);
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsTextNavigationItemcssfromrev197953trunkSourceWebInspectorUIUserInterfaceProtocolHeapObserverjs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Views/TextNavigationItem.css (from rev 197953, trunk/Source/WebInspectorUI/UserInterface/Protocol/HeapObserver.js) (0 => 197954)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/TextNavigationItem.css         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/TextNavigationItem.css        2016-03-10 21:37:56 UTC (rev 197954)
</span><span class="lines">@@ -0,0 +1,35 @@
</span><ins>+/*
+ * 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.
+ */
+
+.navigation-bar .item.text {
+ width: auto;
+ padding: 1px 8px 3px;
+ margin: 0 2px;
+
+ line-height: 11px;
+ color: hsl(0, 0%, 18%);
+ text-align: center;
+ height: auto;
+}
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsTextNavigationItemjsfromrev197953trunkSourceWebInspectorUIUserInterfaceProtocolHeapObserverjs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Views/TextNavigationItem.js (from rev 197953, trunk/Source/WebInspectorUI/UserInterface/Protocol/HeapObserver.js) (0 => 197954)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/TextNavigationItem.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/TextNavigationItem.js        2016-03-10 21:37:56 UTC (rev 197954)
</span><span class="lines">@@ -0,0 +1,49 @@
</span><ins>+/*
+ * 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.TextNavigationItem = class TextNavigationItem extends WebInspector.NavigationItem
+{
+ constructor(identifier, label)
+ {
+ super(identifier);
+
+ console.assert(identifier);
+
+ this._element.classList.add("text");
+ this._element.textContent = label || "";
+ }
+
+ // Public
+
+ get text()
+ {
+ return this._element.textContent;
+ }
+
+ set text(x)
+ {
+ this._element.textContent = x || "";
+ }
+};
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsTimelineIconscss"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/Views/TimelineIcons.css (197953 => 197954)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/TimelineIcons.css        2016-03-10 21:35:10 UTC (rev 197953)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/TimelineIcons.css        2016-03-10 21:37:56 UTC (rev 197954)
</span><span class="lines">@@ -142,3 +142,7 @@
</span><span class="cx"> .animation-record .icon {
</span><span class="cx"> content: url(../Images/TimelineRecordAnimation.svg);
</span><span class="cx"> }
</span><ins>+
+.heap-snapshot-record .icon {
+ content: url(../Images/HeapSnapshot.svg);
+}
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsTimelineOverviewjs"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/Views/TimelineOverview.js (197953 => 197954)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/TimelineOverview.js        2016-03-10 21:35:10 UTC (rev 197953)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/TimelineOverview.js        2016-03-10 21:37:56 UTC (rev 197954)
</span><span class="lines">@@ -25,7 +25,7 @@
</span><span class="cx">
</span><span class="cx"> WebInspector.TimelineOverview = class TimelineOverview extends WebInspector.View
</span><span class="cx"> {
</span><del>- constructor(timelineRecording)
</del><ins>+ constructor(timelineRecording, delegate)
</ins><span class="cx"> {
</span><span class="cx"> super();
</span><span class="cx">
</span><span class="lines">@@ -45,6 +45,8 @@
</span><span class="cx"> this._recording.addEventListener(WebInspector.TimelineRecording.Event.MarkerAdded, this._markerAdded, this);
</span><span class="cx"> this._recording.addEventListener(WebInspector.TimelineRecording.Event.Reset, this._recordingReset, this);
</span><span class="cx">
</span><ins>+ this._delegate = delegate;
+
</ins><span class="cx"> this.element.classList.add("timeline-overview");
</span><span class="cx"> this.element.addEventListener("wheel", this._handleWheelEvent.bind(this));
</span><span class="cx"> this.element.addEventListener("gesturestart", this._handleGestureStart.bind(this));
</span><span class="lines">@@ -376,6 +378,12 @@
</span><span class="cx"> overviewGraph.selectedRecord = record;
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+ userSelectedRecord(record)
+ {
+ if (this._delegate && this._delegate.timelineOverviewUserSelectedRecord)
+ this._delegate.timelineOverviewUserSelectedRecord(this, record);
+ }
+
</ins><span class="cx"> updateLayoutIfNeeded()
</span><span class="cx"> {
</span><span class="cx"> if (this.layoutPending) {
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsTimelineOverviewGraphjs"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/Views/TimelineOverviewGraph.js (197953 => 197954)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/TimelineOverviewGraph.js        2016-03-10 21:35:10 UTC (rev 197953)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/TimelineOverviewGraph.js        2016-03-10 21:37:56 UTC (rev 197954)
</span><span class="lines">@@ -65,6 +65,9 @@
</span><span class="cx"> if (timelineType === WebInspector.TimelineRecord.Type.Memory)
</span><span class="cx"> return new WebInspector.MemoryTimelineOverviewGraph(timeline, timelineOverview);
</span><span class="cx">
</span><ins>+ if (timelineType === WebInspector.TimelineRecord.Type.HeapAllocations)
+ return new WebInspector.HeapAllocationsTimelineOverviewGraph(timeline, timelineOverview);
+
</ins><span class="cx"> throw new Error("Can't make a graph for an unknown timeline.");
</span><span class="cx"> }
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsTimelineRecordingContentViewjs"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/Views/TimelineRecordingContentView.js (197953 => 197954)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/TimelineRecordingContentView.js        2016-03-10 21:35:10 UTC (rev 197953)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/TimelineRecordingContentView.js        2016-03-10 21:37:56 UTC (rev 197954)
</span><span class="lines">@@ -38,7 +38,7 @@
</span><span class="cx">
</span><span class="cx"> this.element.classList.add("timeline-recording");
</span><span class="cx">
</span><del>- this._timelineOverview = new WebInspector.TimelineOverview(this._recording);
</del><ins>+ this._timelineOverview = new WebInspector.TimelineOverview(this._recording, this);
</ins><span class="cx"> this._timelineOverview.addEventListener(WebInspector.TimelineOverview.Event.TimeRangeSelectionChanged, this._timeRangeSelectionChanged, this);
</span><span class="cx"> this._timelineOverview.addEventListener(WebInspector.TimelineOverview.Event.RecordSelected, this._recordSelected, this);
</span><span class="cx"> this._timelineOverview.addEventListener(WebInspector.TimelineOverview.Event.TimelineSelected, this._timelineSelected, this);
</span><span class="lines">@@ -351,6 +351,25 @@
</span><span class="cx"> return new WebInspector.GeneralTreeElement(iconClassName, title, representedObject, hasChildren);
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+ // TimelineOverview delegate
+
+ timelineOverviewUserSelectedRecord(timelineOverview, timelineRecord)
+ {
+ let timelineViewForRecord = null;
+ for (let timelineView of this._timelineViewMap.values()) {
+ if (timelineView.representedObject.type === timelineRecord.type) {
+ timelineViewForRecord = timelineView;
+ break;
+ }
+ }
+
+ if (!timelineViewForRecord)
+ return;
+
+ this._timelineContentBrowser.showContentView(timelineViewForRecord);
+ timelineViewForRecord.userSelectedRecordFromOverview(timelineRecord);
+ }
+
</ins><span class="cx"> // Private
</span><span class="cx">
</span><span class="cx"> _currentContentViewDidChange(event)
</span><span class="lines">@@ -364,7 +383,7 @@
</span><span class="cx">
</span><span class="cx"> this._timelineOverview.viewMode = newViewMode;
</span><span class="cx">
</span><del>- if (timelineView) {
</del><ins>+ if (timelineView instanceof WebInspector.TimelineView) {
</ins><span class="cx"> this._timelineSidebarPanel.contentTreeOutline = timelineView.navigationSidebarTreeOutline;
</span><span class="cx"> this._timelineSidebarPanel.contentTreeOutlineLabel = timelineView.navigationSidebarTreeOutlineLabel;
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsTimelineRulerjs"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/Views/TimelineRuler.js (197953 => 197954)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/TimelineRuler.js        2016-03-10 21:35:10 UTC (rev 197953)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/TimelineRuler.js        2016-03-10 21:37:56 UTC (rev 197954)
</span><span class="lines">@@ -105,8 +105,10 @@
</span><span class="cx"> this._allowsTimeRangeSelection = x;
</span><span class="cx">
</span><span class="cx"> if (x) {
</span><ins>+ this._clickEventListener = this._handleClick.bind(this);
</ins><span class="cx"> this._doubleClickEventListener = this._handleDoubleClick.bind(this);
</span><span class="cx"> this._mouseDownEventListener = this._handleMouseDown.bind(this);
</span><ins>+ this.element.addEventListener("click", this._clickEventListener);
</ins><span class="cx"> this.element.addEventListener("dblclick", this._doubleClickEventListener);
</span><span class="cx"> this.element.addEventListener("mousedown", this._mouseDownEventListener);
</span><span class="cx">
</span><span class="lines">@@ -133,8 +135,10 @@
</span><span class="cx">
</span><span class="cx"> this._needsSelectionLayout();
</span><span class="cx"> } else {
</span><ins>+ this.element.removeEventListener("click", this._clickEventListener);
</ins><span class="cx"> this.element.removeEventListener("dblclick", this._doubleClickEventListener);
</span><span class="cx"> this.element.removeEventListener("mousedown", this._mouseDownEventListener);
</span><ins>+ this._clickEventListener = null;
</ins><span class="cx"> this._doubleClickEventListener = null;
</span><span class="cx"> this._mouseDownEventListener = null;
</span><span class="cx">
</span><span class="lines">@@ -694,6 +698,19 @@
</span><span class="cx"> this._needsMarkerLayout();
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+ _handleClick(event)
+ {
+ if (this._mouseMoved)
+ return;
+
+ this.element.style.pointerEvents = "none";
+ let newTarget = document.elementFromPoint(event.pageX, event.pageY);
+ this.element.style.pointerEvents = "all";
+
+ if (newTarget && newTarget.click)
+ newTarget.click();
+ }
+
</ins><span class="cx"> _handleDoubleClick(event)
</span><span class="cx"> {
</span><span class="cx"> if (this.entireRangeSelected)
</span><span class="lines">@@ -719,6 +736,8 @@
</span><span class="cx"> } else
</span><span class="cx"> this._mouseDownPosition = event.pageX - this._rulerBoundingClientRect.left;
</span><span class="cx">
</span><ins>+ this._mouseMoved = false;
+
</ins><span class="cx"> this._mouseMoveEventListener = this._handleMouseMove.bind(this);
</span><span class="cx"> this._mouseUpEventListener = this._handleMouseUp.bind(this);
</span><span class="cx">
</span><span class="lines">@@ -734,6 +753,8 @@
</span><span class="cx"> {
</span><span class="cx"> console.assert(event.button === 0);
</span><span class="cx">
</span><ins>+ this._mouseMoved = true;
+
</ins><span class="cx"> let currentMousePosition;
</span><span class="cx"> if (this._selectionIsMove) {
</span><span class="cx"> currentMousePosition = Math.max(this._moveSelectionMaximumLeftOffset, Math.min(this._moveSelectionMaximumRightOffset, event.pageX));
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsTimelineTabContentViewjs"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/Views/TimelineTabContentView.js (197953 => 197954)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/TimelineTabContentView.js        2016-03-10 21:35:10 UTC (rev 197953)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/TimelineTabContentView.js        2016-03-10 21:37:56 UTC (rev 197954)
</span><span class="lines">@@ -122,6 +122,8 @@
</span><span class="cx"> return WebInspector.UIString("Rendering Frames");
</span><span class="cx"> case WebInspector.TimelineRecord.Type.Memory:
</span><span class="cx"> return WebInspector.UIString("Memory");
</span><ins>+ case WebInspector.TimelineRecord.Type.HeapAllocations:
+ return WebInspector.UIString("JavaScript Allocations");
</ins><span class="cx"> default:
</span><span class="cx"> console.error("Unknown Timeline type:", timeline.type);
</span><span class="cx"> }
</span><span class="lines">@@ -138,6 +140,9 @@
</span><span class="cx"> return "layout-icon";
</span><span class="cx"> case WebInspector.TimelineRecord.Type.Memory:
</span><span class="cx"> return "memory-icon";
</span><ins>+ case WebInspector.TimelineRecord.Type.HeapAllocations:
+ // FIXME: HeapAllocation Timeline needs a new icon.
+ return "memory-icon";
</ins><span class="cx"> case WebInspector.TimelineRecord.Type.Script:
</span><span class="cx"> return "script-icon";
</span><span class="cx"> case WebInspector.TimelineRecord.Type.RenderingFrame:
</span><span class="lines">@@ -158,6 +163,8 @@
</span><span class="cx"> return "colors";
</span><span class="cx"> case WebInspector.TimelineRecord.Type.Memory:
</span><span class="cx"> return "memory";
</span><ins>+ case WebInspector.TimelineRecord.Type.HeapAllocations:
+ return "heap-allocations";
</ins><span class="cx"> case WebInspector.TimelineRecord.Type.Script:
</span><span class="cx"> return "script";
</span><span class="cx"> case WebInspector.TimelineRecord.Type.RenderingFrame:
</span><span class="lines">@@ -224,6 +231,9 @@
</span><span class="cx"> case WebInspector.TimelineRecord.Type.RenderingFrame:
</span><span class="cx"> return WebInspector.TimelineRecordTreeElement.RenderingFrameRecordIconStyleClass;
</span><span class="cx">
</span><ins>+ case WebInspector.TimelineRecord.Type.HeapAllocations:
+ return "heap-snapshot-record";
+
</ins><span class="cx"> case WebInspector.TimelineRecord.Type.Memory:
</span><span class="cx"> // Not used. Fall through to error just in case.
</span><span class="cx">
</span><span class="lines">@@ -245,6 +255,8 @@
</span><span class="cx"> return WebInspector.ScriptTimelineRecord.EventType.displayName(timelineRecord.eventType, timelineRecord.details, includeDetailsInMainTitle);
</span><span class="cx"> case WebInspector.TimelineRecord.Type.RenderingFrame:
</span><span class="cx"> return WebInspector.UIString("Frame %d").format(timelineRecord.frameNumber);
</span><ins>+ case WebInspector.TimelineRecord.Type.HeapAllocations:
+ return WebInspector.UIString("Snapshot %d").format(timelineRecord.heapSnapshot.identifier);
</ins><span class="cx"> case WebInspector.TimelineRecord.Type.Memory:
</span><span class="cx"> // Not used. Fall through to error just in case.
</span><span class="cx"> default:
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsTimelineViewjs"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/Views/TimelineView.js (197953 => 197954)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/TimelineView.js        2016-03-10 21:35:10 UTC (rev 197953)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/TimelineView.js        2016-03-10 21:37:56 UTC (rev 197954)
</span><span class="lines">@@ -245,6 +245,11 @@
</span><span class="cx"> this.showContentViewForTreeElement(treeElement);
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+ userSelectedRecordFromOverview(timelineRecord)
+ {
+ // Implemented by sub-classes if needed.
+ }
+
</ins><span class="cx"> // Private
</span><span class="cx">
</span><span class="cx"> _treeSelectionDidChange(event)
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsVariablescss"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/Views/Variables.css (197953 => 197954)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/Variables.css        2016-03-10 21:35:10 UTC (rev 197953)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/Variables.css        2016-03-10 21:37:56 UTC (rev 197954)
</span><span class="lines">@@ -67,6 +67,8 @@
</span><span class="cx"> --memory-page-stroke-color: hsl(22, 40%, 50%);
</span><span class="cx"> --memory-max-comparison-fill-color: hsl(220, 10%, 75%);
</span><span class="cx"> --memory-max-comparison-stroke-color: hsl(220, 10%, 55%);
</span><ins>+ --memory-extra-fill-color: hsl(211, 53%, 70%);
+ --memory-extra-stroke-color: hsl(211, 53%, 55%);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> body.window-inactive {
</span></span></pre>
</div>
</div>
</body>
</html>