Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(275)

Unified Diff: Source/WebCore/inspector/front-end/HeapSnapshotView.js

Issue 6405002: Merge 76514 - 2011-01-21 Mikhail Naganov <mnaganov@chromium.org>... (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/648/
Patch Set: Created 9 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/WebCore/inspector/front-end/HeapSnapshotView.js
===================================================================
--- Source/WebCore/inspector/front-end/HeapSnapshotView.js (revision 76932)
+++ Source/WebCore/inspector/front-end/HeapSnapshotView.js (working copy)
@@ -601,10 +601,10 @@
var sortColumnIdentifier = this.dataGrid.sortColumnIdentifier;
var sortProperty = {
cons: ["constructorName", null],
- count: ["count", null],
- size: ["size", "count"],
- countDelta: this.showCountDeltaAsPercent ? ["countDeltaPercent", null] : ["countDelta", null],
- sizeDelta: this.showSizeDeltaAsPercent ? ["sizeDeltaPercent", "countDeltaPercent"] : ["sizeDelta", "sizeDeltaPercent"]
+ count: ["count", "constructorName"],
+ size: ["size", "constructorName"],
+ countDelta: [this.showCountDeltaAsPercent ? "countDeltaPercent" : "countDelta", "constructorName"],
+ sizeDelta: [this.showSizeDeltaAsPercent ? "sizeDeltaPercent" : "sizeDelta", "constructorName"]
}[sortColumnIdentifier];
this.snapshotDataGridList.sort(WebInspector.HeapSnapshotDataGridList.propertyComparator(sortProperty[0], sortProperty[1], sortAscending));
@@ -1046,10 +1046,17 @@
if (!comparator) {
comparator = function(lhs, rhs) {
var l = lhs[property], r = rhs[property];
- if ((l === null || r === null) && property2 !== null)
- l = lhs[property2], r = rhs[property2];
- var result = l < r ? -1 : (l > r ? 1 : 0);
- return isAscending ? result : -result;
+ var result = 0;
+ if (l !== null && r !== null) {
+ result = l < r ? -1 : (l > r ? 1 : 0);
+ }
+ if (result !== 0 || property2 === null) {
+ return isAscending ? result : -result;
+ } else {
+ l = lhs[property2];
+ r = rhs[property2];
+ return l < r ? -1 : (l > r ? 1 : 0);
+ }
};
this.propertyComparators[(isAscending ? 1 : 0)][propertyHash] = comparator;
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698