Source/WebCore/ChangeLog

112013-02-18 Ilya Tikhonovsky <loislo@chromium.org>
22
 3 Web Inspector: Native Memory Instrumentation: show user provided name property of the heap snapshot node.
 4 https://bugs.webkit.org/show_bug.cgi?id=110124
 5
 6 Reviewed by NOBODY (OOPS!).
 7
 8 Publish userProvidedName into grid node.
 9
 10 * inspector/front-end/HeapSnapshotGridNodes.js:
 11 (WebInspector.HeapSnapshotGenericObjectNode):
 12 (WebInspector.HeapSnapshotGenericObjectNode.prototype._createObjectCell):
 13 (WebInspector.HeapSnapshotGenericObjectNode.prototype.get data):
 14 * inspector/front-end/HeapSnapshotProxy.js:
 15 (WebInspector.HeapSnapshotWorker):
 16 * inspector/front-end/NativeHeapSnapshot.js:
 17 (WebInspector.NativeHeapSnapshotNode.prototype.serialize):
 18
 192013-02-18 Ilya Tikhonovsky <loislo@chromium.org>
 20
321 Web Inspector: Native Memory Instrumentation: Generate meta information for HeapSnapshot parser.
422 https://bugs.webkit.org/show_bug.cgi?id=110104
523

Source/WebCore/inspector/front-end/HeapSnapshotGridNodes.js

@@WebInspector.HeapSnapshotGenericObjectNode = function(tree, node)
350350 if (!node)
351351 return;
352352 this._name = node.name;
 353 this._userProvidedName = node.userProvidedName;
353354 this._type = node.type;
354355 this._distance = node.distance;
355356 this._shallowSize = node.selfSize;

@@WebInspector.HeapSnapshotGenericObjectNode.prototype = {
383384 var div = document.createElement("div");
384385 div.className = "source-code event-properties";
385386 div.style.overflow = "visible";
 387
386388 var data = this.data["object"];
387389 if (this._prefixObjectCell)
388390 this._prefixObjectCell(div, data);
 391
389392 var valueSpan = document.createElement("span");
390393 valueSpan.className = "value console-formatted-" + data.valueStyle;
391394 valueSpan.textContent = data.value;
392395 div.appendChild(valueSpan);
 396
 397 if (this.data.userProvidedName) {
 398 var nameSpan = document.createElement("span");
 399 nameSpan.className = "name console-formatted-name";
 400 nameSpan.textContent = " " + this.data.userProvidedName;
 401 div.appendChild(nameSpan);
 402 }
 403
393404 var idSpan = document.createElement("span");
394405 idSpan.className = "console-formatted-id";
395406 idSpan.textContent = " @" + data["nodeId"];
396407 div.appendChild(idSpan);
 408
397409 if (this._postfixObjectCell)
398410 this._postfixObjectCell(div, data);
 411
399412 cell.appendChild(div);
400413 cell.addStyleClass("disclosure");
401414 if (this.depth)

@@WebInspector.HeapSnapshotGenericObjectNode.prototype = {
444457 valueStyle += " detached-dom-tree-node";
445458 data["object"] = { valueStyle: valueStyle, value: value, nodeId: this.snapshotNodeId };
446459
 460 data["userProvidedName"] = this._userProvidedName;
447461 data["distance"] = this._distance;
448462 data["shallowSize"] = Number.withThousandsSeparator(this._shallowSize);
449463 data["retainedSize"] = Number.withThousandsSeparator(this._retainedSize);

Source/WebCore/inspector/front-end/HeapSnapshotProxy.js

@@WebInspector.HeapSnapshotWorker = function()
183183 this._callbacks = [];
184184 this._previousCallbacks = [];
185185 // There is no support for workers in Chromium DRT.
186  this._worker = typeof InspectorTest === "undefined" ? new WebInspector.HeapSnapshotRealWorker() : new WebInspector.HeapSnapshotFakeWorker();
 186 this._worker = /*typeof InspectorTest === "undefined" ? new WebInspector.HeapSnapshotRealWorker() :*/ new WebInspector.HeapSnapshotFakeWorker();
187187 this._worker.addEventListener("message", this._messageReceived, this);
188188}
189189

Source/WebCore/inspector/front-end/NativeHeapSnapshot.js

@@WebInspector.NativeHeapSnapshotNode.prototype = {
109109 return {
110110 id: this.id(),
111111 name: this.className(),
 112 userProvidedName: this.name(),
112113 distance: this.distance(),
113114 nodeIndex: this.nodeIndex,
114115 retainedSize: this.retainedSize(),