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 402 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
413 WebInspector.PleaseWaitMessage.prototype.show(this.element, this.searchC
ancelled.bind(this, pathsCount)); | 413 WebInspector.PleaseWaitMessage.prototype.show(this.element, this.searchC
ancelled.bind(this, pathsCount)); |
414 | 414 |
415 function pathFound(result) | 415 function pathFound(result) |
416 { | 416 { |
417 if (result === null) { | 417 if (result === null) { |
418 WebInspector.PleaseWaitMessage.prototype.hide(); | 418 WebInspector.PleaseWaitMessage.prototype.hide(); |
419 if (!this.children.length) | 419 if (!this.children.length) |
420 this.appendChild(new WebInspector.DataGridNode({path:WebInsp
ector.UIString("Can't find any paths."), len:""}, false)); | 420 this.appendChild(new WebInspector.DataGridNode({path:WebInsp
ector.UIString("Can't find any paths."), len:""}, false)); |
421 return; | 421 return; |
422 } else if (result !== false) { | 422 } else if (result !== false) { |
| 423 if (WebInspector.HeapSnapshotGenericObjectNode.prototype.isDOMWi
ndow(result.path)) |
| 424 result.path = WebInspector.HeapSnapshotGenericObjectNode.pro
totype.shortenWindowURL(result.path, true); |
423 if (this._prefix) | 425 if (this._prefix) |
424 result.path = this._prefix + result.path; | 426 result.path = this._prefix + result.path; |
425 var node = new WebInspector.DataGridNode(result, false); | 427 var node = new WebInspector.DataGridNode(result, false); |
426 node.route = result.route; | 428 node.route = result.route; |
427 this.appendChild(node); | 429 this.appendChild(node); |
428 ++this._counter; | 430 ++this._counter; |
429 } | 431 } |
430 setTimeout(startSearching.bind(this), 0); | 432 setTimeout(startSearching.bind(this), 0); |
431 } | 433 } |
432 | 434 |
(...skipping 557 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
990 _changeRetainingPathsRoot: function(event) | 992 _changeRetainingPathsRoot: function(event) |
991 { | 993 { |
992 if (!event) | 994 if (!event) |
993 return; | 995 return; |
994 this.retainmentDataGrid.refresh(); | 996 this.retainmentDataGrid.refresh(); |
995 }, | 997 }, |
996 | 998 |
997 _getHoverAnchor: function(target) | 999 _getHoverAnchor: function(target) |
998 { | 1000 { |
999 var span = target.enclosingNodeOrSelfWithNodeName("span"); | 1001 var span = target.enclosingNodeOrSelfWithNodeName("span"); |
1000 if (!span || !span.hasStyleClass("console-formatted-string")) | 1002 if (!span) |
1001 return; | 1003 return; |
1002 var row = target.enclosingNodeOrSelfWithNodeName("tr"); | 1004 var row = target.enclosingNodeOrSelfWithNodeName("tr"); |
1003 if (!row) | 1005 if (!row) |
1004 return; | 1006 return; |
1005 var gridNode = row._dataGridNode; | 1007 var gridNode = row._dataGridNode; |
1006 if (!gridNode.snapshotNodeIndex) | 1008 if (!gridNode.hasHoverMessage) |
1007 return; | 1009 return; |
1008 span.snapshotNodeIndex = gridNode.snapshotNodeIndex; | 1010 span.node = gridNode; |
1009 return span; | 1011 return span; |
1010 }, | 1012 }, |
1011 | 1013 |
1012 get isTracingToWindowObjects() | 1014 get isTracingToWindowObjects() |
1013 { | 1015 { |
1014 return this.retainingPathsRoot.selectedIndex === 1; | 1016 return this.retainingPathsRoot.selectedIndex === 1; |
1015 }, | 1017 }, |
1016 | 1018 |
1017 get _isShowingAsPercent() | 1019 get _isShowingAsPercent() |
1018 { | 1020 { |
1019 return this.showCountAsPercent && this.showShallowSizeAsPercent && this.
showRetainedSizeAsPercent; | 1021 return this.showCountAsPercent && this.showShallowSizeAsPercent && this.
showRetainedSizeAsPercent; |
1020 }, | 1022 }, |
1021 | 1023 |
1022 _percentClicked: function(event) | 1024 _percentClicked: function(event) |
1023 { | 1025 { |
1024 var currentState = this._isShowingAsPercent; | 1026 var currentState = this._isShowingAsPercent; |
1025 this.showCountAsPercent = !currentState; | 1027 this.showCountAsPercent = !currentState; |
1026 this.showShallowSizeAsPercent = !currentState; | 1028 this.showShallowSizeAsPercent = !currentState; |
1027 this.showRetainedSizeAsPercent = !currentState; | 1029 this.showRetainedSizeAsPercent = !currentState; |
1028 this.refreshShowAsPercents(); | 1030 this.refreshShowAsPercents(); |
1029 }, | 1031 }, |
1030 | 1032 |
1031 _showStringContentPopup: function(span) | 1033 _showStringContentPopup: function(span) |
1032 { | 1034 { |
1033 var stringContentElement = document.createElement("span"); | 1035 var stringContentElement = document.createElement("span"); |
1034 stringContentElement.className = "monospace console-formatted-string"; | 1036 stringContentElement.className = "monospace"; |
1035 stringContentElement.style.whiteSpace = "pre"; | 1037 stringContentElement.style.whiteSpace = "pre"; |
1036 | 1038 |
1037 var popover = new WebInspector.Popover(stringContentElement); | 1039 var popover = new WebInspector.Popover(stringContentElement); |
1038 function displayString(names) | 1040 function displayString(name, className) |
1039 { | 1041 { |
1040 if (names.length > 0) { | 1042 stringContentElement.textContent = name; |
1041 stringContentElement.textContent = "\"" + names[0] + "\"";
| 1043 stringContentElement.className += " " + className; |
1042 popover.show(span); | 1044 popover.show(span); |
1043 } | |
1044 } | 1045 } |
1045 this.profileWrapper.nodeFieldValuesByIndex("name", [span.snapshotNodeInd
ex], displayString); | 1046 span.node.hoverMessage(displayString); |
1046 return popover; | 1047 return popover; |
1047 }, | 1048 }, |
1048 | 1049 |
1049 _helpClicked: function(event) | 1050 _helpClicked: function(event) |
1050 { | 1051 { |
1051 if (!this.helpPopover) { | 1052 if (!this.helpPopover) { |
1052 var refTypes = ["a:", "console-formatted-name", WebInspector.UIStrin
g("property"), | 1053 var refTypes = ["a:", "console-formatted-name", WebInspector.UIStrin
g("property"), |
1053 "0:", "console-formatted-name", WebInspector.UIStrin
g("element"), | 1054 "0:", "console-formatted-name", WebInspector.UIStrin
g("element"), |
1054 "a:", "console-formatted-number", WebInspector.UIStr
ing("context var"), | 1055 "a:", "console-formatted-number", WebInspector.UIStr
ing("context var"), |
1055 "a:", "console-formatted-null", WebInspector.UIStrin
g("system prop")]; | 1056 "a:", "console-formatted-null", WebInspector.UIStrin
g("system prop")]; |
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1205 return new WebInspector.ProfileSidebarTreeElement(profile, WebInspector.
UIString("Snapshot %d"), "heap-snapshot-sidebar-tree-item"); | 1206 return new WebInspector.ProfileSidebarTreeElement(profile, WebInspector.
UIString("Snapshot %d"), "heap-snapshot-sidebar-tree-item"); |
1206 }, | 1207 }, |
1207 | 1208 |
1208 createView: function(profile) | 1209 createView: function(profile) |
1209 { | 1210 { |
1210 return new WebInspector.DetailedHeapshotView(WebInspector.panels.profile
s, profile); | 1211 return new WebInspector.DetailedHeapshotView(WebInspector.panels.profile
s, profile); |
1211 } | 1212 } |
1212 } | 1213 } |
1213 | 1214 |
1214 WebInspector.DetailedHeapshotProfileType.prototype.__proto__ = WebInspector.Prof
ileType.prototype; | 1215 WebInspector.DetailedHeapshotProfileType.prototype.__proto__ = WebInspector.Prof
ileType.prototype; |
OLD | NEW |