OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2011 Google Inc. All rights reserved. | 2 * Copyright (C) 2011 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 /** | 44 /** |
45 * List of position ranges for all visible nodes: [startPos1, endPos1),...,[
startPosN, endPosN) | 45 * List of position ranges for all visible nodes: [startPos1, endPos1),...,[
startPosN, endPosN) |
46 * Position is an item position in the provider. | 46 * Position is an item position in the provider. |
47 */ | 47 */ |
48 this._retrievedChildrenRanges = []; | 48 this._retrievedChildrenRanges = []; |
49 | 49 |
50 /** | 50 /** |
51 * @type {?WebInspector.HeapSnapshotGridNode.ChildrenProvider} | 51 * @type {?WebInspector.HeapSnapshotGridNode.ChildrenProvider} |
52 */ | 52 */ |
53 this._providerObject = null; | 53 this._providerObject = null; |
| 54 this._reachableFromWindow = false; |
54 }; | 55 }; |
55 | 56 |
56 /** @enum {symbol} */ | 57 /** @enum {symbol} */ |
57 WebInspector.HeapSnapshotGridNode.Events = { | 58 WebInspector.HeapSnapshotGridNode.Events = { |
58 PopulateComplete: Symbol("PopulateComplete") | 59 PopulateComplete: Symbol("PopulateComplete") |
59 }; | 60 }; |
60 | 61 |
61 /** | 62 /** |
62 * @param {!Array.<string>} fieldNames | 63 * @param {!Array.<string>} fieldNames |
63 * @return {!WebInspector.HeapSnapshotCommon.ComparatorConfig} | 64 * @return {!WebInspector.HeapSnapshotCommon.ComparatorConfig} |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
170 | 171 |
171 dispose: function() | 172 dispose: function() |
172 { | 173 { |
173 if (this._providerObject) | 174 if (this._providerObject) |
174 this._providerObject.dispose(); | 175 this._providerObject.dispose(); |
175 for (var node = this.children[0]; node; node = node.traverseNextNode(tru
e, this, true)) | 176 for (var node = this.children[0]; node; node = node.traverseNextNode(tru
e, this, true)) |
176 if (node.dispose) | 177 if (node.dispose) |
177 node.dispose(); | 178 node.dispose(); |
178 }, | 179 }, |
179 | 180 |
180 _reachableFromWindow: false, | 181 /** |
181 | 182 * @param {!WebInspector.Target} target |
182 queryObjectContent: function(callback) | 183 * @param {function(!WebInspector.RemoteObject)} callback |
| 184 * @param {string} objectGroupName |
| 185 */ |
| 186 queryObjectContent: function(target, callback, objectGroupName) |
183 { | 187 { |
184 }, | 188 }, |
185 | 189 |
186 /** | 190 /** |
187 * @override | 191 * @override |
188 */ | 192 */ |
189 wasDetached: function() | 193 wasDetached: function() |
190 { | 194 { |
191 this._dataGrid.nodeWasDetached(this); | 195 this._dataGrid.nodeWasDetached(this); |
192 }, | 196 }, |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
263 percentSpan.className = "percent-column"; | 267 percentSpan.className = "percent-column"; |
264 percentSpan.textContent = this.data[percentColumn]; | 268 percentSpan.textContent = this.data[percentColumn]; |
265 div.appendChild(percentSpan); | 269 div.appendChild(percentSpan); |
266 div.classList.add("profile-multiple-values"); | 270 div.classList.add("profile-multiple-values"); |
267 } | 271 } |
268 cell.appendChild(div); | 272 cell.appendChild(div); |
269 } | 273 } |
270 return cell; | 274 return cell; |
271 }, | 275 }, |
272 | 276 |
273 populate: function(event) | 277 /** |
| 278 * @override |
| 279 */ |
| 280 populate: function() |
274 { | 281 { |
275 if (this._populated) | 282 if (this._populated) |
276 return; | 283 return; |
277 this._populated = true; | 284 this._populated = true; |
278 this._provider().sortAndRewind(this.comparator()).then(this._populateChi
ldren.bind(this)); | 285 this._provider().sortAndRewind(this.comparator()).then(this._populateChi
ldren.bind(this)); |
279 }, | 286 }, |
280 | 287 |
281 /** | 288 /** |
282 * @return {!Promise<?>} | 289 * @return {!Promise<?>} |
283 */ | 290 */ |
(...skipping 337 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
621 cell.style.setProperty("padding-left", (this.depth * this.dataGrid.i
ndentWidth) + "px"); | 628 cell.style.setProperty("padding-left", (this.depth * this.dataGrid.i
ndentWidth) + "px"); |
622 cell.heapSnapshotNode = this; | 629 cell.heapSnapshotNode = this; |
623 return cell; | 630 return cell; |
624 }, | 631 }, |
625 | 632 |
626 _prefixObjectCell: function(div) | 633 _prefixObjectCell: function(div) |
627 { | 634 { |
628 }, | 635 }, |
629 | 636 |
630 /** | 637 /** |
| 638 * @override |
631 * @param {!WebInspector.Target} target | 639 * @param {!WebInspector.Target} target |
632 * @param {function(!WebInspector.RemoteObject)} callback | 640 * @param {function(!WebInspector.RemoteObject)} callback |
633 * @param {string} objectGroupName | 641 * @param {string} objectGroupName |
634 */ | 642 */ |
635 queryObjectContent: function(target, callback, objectGroupName) | 643 queryObjectContent: function(target, callback, objectGroupName) |
636 { | 644 { |
637 /** | 645 /** |
638 * @param {?Protocol.Error} error | 646 * @param {?Protocol.Error} error |
639 * @param {!RuntimeAgent.RemoteObject} object | 647 * @param {!RuntimeAgent.RemoteObject} object |
640 */ | 648 */ |
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
784 var sortFields = { | 792 var sortFields = { |
785 object: ["!edgeName", sortAscending, "retainedSize", false], | 793 object: ["!edgeName", sortAscending, "retainedSize", false], |
786 count: ["!edgeName", true, "retainedSize", false], | 794 count: ["!edgeName", true, "retainedSize", false], |
787 shallowSize: ["selfSize", sortAscending, "!edgeName", true], | 795 shallowSize: ["selfSize", sortAscending, "!edgeName", true], |
788 retainedSize: ["retainedSize", sortAscending, "!edgeName", true], | 796 retainedSize: ["retainedSize", sortAscending, "!edgeName", true], |
789 distance: ["distance", sortAscending, "_name", true] | 797 distance: ["distance", sortAscending, "_name", true] |
790 }[sortColumnId] || ["!edgeName", true, "retainedSize", false]; | 798 }[sortColumnId] || ["!edgeName", true, "retainedSize", false]; |
791 return WebInspector.HeapSnapshotGridNode.createComparator(sortFields); | 799 return WebInspector.HeapSnapshotGridNode.createComparator(sortFields); |
792 }, | 800 }, |
793 | 801 |
| 802 /** |
| 803 * @override |
| 804 */ |
794 _prefixObjectCell: function(div) | 805 _prefixObjectCell: function(div) |
795 { | 806 { |
796 var name = this._referenceName || "(empty)"; | 807 var name = this._referenceName || "(empty)"; |
797 var nameClass = "name"; | 808 var nameClass = "name"; |
798 switch (this._referenceType) { | 809 switch (this._referenceType) { |
799 case "context": | 810 case "context": |
800 nameClass = "object-value-number"; | 811 nameClass = "object-value-number"; |
801 break; | 812 break; |
802 case "internal": | 813 case "internal": |
803 case "hidden": | 814 case "hidden": |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
869 | 880 |
870 /** | 881 /** |
871 * @override | 882 * @override |
872 * @return {string} | 883 * @return {string} |
873 */ | 884 */ |
874 _edgeNodeSeparator: function() | 885 _edgeNodeSeparator: function() |
875 { | 886 { |
876 return " in "; | 887 return " in "; |
877 }, | 888 }, |
878 | 889 |
| 890 /** |
| 891 * @override |
| 892 */ |
879 expand: function() | 893 expand: function() |
880 { | 894 { |
881 this._expandRetainersChain(20); | 895 this._expandRetainersChain(20); |
882 }, | 896 }, |
883 | 897 |
884 /** | 898 /** |
885 * @param {number} maxExpandLevels | 899 * @param {number} maxExpandLevels |
886 */ | 900 */ |
887 _expandRetainersChain: function(maxExpandLevels) | 901 _expandRetainersChain: function(maxExpandLevels) |
888 { | 902 { |
889 /** | 903 /** |
890 * @this {!WebInspector.HeapSnapshotRetainingObjectNode} | 904 * @this {!WebInspector.HeapSnapshotRetainingObjectNode} |
891 */ | 905 */ |
892 function populateComplete() | 906 function populateComplete() |
893 { | 907 { |
894 this.removeEventListener(WebInspector.HeapSnapshotGridNode.Events.Po
pulateComplete, populateComplete, this); | 908 this.removeEventListener(WebInspector.HeapSnapshotGridNode.Events.Po
pulateComplete, populateComplete, this); |
895 this._expandRetainersChain(maxExpandLevels); | 909 this._expandRetainersChain(maxExpandLevels); |
896 } | 910 } |
897 | 911 |
898 if (!this._populated) { | 912 if (!this._populated) { |
899 this.addEventListener(WebInspector.HeapSnapshotGridNode.Events.Popul
ateComplete, populateComplete, this); | 913 this.addEventListener(WebInspector.HeapSnapshotGridNode.Events.Popul
ateComplete, populateComplete, this); |
900 this.populate(); | 914 this.populate(); |
901 return; | 915 return; |
902 } | 916 } |
903 WebInspector.HeapSnapshotGenericObjectNode.prototype.expand.call(this); | 917 WebInspector.HeapSnapshotObjectNode.prototype.expand.call(this); |
904 if (--maxExpandLevels > 0 && this.children.length > 0) { | 918 if (--maxExpandLevels > 0 && this.children.length > 0) { |
905 var retainer = this.children[0]; | 919 var retainer = this.children[0]; |
906 if (retainer._distance > 1) { | 920 if (retainer._distance > 1) { |
907 retainer._expandRetainersChain(maxExpandLevels); | 921 retainer._expandRetainersChain(maxExpandLevels); |
908 return; | 922 return; |
909 } | 923 } |
910 } | 924 } |
911 this._dataGrid.dispatchEventToListeners(WebInspector.HeapSnapshotRetainm
entDataGrid.Events.ExpandRetainersComplete); | 925 this._dataGrid.dispatchEventToListeners(WebInspector.HeapSnapshotRetainm
entDataGrid.Events.ExpandRetainersComplete); |
912 }, | 926 }, |
913 | 927 |
(...skipping 534 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1448 this.data = { | 1462 this.data = { |
1449 "liveCount": Number.withThousandsSeparator(data.liveCount), | 1463 "liveCount": Number.withThousandsSeparator(data.liveCount), |
1450 "count": Number.withThousandsSeparator(data.count), | 1464 "count": Number.withThousandsSeparator(data.count), |
1451 "liveSize": Number.withThousandsSeparator(data.liveSize), | 1465 "liveSize": Number.withThousandsSeparator(data.liveSize), |
1452 "size": Number.withThousandsSeparator(data.size), | 1466 "size": Number.withThousandsSeparator(data.size), |
1453 "name": data.name | 1467 "name": data.name |
1454 }; | 1468 }; |
1455 }; | 1469 }; |
1456 | 1470 |
1457 WebInspector.AllocationGridNode.prototype = { | 1471 WebInspector.AllocationGridNode.prototype = { |
| 1472 /** |
| 1473 * @override |
| 1474 */ |
1458 populate: function() | 1475 populate: function() |
1459 { | 1476 { |
1460 if (this._populated) | 1477 if (this._populated) |
1461 return; | 1478 return; |
1462 this._populated = true; | 1479 this._populated = true; |
1463 this._dataGrid.snapshot.allocationNodeCallers(this._allocationNode.id, d
idReceiveCallers.bind(this)); | 1480 this._dataGrid.snapshot.allocationNodeCallers(this._allocationNode.id, d
idReceiveCallers.bind(this)); |
1464 | 1481 |
1465 /** | 1482 /** |
1466 * @param {!WebInspector.HeapSnapshotCommon.AllocationNodeCallers} calle
rs | 1483 * @param {!WebInspector.HeapSnapshotCommon.AllocationNodeCallers} calle
rs |
1467 * @this {WebInspector.AllocationGridNode} | 1484 * @this {WebInspector.AllocationGridNode} |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1523 /** | 1540 /** |
1524 * @return {number} | 1541 * @return {number} |
1525 */ | 1542 */ |
1526 allocationNodeId: function() | 1543 allocationNodeId: function() |
1527 { | 1544 { |
1528 return this._allocationNode.id; | 1545 return this._allocationNode.id; |
1529 }, | 1546 }, |
1530 | 1547 |
1531 __proto__: WebInspector.HeapSnapshotGridNode.prototype | 1548 __proto__: WebInspector.HeapSnapshotGridNode.prototype |
1532 }; | 1549 }; |
OLD | NEW |