Changeset 106354 in webkit
- Timestamp:
- Jan 31, 2012 4:11:35 AM (12 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r106353 r106354 1 2012-01-31 Alexei Filippov <alexeif@chromium.org> 2 3 Web Inspector: show sizes in bytes instead of KB, MB in heap profiler. 4 https://bugs.webkit.org/show_bug.cgi?id=77199 5 6 Reviewed by Pavel Feldman. 7 8 * inspector/front-end/DetailedHeapshotGridNodes.js: 9 (WebInspector.HeapSnapshotGenericObjectNode.prototype.get data): 10 (WebInspector.HeapSnapshotInstanceNode.prototype._enhanceData): 11 (WebInspector.HeapSnapshotConstructorNode.prototype.get data): 12 (WebInspector.HeapSnapshotDiffNode.prototype.get data): 13 * inspector/front-end/UIUtils.js: 14 (Number.withThousandsSeparator): 15 1 16 2012-01-26 Hans Wennborg <hans@chromium.org> 2 17 -
trunk/Source/WebCore/inspector/front-end/DetailedHeapshotGridNodes.js
r105865 r106354 269 269 270 270 var view = this.dataGrid.snapshotView; 271 data["shallowSize"] = view.showShallowSizeAsPercent ? WebInspector.UIString("%.2f%%", this._shallowSizePercent) : Number. bytesToString(this._shallowSize);272 data["retainedSize"] = view.showRetainedSizeAsPercent ? WebInspector.UIString("%.2f%%", this._retainedSizePercent) : Number. bytesToString(this._retainedSize);271 data["shallowSize"] = view.showShallowSizeAsPercent ? WebInspector.UIString("%.2f%%", this._shallowSizePercent) : Number.withThousandsSeparator(this._shallowSize); 272 data["retainedSize"] = view.showRetainedSizeAsPercent ? WebInspector.UIString("%.2f%%", this._retainedSizePercent) : Number.withThousandsSeparator(this._retainedSize); 273 273 274 274 return this._enhanceData ? this._enhanceData(data) : data; … … 504 504 data["addedSize"] = ""; 505 505 data["removedCount"] = "\u2022"; 506 data["removedSize"] = Number. bytesToString(this._shallowSize);506 data["removedSize"] = Number.withThousandsSeparator(this._shallowSize); 507 507 } else { 508 508 data["addedCount"] = "\u2022"; 509 data["addedSize"] = Number. bytesToString(this._shallowSize);509 data["addedSize"] = Number.withThousandsSeparator(this._shallowSize); 510 510 data["removedCount"] = ""; 511 511 data["removedSize"] = ""; … … 571 571 var view = this.dataGrid.snapshotView; 572 572 data["count"] = view.showCountAsPercent ? WebInspector.UIString("%.2f%%", this._countPercent) : this._count; 573 data["shallowSize"] = view.showShallowSizeAsPercent ? WebInspector.UIString("%.2f%%", this._shallowSizePercent) : Number. bytesToString(this._shallowSize);574 data["retainedSize"] = "> " + (view.showRetainedSizeAsPercent ? WebInspector.UIString("%.2f%%", this._retainedSizePercent) : Number.bytesToString(this._retainedSize));573 data["shallowSize"] = view.showShallowSizeAsPercent ? WebInspector.UIString("%.2f%%", this._shallowSizePercent) : Number.withThousandsSeparator(this._shallowSize); 574 data["retainedSize"] = view.showRetainedSizeAsPercent ? "~" + WebInspector.UIString("%.2f%%", this._retainedSizePercent) : Number.withThousandsSeparator(this._retainedSize) + "+"; 575 575 return data; 576 576 }, … … 752 752 data["removedCount"] = this._removedCount; 753 753 data["countDelta"] = WebInspector.UIString("%s%d", this._signForDelta(this._countDelta), Math.abs(this._countDelta)); 754 data["addedSize"] = Number. bytesToString(this._addedSize);755 data["removedSize"] = Number. bytesToString(this._removedSize);756 data["sizeDelta"] = WebInspector.UIString("%s%s", this._signForDelta(this._sizeDelta), Number. bytesToString(Math.abs(this._sizeDelta)));754 data["addedSize"] = Number.withThousandsSeparator(this._addedSize); 755 data["removedSize"] = Number.withThousandsSeparator(this._removedSize); 756 data["sizeDelta"] = WebInspector.UIString("%s%s", this._signForDelta(this._sizeDelta), Number.withThousandsSeparator(Math.abs(this._sizeDelta))); 757 757 758 758 return data; -
trunk/Source/WebCore/inspector/front-end/UIUtils.js
r105488 r106354 443 443 } 444 444 445 Number.withThousandsSeparator = function(num) 446 { 447 var str = num + ""; 448 var re = /(\d+)(\d{3})/; 449 while (str.match(re)) 450 str = str.replace(re, "$1,$2"); 451 return str; 452 } 453 445 454 WebInspector._missingLocalizedStrings = {}; 446 455
Note: See TracChangeset
for help on using the changeset viewer.