OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 var g_browserBridge; | 5 var g_browserBridge; |
6 var g_mainView; | 6 var g_mainView; |
7 | 7 |
8 // TODO(eroman): The handling of "max" across snapshots is not correct. | 8 // TODO(eroman): The handling of "max" across snapshots is not correct. |
9 // For starters the browser needs to be aware to generate new maximums. | 9 // For starters the browser needs to be aware to generate new maximums. |
10 // Secondly, we need to take into account the "max" of intermediary snapshots, | 10 // Secondly, we need to take into account the "max" of intermediary snapshots, |
(...skipping 1398 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1409 this.groupedData_[k].rows.sort(sortingFunc); | 1409 this.groupedData_[k].rows.sort(sortingFunc); |
1410 | 1410 |
1411 // Every cached data dependency is now up to date, all that is left is | 1411 // Every cached data dependency is now up to date, all that is left is |
1412 // to actually draw the result. | 1412 // to actually draw the result. |
1413 this.redrawData_(); | 1413 this.redrawData_(); |
1414 }, | 1414 }, |
1415 | 1415 |
1416 getVisibleColumnKeys_: function() { | 1416 getVisibleColumnKeys_: function() { |
1417 // Figure out what columns to include, based on the selected checkboxes. | 1417 // Figure out what columns to include, based on the selected checkboxes. |
1418 var columns = this.getSelectionColumns_(); | 1418 var columns = this.getSelectionColumns_(); |
| 1419 columns = columns.slice(0); |
1419 | 1420 |
1420 // Eliminate columns which we are merging on. | 1421 // Eliminate columns which we are merging on. |
1421 deleteValuesFromArray(columns, this.getMergeColumns_()); | 1422 deleteValuesFromArray(columns, this.getMergeColumns_()); |
1422 | 1423 |
1423 // Eliminate columns which we are grouped on. | 1424 // Eliminate columns which we are grouped on. |
1424 if (this.sortedGroupKeys_.length > 0) { | 1425 if (this.sortedGroupKeys_.length > 0) { |
1425 // The grouping will be the the same for each so just pick the first. | 1426 // The grouping will be the the same for each so just pick the first. |
1426 var randomGroupKey = this.groupedData_[this.sortedGroupKeys_[0]].key; | 1427 var randomGroupKey = this.groupedData_[this.sortedGroupKeys_[0]].key; |
1427 | 1428 |
1428 // The grouped properties are going to be the same for each row in our, | 1429 // The grouped properties are going to be the same for each row in our, |
1429 // table, so avoid drawing them in our table! | 1430 // table, so avoid drawing them in our table! |
1430 var keysToExclude = [] | 1431 var keysToExclude = [] |
1431 | 1432 |
1432 for (var i = 0; i < randomGroupKey.length; ++i) | 1433 for (var i = 0; i < randomGroupKey.length; ++i) |
1433 keysToExclude.push(randomGroupKey[i].key); | 1434 keysToExclude.push(randomGroupKey[i].key); |
1434 columns = columns.slice(0); | |
1435 deleteValuesFromArray(columns, keysToExclude); | 1435 deleteValuesFromArray(columns, keysToExclude); |
1436 } | 1436 } |
1437 | 1437 |
| 1438 // If we are currently showing a "diff", hide the max columns, since we |
| 1439 // are not populating it correctly. See the TODO at the top of this file. |
| 1440 if (this.getSelectedSnapshotIndexes_().length > 1) |
| 1441 deleteValuesFromArray(columns, [KEY_MAX_RUN_TIME, KEY_MAX_QUEUE_TIME]); |
| 1442 |
1438 return columns; | 1443 return columns; |
1439 }, | 1444 }, |
1440 | 1445 |
1441 redrawData_: function() { | 1446 redrawData_: function() { |
1442 // Clear the results div, sine we may be overwriting older data. | 1447 // Clear the results div, sine we may be overwriting older data. |
1443 var parent = $(RESULTS_DIV_ID); | 1448 var parent = $(RESULTS_DIV_ID); |
1444 parent.innerHTML = ''; | 1449 parent.innerHTML = ''; |
1445 | 1450 |
1446 var columns = this.getVisibleColumnKeys_(); | 1451 var columns = this.getVisibleColumnKeys_(); |
1447 | 1452 |
(...skipping 600 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2048 groupKey.push(entry); | 2053 groupKey.push(entry); |
2049 } | 2054 } |
2050 | 2055 |
2051 return JSON.stringify(groupKey); | 2056 return JSON.stringify(groupKey); |
2052 }; | 2057 }; |
2053 }, | 2058 }, |
2054 }; | 2059 }; |
2055 | 2060 |
2056 return MainView; | 2061 return MainView; |
2057 })(); | 2062 })(); |
OLD | NEW |