<!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>[202253] trunk/Source/WebInspectorUI</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/202253">202253</a></dd>
<dt>Author</dt> <dd>commit-queue@webkit.org</dd>
<dt>Date</dt> <dd>2016-06-20 17:01:32 -0700 (Mon, 20 Jun 2016)</dd>
</dl>
<h3>Log Message</h3>
<pre>Web Inspector: Snapshot List should show the total size and the total live size
https://bugs.webkit.org/show_bug.cgi?id=157904
<rdar://problem/26372833>
Patch by Joseph Pecoraro <pecoraro@apple.com> on 2016-06-20
Reviewed by Brian Burg.
Include the live size of a snapshot in the snapshot list.
* Localizations/en.lproj/localizedStrings.js:
New "Live Size" string.
* UserInterface/Workers/HeapSnapshot/HeapSnapshot.js:
(HeapSnapshot):
(HeapSnapshot.updateCategoriesAndMetadata):
(HeapSnapshot.prototype.update):
(HeapSnapshot.prototype.serialize):
(HeapSnapshotDiff):
(HeapSnapshotDiff.prototype.update):
(HeapSnapshot.buildCategories): Deleted.
(HeapSnapshot.prototype.updateCategories): Deleted.
(HeapSnapshotDiff.prototype.updateCategories): Deleted.
* UserInterface/Proxies/HeapSnapshotDiffProxy.js:
(WebInspector.HeapSnapshotDiffProxy.prototype.updateForCollectionEvent):
(WebInspector.HeapSnapshotDiffProxy.prototype.update):
(WebInspector.HeapSnapshotDiffProxy.prototype.updateCategories): Deleted.
* UserInterface/Proxies/HeapSnapshotProxy.js:
(WebInspector.HeapSnapshotProxy):
(WebInspector.HeapSnapshotProxy.deserialize):
(WebInspector.HeapSnapshotProxy.prototype.get liveSize):
(WebInspector.HeapSnapshotProxy.prototype.updateForCollectionEvent):
(WebInspector.HeapSnapshotProxy.prototype.update):
(WebInspector.HeapSnapshotProxy.prototype.updateCategories): Deleted.
Rename "updateCategories" to "update" and update both categories
and metadata, like the liveSize.
* UserInterface/Views/HeapAllocationsTimelineDataGridNode.js:
(WebInspector.HeapAllocationsTimelineDataGridNode):
(WebInspector.HeapAllocationsTimelineDataGridNode.prototype.createCellContent):
(WebInspector.HeapAllocationsTimelineDataGridNode.prototype._heapSnapshotCollectedNodes):
Update live size after collection.
* UserInterface/Views/HeapAllocationsTimelineView.js:
(WebInspector.HeapAllocationsTimelineView):
Include a live size column in the DataGrid.
(WebInspector.HeapAllocationsTimelineView.prototype.closed):
Cleanup listeners appropriately.</pre>
<h3>Modified Paths</h3>
<ul>
<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="#trunkSourceWebInspectorUIUserInterfaceProxiesHeapSnapshotDiffProxyjs">trunk/Source/WebInspectorUI/UserInterface/Proxies/HeapSnapshotDiffProxy.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceProxiesHeapSnapshotProxyjs">trunk/Source/WebInspectorUI/UserInterface/Proxies/HeapSnapshotProxy.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsHeapAllocationsTimelineDataGridNodejs">trunk/Source/WebInspectorUI/UserInterface/Views/HeapAllocationsTimelineDataGridNode.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsHeapAllocationsTimelineViewjs">trunk/Source/WebInspectorUI/UserInterface/Views/HeapAllocationsTimelineView.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceWorkersHeapSnapshotHeapSnapshotjs">trunk/Source/WebInspectorUI/UserInterface/Workers/HeapSnapshot/HeapSnapshot.js</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebInspectorUIChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/ChangeLog (202252 => 202253)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/ChangeLog        2016-06-20 23:26:52 UTC (rev 202252)
+++ trunk/Source/WebInspectorUI/ChangeLog        2016-06-21 00:01:32 UTC (rev 202253)
</span><span class="lines">@@ -1,5 +1,54 @@
</span><span class="cx"> 2016-06-20 Joseph Pecoraro <pecoraro@apple.com>
</span><span class="cx">
</span><ins>+ Web Inspector: Snapshot List should show the total size and the total live size
+ https://bugs.webkit.org/show_bug.cgi?id=157904
+ <rdar://problem/26372833>
+
+ Reviewed by Brian Burg.
+
+ Include the live size of a snapshot in the snapshot list.
+
+ * Localizations/en.lproj/localizedStrings.js:
+ New "Live Size" string.
+
+ * UserInterface/Workers/HeapSnapshot/HeapSnapshot.js:
+ (HeapSnapshot):
+ (HeapSnapshot.updateCategoriesAndMetadata):
+ (HeapSnapshot.prototype.update):
+ (HeapSnapshot.prototype.serialize):
+ (HeapSnapshotDiff):
+ (HeapSnapshotDiff.prototype.update):
+ (HeapSnapshot.buildCategories): Deleted.
+ (HeapSnapshot.prototype.updateCategories): Deleted.
+ (HeapSnapshotDiff.prototype.updateCategories): Deleted.
+ * UserInterface/Proxies/HeapSnapshotDiffProxy.js:
+ (WebInspector.HeapSnapshotDiffProxy.prototype.updateForCollectionEvent):
+ (WebInspector.HeapSnapshotDiffProxy.prototype.update):
+ (WebInspector.HeapSnapshotDiffProxy.prototype.updateCategories): Deleted.
+ * UserInterface/Proxies/HeapSnapshotProxy.js:
+ (WebInspector.HeapSnapshotProxy):
+ (WebInspector.HeapSnapshotProxy.deserialize):
+ (WebInspector.HeapSnapshotProxy.prototype.get liveSize):
+ (WebInspector.HeapSnapshotProxy.prototype.updateForCollectionEvent):
+ (WebInspector.HeapSnapshotProxy.prototype.update):
+ (WebInspector.HeapSnapshotProxy.prototype.updateCategories): Deleted.
+ Rename "updateCategories" to "update" and update both categories
+ and metadata, like the liveSize.
+
+ * UserInterface/Views/HeapAllocationsTimelineDataGridNode.js:
+ (WebInspector.HeapAllocationsTimelineDataGridNode):
+ (WebInspector.HeapAllocationsTimelineDataGridNode.prototype.createCellContent):
+ (WebInspector.HeapAllocationsTimelineDataGridNode.prototype._heapSnapshotCollectedNodes):
+ Update live size after collection.
+
+ * UserInterface/Views/HeapAllocationsTimelineView.js:
+ (WebInspector.HeapAllocationsTimelineView):
+ Include a live size column in the DataGrid.
+ (WebInspector.HeapAllocationsTimelineView.prototype.closed):
+ Cleanup listeners appropriately.
+
+2016-06-20 Joseph Pecoraro <pecoraro@apple.com>
+
</ins><span class="cx"> Web Inspector: console.profile should use the new Sampling Profiler
</span><span class="cx"> https://bugs.webkit.org/show_bug.cgi?id=153499
</span><span class="cx"> <rdar://problem/24352431>
</span></span></pre></div>
<a id="trunkSourceWebInspectorUILocalizationsenlprojlocalizedStringsjs"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js (202252 => 202253)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js        2016-06-20 23:26:52 UTC (rev 202252)
+++ trunk/Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js        2016-06-21 00:01:32 UTC (rev 202253)
</span><span class="lines">@@ -294,7 +294,6 @@
</span><span class="cx"> localizedStrings["Enter a Gradient"] = "Enter a Gradient";
</span><span class="cx"> localizedStrings["Enter a URL"] = "Enter a URL";
</span><span class="cx"> localizedStrings["Enter a name."] = "Enter a name.";
</span><del>-localizedStrings["Enter a value"] = "Enter a value";
</del><span class="cx"> localizedStrings["Enter the name of a Keyframe"] = "Enter the name of a Keyframe";
</span><span class="cx"> localizedStrings["Entire Recording"] = "Entire Recording";
</span><span class="cx"> localizedStrings["Error: "] = "Error: ";
</span><span class="lines">@@ -424,6 +423,7 @@
</span><span class="cx"> localizedStrings["Linear Gradient"] = "Linear Gradient";
</span><span class="cx"> localizedStrings["List Styles"] = "List Styles";
</span><span class="cx"> localizedStrings["Live"] = "Live";
</span><ins>+localizedStrings["Live Size"] = "Live Size";
</ins><span class="cx"> localizedStrings["Load \u2014 %s"] = "Load \u2014 %s";
</span><span class="cx"> localizedStrings["Local File"] = "Local File";
</span><span class="cx"> localizedStrings["Local Storage"] = "Local Storage";
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceProxiesHeapSnapshotDiffProxyjs"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/Proxies/HeapSnapshotDiffProxy.js (202252 => 202253)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Proxies/HeapSnapshotDiffProxy.js        2016-06-20 23:26:52 UTC (rev 202252)
+++ trunk/Source/WebInspectorUI/UserInterface/Proxies/HeapSnapshotDiffProxy.js        2016-06-21 00:01:32 UTC (rev 202253)
</span><span class="lines">@@ -67,7 +67,7 @@
</span><span class="cx"> if (!event.data.affectedSnapshots.includes(this._snapshot2._identifier))
</span><span class="cx"> return;
</span><span class="cx">
</span><del>- this.updateCategories(() => {
</del><ins>+ this.update(() => {
</ins><span class="cx"> this.dispatchEventToListeners(WebInspector.HeapSnapshotProxy.Event.CollectedNodes, event.data);
</span><span class="cx"> });
</span><span class="cx"> }
</span><span class="lines">@@ -84,9 +84,9 @@
</span><span class="cx"> });
</span><span class="cx"> }
</span><span class="cx">
</span><del>- updateCategories(callback)
</del><ins>+ update(callback)
</ins><span class="cx"> {
</span><del>- WebInspector.HeapSnapshotWorkerProxy.singleton().callMethod(this._proxyObjectId, "updateCategories", (categories) => {
</del><ins>+ WebInspector.HeapSnapshotWorkerProxy.singleton().callMethod(this._proxyObjectId, "update", ({liveSize, categories}) => {
</ins><span class="cx"> this._categories = Map.fromObject(categories);
</span><span class="cx"> callback();
</span><span class="cx"> });
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceProxiesHeapSnapshotProxyjs"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/Proxies/HeapSnapshotProxy.js (202252 => 202253)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Proxies/HeapSnapshotProxy.js        2016-06-20 23:26:52 UTC (rev 202252)
+++ trunk/Source/WebInspectorUI/UserInterface/Proxies/HeapSnapshotProxy.js        2016-06-21 00:01:32 UTC (rev 202253)
</span><span class="lines">@@ -25,7 +25,7 @@
</span><span class="cx">
</span><span class="cx"> WebInspector.HeapSnapshotProxy = class HeapSnapshotProxy extends WebInspector.Object
</span><span class="cx"> {
</span><del>- constructor(snapshotObjectId, identifier, title, totalSize, totalObjectCount, categories)
</del><ins>+ constructor(snapshotObjectId, identifier, title, totalSize, totalObjectCount, liveSize, categories)
</ins><span class="cx"> {
</span><span class="cx"> super();
</span><span class="cx">
</span><span class="lines">@@ -35,6 +35,7 @@
</span><span class="cx"> this._title = title;
</span><span class="cx"> this._totalSize = totalSize;
</span><span class="cx"> this._totalObjectCount = totalObjectCount;
</span><ins>+ this._liveSize = liveSize;
</ins><span class="cx"> this._categories = Map.fromObject(categories);
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -42,8 +43,8 @@
</span><span class="cx">
</span><span class="cx"> static deserialize(objectId, serializedSnapshot)
</span><span class="cx"> {
</span><del>- let {identifier, title, totalSize, totalObjectCount, categories} = serializedSnapshot;
- return new WebInspector.HeapSnapshotProxy(objectId, identifier, title, totalSize, totalObjectCount, categories);
</del><ins>+ let {identifier, title, totalSize, totalObjectCount, liveSize, categories} = serializedSnapshot;
+ return new WebInspector.HeapSnapshotProxy(objectId, identifier, title, totalSize, totalObjectCount, liveSize, categories);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> // Public
</span><span class="lines">@@ -53,6 +54,7 @@
</span><span class="cx"> get title() { return this._title; }
</span><span class="cx"> get totalSize() { return this._totalSize; }
</span><span class="cx"> get totalObjectCount() { return this._totalObjectCount; }
</span><ins>+ get liveSize() { return this._liveSize; }
</ins><span class="cx"> get categories() { return this._categories; }
</span><span class="cx">
</span><span class="cx"> updateForCollectionEvent(event)
</span><span class="lines">@@ -60,7 +62,7 @@
</span><span class="cx"> if (!event.data.affectedSnapshots.includes(this._identifier))
</span><span class="cx"> return;
</span><span class="cx">
</span><del>- this.updateCategories(() => {
</del><ins>+ this.update(() => {
</ins><span class="cx"> this.dispatchEventToListeners(WebInspector.HeapSnapshotProxy.Event.CollectedNodes, event.data);
</span><span class="cx"> });
</span><span class="cx"> }
</span><span class="lines">@@ -77,9 +79,10 @@
</span><span class="cx"> });
</span><span class="cx"> }
</span><span class="cx">
</span><del>- updateCategories(callback)
</del><ins>+ update(callback)
</ins><span class="cx"> {
</span><del>- WebInspector.HeapSnapshotWorkerProxy.singleton().callMethod(this._proxyObjectId, "updateCategories", (categories) => {
</del><ins>+ WebInspector.HeapSnapshotWorkerProxy.singleton().callMethod(this._proxyObjectId, "update", ({liveSize, categories}) => {
+ this._liveSize = liveSize;
</ins><span class="cx"> this._categories = Map.fromObject(categories);
</span><span class="cx"> callback();
</span><span class="cx"> });
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsHeapAllocationsTimelineDataGridNodejs"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/Views/HeapAllocationsTimelineDataGridNode.js (202252 => 202253)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/HeapAllocationsTimelineDataGridNode.js        2016-06-20 23:26:52 UTC (rev 202252)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/HeapAllocationsTimelineDataGridNode.js        2016-06-21 00:01:32 UTC (rev 202253)
</span><span class="lines">@@ -36,7 +36,10 @@
</span><span class="cx"> name: this.displayName(),
</span><span class="cx"> timestamp: zeroTime ? this._record.timestamp - zeroTime : NaN,
</span><span class="cx"> size: this._record.heapSnapshot.totalSize,
</span><ins>+ liveSize: this._record.heapSnapshot.liveSize,
</ins><span class="cx"> };
</span><ins>+
+ this._record.heapSnapshot.addEventListener(WebInspector.HeapSnapshotProxy.Event.CollectedNodes, this._heapSnapshotCollectedNodes, this);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> // Public
</span><span class="lines">@@ -64,6 +67,9 @@
</span><span class="cx">
</span><span class="cx"> case "size":
</span><span class="cx"> return Number.bytesToString(this._data.size);
</span><ins>+
+ case "liveSize":
+ return Number.bytesToString(this._data.liveSize);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> return super.createCellContent(columnIdentifier, cell);
</span><span class="lines">@@ -85,4 +91,19 @@
</span><span class="cx"> this._data.timestamp = this._record.timestamp - zeroTime;
</span><span class="cx"> this.needsRefresh();
</span><span class="cx"> }
</span><ins>+
+ // Private
+
+ _heapSnapshotCollectedNodes()
+ {
+ let oldSize = this._data.liveSize;
+ let newSize = this._record.heapSnapshot.liveSize;
+
+ console.assert(newSize <= oldSize);
+ if (oldSize === newSize)
+ return;
+
+ this._data.liveSize = newSize;
+ this.needsRefresh();
+ }
</ins><span class="cx"> };
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsHeapAllocationsTimelineViewjs"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/Views/HeapAllocationsTimelineView.js (202252 => 202253)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/HeapAllocationsTimelineView.js        2016-06-20 23:26:52 UTC (rev 202252)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/HeapAllocationsTimelineView.js        2016-06-21 00:01:32 UTC (rev 202253)
</span><span class="lines">@@ -51,6 +51,12 @@
</span><span class="cx"> sortable: true,
</span><span class="cx"> aligned: "right",
</span><span class="cx"> },
</span><ins>+ liveSize: {
+ title: WebInspector.UIString("Live Size"),
+ width: "80px",
+ sortable: true,
+ aligned: "right",
+ },
</ins><span class="cx"> };
</span><span class="cx">
</span><span class="cx"> let snapshotTooltip = WebInspector.UIString("Take snapshot");
</span><span class="lines">@@ -233,6 +239,7 @@
</span><span class="cx">
</span><span class="cx"> this._contentViewContainer.closeAllContentViews();
</span><span class="cx">
</span><ins>+ WebInspector.ContentView.removeEventListener(null, null, this);
</ins><span class="cx"> WebInspector.HeapSnapshotWorkerProxy.singleton().removeEventListener("HeapSnapshot.CollectionEvent", this._heapSnapshotCollectionEvent, this);
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -296,8 +303,6 @@
</span><span class="cx"> updateHeapSnapshotForEvent(record.heapSnapshot);
</span><span class="cx"> if (this._heapSnapshotDiff)
</span><span class="cx"> updateHeapSnapshotForEvent(this._heapSnapshotDiff);
</span><del>-
- // FIXME: <https://webkit.org/b/157904> Web Inspector: Snapshot List should show the total size and the total live size
</del><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> _snapshotListPathComponentClicked(event)
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceWorkersHeapSnapshotHeapSnapshotjs"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/Workers/HeapSnapshot/HeapSnapshot.js (202252 => 202253)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Workers/HeapSnapshot/HeapSnapshot.js        2016-06-20 23:26:52 UTC (rev 202252)
+++ trunk/Source/WebInspectorUI/UserInterface/Workers/HeapSnapshot/HeapSnapshot.js        2016-06-21 00:01:32 UTC (rev 202253)
</span><span class="lines">@@ -132,13 +132,16 @@
</span><span class="cx">
</span><span class="cx"> this._nodeOrdinalIsDead = new Uint8Array(this._nodeCount);
</span><span class="cx">
</span><del>- this._categories = HeapSnapshot.buildCategories(this);
</del><ins>+ let {liveSize, categories} = HeapSnapshot.updateCategoriesAndMetadata(this);
+ this._liveSize = liveSize;
+ this._categories = categories;
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> // Static
</span><span class="cx">
</span><del>- static buildCategories(snapshot, allowNodeIdentifierCallback)
</del><ins>+ static updateCategoriesAndMetadata(snapshot, allowNodeIdentifierCallback)
</ins><span class="cx"> {
</span><ins>+ let liveSize = 0;
</ins><span class="cx"> let categories = {};
</span><span class="cx">
</span><span class="cx"> let nodes = snapshot._nodes;
</span><span class="lines">@@ -171,9 +174,11 @@
</span><span class="cx"> category.internalCount += 1;
</span><span class="cx"> if (dead)
</span><span class="cx"> category.deadCount += 1;
</span><ins>+ else
+ liveSize += size;
</ins><span class="cx"> }
</span><span class="cx">
</span><del>- return categories;
</del><ins>+ return {liveSize, categories};
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> static allocationBucketCounts(snapshot, bucketSizes, allowNodeIdentifierCallback)
</span><span class="lines">@@ -239,9 +244,9 @@
</span><span class="cx"> return HeapSnapshot.instancesWithClassName(this, className);
</span><span class="cx"> }
</span><span class="cx">
</span><del>- updateCategories()
</del><ins>+ update()
</ins><span class="cx"> {
</span><del>- return HeapSnapshot.buildCategories(this);
</del><ins>+ return HeapSnapshot.updateCategoriesAndMetadata(this);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> nodeWithIdentifier(nodeIdentifier)
</span><span class="lines">@@ -390,13 +395,12 @@
</span><span class="cx">
</span><span class="cx"> serialize()
</span><span class="cx"> {
</span><del>- // FIXME: <https://webkit.org/b/157904> Web Inspector: Snapshot List should show the total size and the total live size
-
</del><span class="cx"> return {
</span><span class="cx"> identifier: this._identifier,
</span><span class="cx"> title: this._title,
</span><span class="cx"> totalSize: this._totalSize,
</span><span class="cx"> totalObjectCount: this._nodeCount - 1, // <root>.
</span><ins>+ liveSize: this._liveSize,
</ins><span class="cx"> categories: this._categories,
</span><span class="cx"> };
</span><span class="cx"> }
</span><span class="lines">@@ -792,7 +796,8 @@
</span><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx">
</span><del>- this._categories = HeapSnapshot.buildCategories(this._snapshot2, (nodeIdentifier) => this._addedNodeIdentifiers.has(nodeIdentifier));
</del><ins>+ let {liveSize, categories} = HeapSnapshot.updateCategoriesAndMetadata(this._snapshot2, (nodeIdentifier) => this._addedNodeIdentifiers.has(nodeIdentifier));
+ this._categories = categories;
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> // Worker Methods
</span><span class="lines">@@ -807,9 +812,9 @@
</span><span class="cx"> return HeapSnapshot.instancesWithClassName(this._snapshot2, className, (nodeIdentifier) => this._addedNodeIdentifiers.has(nodeIdentifier));
</span><span class="cx"> }
</span><span class="cx">
</span><del>- updateCategories()
</del><ins>+ update()
</ins><span class="cx"> {
</span><del>- return HeapSnapshot.buildCategories(this._snapshot2, (nodeIdentifier) => this._addedNodeIdentifiers.has(nodeIdentifier));
</del><ins>+ return HeapSnapshot.updateCategoriesAndMetadata(this._snapshot2, (nodeIdentifier) => this._addedNodeIdentifiers.has(nodeIdentifier));
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> nodeWithIdentifier(nodeIdentifier) { return this._snapshot2.nodeWithIdentifier(nodeIdentifier); }
</span></span></pre>
</div>
</div>
</body>
</html>