| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2012 Google Inc. All rights reserved. |
| 3 * Copyright (C) 2012 Intel Inc. All rights reserved. | 3 * Copyright (C) 2012 Intel Inc. All rights reserved. |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions are | 6 * modification, are permitted provided that the following conditions are |
| 7 * met: | 7 * met: |
| 8 * | 8 * |
| 9 * * Redistributions of source code must retain the above copyright | 9 * * Redistributions of source code must retain the above copyright |
| 10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
| (...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 116 Events: "Events", | 116 Events: "Events", |
| 117 Frames: "Frames" | 117 Frames: "Frames" |
| 118 }; | 118 }; |
| 119 | 119 |
| 120 /** | 120 /** |
| 121 * @enum {string} | 121 * @enum {string} |
| 122 */ | 122 */ |
| 123 WebInspector.TimelinePanel.DetailsTab = { | 123 WebInspector.TimelinePanel.DetailsTab = { |
| 124 Details: "Details", | 124 Details: "Details", |
| 125 BottomUpTree: "BottomUpTree", | 125 BottomUpTree: "BottomUpTree", |
| 126 BottomUpChart: "BottomUpChart", | |
| 127 PaintProfiler: "PaintProfiler", | 126 PaintProfiler: "PaintProfiler", |
| 128 LayerViewer: "LayerViewer" | 127 LayerViewer: "LayerViewer" |
| 129 }; | 128 }; |
| 130 | 129 |
| 131 // Define row and header height, should be in sync with styles for timeline grap
hs. | 130 // Define row and header height, should be in sync with styles for timeline grap
hs. |
| 132 WebInspector.TimelinePanel.rowHeight = 18; | 131 WebInspector.TimelinePanel.rowHeight = 18; |
| 133 WebInspector.TimelinePanel.headerHeight = 20; | 132 WebInspector.TimelinePanel.headerHeight = 20; |
| 134 | 133 |
| 135 WebInspector.TimelinePanel._aggregatedStatsKey = Symbol("aggregatedStats"); | 134 WebInspector.TimelinePanel._aggregatedStatsKey = Symbol("aggregatedStats"); |
| 136 | 135 |
| (...skipping 1209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1346 this._defaultDetailsWidget = new WebInspector.VBox(); | 1345 this._defaultDetailsWidget = new WebInspector.VBox(); |
| 1347 this._defaultDetailsWidget.element.classList.add("timeline-details-view"); | 1346 this._defaultDetailsWidget.element.classList.add("timeline-details-view"); |
| 1348 this._defaultDetailsContentElement = this._defaultDetailsWidget.element.crea
teChild("div", "timeline-details-view-body vbox"); | 1347 this._defaultDetailsContentElement = this._defaultDetailsWidget.element.crea
teChild("div", "timeline-details-view-body vbox"); |
| 1349 this.appendTab(WebInspector.TimelinePanel.DetailsTab.Details, WebInspector.U
IString("Summary"), this._defaultDetailsWidget); | 1348 this.appendTab(WebInspector.TimelinePanel.DetailsTab.Details, WebInspector.U
IString("Summary"), this._defaultDetailsWidget); |
| 1350 this.setPreferredTab(WebInspector.TimelinePanel.DetailsTab.Details); | 1349 this.setPreferredTab(WebInspector.TimelinePanel.DetailsTab.Details); |
| 1351 | 1350 |
| 1352 if (Runtime.experiments.isEnabled("timelineTreeView")) { | 1351 if (Runtime.experiments.isEnabled("timelineTreeView")) { |
| 1353 this._heavyTreeView = new WebInspector.TimelineTreeView(timelineModel); | 1352 this._heavyTreeView = new WebInspector.TimelineTreeView(timelineModel); |
| 1354 this.appendTab(WebInspector.TimelinePanel.DetailsTab.BottomUpTree, WebIn
spector.UIString("Costly Functions"), this._heavyTreeView); | 1353 this.appendTab(WebInspector.TimelinePanel.DetailsTab.BottomUpTree, WebIn
spector.UIString("Costly Functions"), this._heavyTreeView); |
| 1355 } | 1354 } |
| 1356 if (Runtime.experiments.isEnabled("timelineDetailsChart")) { | |
| 1357 this._heavyChartView = new WebInspector.TimelineDetailsView.BottomUpChar
tView(timelineModel); | |
| 1358 this.appendTab(WebInspector.TimelinePanel.DetailsTab.BottomUpChart, WebI
nspector.UIString("Costly Functions Chart"), this._heavyChartView); | |
| 1359 } | |
| 1360 | 1355 |
| 1361 this._staticTabs = [ | 1356 this._staticTabs = new Set([ |
| 1362 WebInspector.TimelinePanel.DetailsTab.Details, | 1357 WebInspector.TimelinePanel.DetailsTab.Details, |
| 1363 WebInspector.TimelinePanel.DetailsTab.BottomUpTree, | 1358 WebInspector.TimelinePanel.DetailsTab.BottomUpTree |
| 1364 WebInspector.TimelinePanel.DetailsTab.BottomUpChart | 1359 ]); |
| 1365 ]; | |
| 1366 | 1360 |
| 1367 this.addEventListener(WebInspector.TabbedPane.EventTypes.TabSelected, this._
tabSelected, this); | 1361 this.addEventListener(WebInspector.TabbedPane.EventTypes.TabSelected, this._
tabSelected, this); |
| 1368 } | 1362 } |
| 1369 | 1363 |
| 1370 WebInspector.TimelineDetailsView.prototype = { | 1364 WebInspector.TimelineDetailsView.prototype = { |
| 1371 /** | 1365 /** |
| 1372 * @param {!Node} node | 1366 * @param {!Node} node |
| 1373 */ | 1367 */ |
| 1374 setContent: function(node) | 1368 setContent: function(node) |
| 1375 { | 1369 { |
| 1376 var allTabs = this.allTabs(); | 1370 var allTabs = this.allTabs(); |
| 1377 for (var i = 0; i < allTabs.length; ++i) { | 1371 for (var i = 0; i < allTabs.length; ++i) { |
| 1378 var tabId = allTabs[i].id; | 1372 var tabId = allTabs[i].id; |
| 1379 if (this._staticTabs.indexOf(tabId) !== -1) | 1373 if (this._staticTabs.has(tabId)) |
| 1380 this.closeTab(tabId); | 1374 this.closeTab(tabId); |
| 1381 } | 1375 } |
| 1382 this._defaultDetailsContentElement.removeChildren(); | 1376 this._defaultDetailsContentElement.removeChildren(); |
| 1383 this._defaultDetailsContentElement.appendChild(node); | 1377 this._defaultDetailsContentElement.appendChild(node); |
| 1384 }, | 1378 }, |
| 1385 | 1379 |
| 1386 /** | 1380 /** |
| 1387 * @param {!WebInspector.TimelineSelection} selection | 1381 * @param {!WebInspector.TimelineSelection} selection |
| 1388 */ | 1382 */ |
| 1389 updateContents: function(selection) | 1383 updateContents: function(selection) |
| 1390 { | 1384 { |
| 1391 this._selection = selection; | 1385 this._selection = selection; |
| 1392 if (this.selectedTabId === WebInspector.TimelinePanel.DetailsTab.BottomU
pChart && this._heavyChartView) | |
| 1393 this._heavyChartView.updateContents(selection); | |
| 1394 if (this.selectedTabId === WebInspector.TimelinePanel.DetailsTab.BottomU
pTree && this._heavyTreeView) | 1386 if (this.selectedTabId === WebInspector.TimelinePanel.DetailsTab.BottomU
pTree && this._heavyTreeView) |
| 1395 this._heavyTreeView.updateContents(selection); | 1387 this._heavyTreeView.updateContents(selection); |
| 1396 }, | 1388 }, |
| 1397 | 1389 |
| 1398 /** | 1390 /** |
| 1399 * @override | 1391 * @override |
| 1400 * @param {string} id | 1392 * @param {string} id |
| 1401 * @param {string} tabTitle | 1393 * @param {string} tabTitle |
| 1402 * @param {!WebInspector.Widget} view | 1394 * @param {!WebInspector.Widget} view |
| 1403 * @param {string=} tabTooltip | 1395 * @param {string=} tabTooltip |
| (...skipping 24 matching lines...) Expand all Loading... |
| 1428 return; | 1420 return; |
| 1429 this.setPreferredTab(event.data.tabId); | 1421 this.setPreferredTab(event.data.tabId); |
| 1430 this.updateContents(this._selection); | 1422 this.updateContents(this._selection); |
| 1431 }, | 1423 }, |
| 1432 | 1424 |
| 1433 __proto__: WebInspector.TabbedPane.prototype | 1425 __proto__: WebInspector.TabbedPane.prototype |
| 1434 } | 1426 } |
| 1435 | 1427 |
| 1436 /** | 1428 /** |
| 1437 * @constructor | 1429 * @constructor |
| 1438 * @implements {WebInspector.TimelineModeViewDelegate} | |
| 1439 * @implements {WebInspector.FlameChartDelegate} | |
| 1440 * @extends {WebInspector.VBox} | |
| 1441 */ | |
| 1442 WebInspector.TimelineDetailsView.BottomUpChartView = function(model) { | |
| 1443 WebInspector.VBox.call(this); | |
| 1444 this._model = model; | |
| 1445 } | |
| 1446 | |
| 1447 WebInspector.TimelineDetailsView.BottomUpChartView.prototype = { | |
| 1448 _init: function() | |
| 1449 { | |
| 1450 if (this._heavyChart) | |
| 1451 return; | |
| 1452 this._dataProvider = new WebInspector.TimelineFlameChartBottomUpDataProv
ider(this._model); | |
| 1453 this._heavyChart = new WebInspector.FlameChart(this._dataProvider, this,
true); | |
| 1454 this._heavyChart.show(this.element); | |
| 1455 }, | |
| 1456 | |
| 1457 /** | |
| 1458 * @param {!WebInspector.TimelineSelection} selection | |
| 1459 */ | |
| 1460 updateContents: function(selection) | |
| 1461 { | |
| 1462 this._init(); | |
| 1463 this._heavyChart.reset(); | |
| 1464 this._dataProvider.setWindowTimes(selection._startTime, selection._endTi
me); | |
| 1465 this._dataProvider.timelineData(); | |
| 1466 this._heavyChart.setWindowTimes(0, this._dataProvider.totalTime()); | |
| 1467 }, | |
| 1468 | |
| 1469 /** | |
| 1470 * @override | |
| 1471 * @param {number} startTime | |
| 1472 * @param {number} endTime | |
| 1473 */ | |
| 1474 requestWindowTimes: function(startTime, endTime) | |
| 1475 { | |
| 1476 this._heavyChart.setWindowTimes(startTime, endTime); | |
| 1477 }, | |
| 1478 | |
| 1479 /** | |
| 1480 * @override | |
| 1481 * @param {?WebInspector.TimelineSelection} selection | |
| 1482 * @param {!WebInspector.TimelinePanel.DetailsTab=} preferredTab | |
| 1483 */ | |
| 1484 select: function(selection, preferredTab) {}, | |
| 1485 | |
| 1486 /** | |
| 1487 * @override | |
| 1488 * @param {!WebInspector.TimelineModel.Record} record | |
| 1489 */ | |
| 1490 showNestedRecordDetails: function(record) {}, | |
| 1491 | |
| 1492 /** | |
| 1493 * @override | |
| 1494 * @param {!Node} node | |
| 1495 */ | |
| 1496 showInDetails: function(node) {}, | |
| 1497 | |
| 1498 /** | |
| 1499 * @override | |
| 1500 * @param {number} startTime | |
| 1501 * @param {number} endTime | |
| 1502 */ | |
| 1503 updateRangeSelection: function(startTime, endTime) | |
| 1504 { | |
| 1505 }, | |
| 1506 | |
| 1507 __proto__: WebInspector.VBox.prototype | |
| 1508 } | |
| 1509 | |
| 1510 | |
| 1511 /** | |
| 1512 * @constructor | |
| 1513 * @param {!WebInspector.TimelineSelection.Type} type | 1430 * @param {!WebInspector.TimelineSelection.Type} type |
| 1514 * @param {number} startTime | 1431 * @param {number} startTime |
| 1515 * @param {number} endTime | 1432 * @param {number} endTime |
| 1516 * @param {!Object=} object | 1433 * @param {!Object=} object |
| 1517 */ | 1434 */ |
| 1518 WebInspector.TimelineSelection = function(type, startTime, endTime, object) | 1435 WebInspector.TimelineSelection = function(type, startTime, endTime, object) |
| 1519 { | 1436 { |
| 1520 this._type = type; | 1437 this._type = type; |
| 1521 this._startTime = startTime; | 1438 this._startTime = startTime; |
| 1522 this._endTime = endTime; | 1439 this._endTime = endTime; |
| (...skipping 354 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1877 /** | 1794 /** |
| 1878 * @override | 1795 * @override |
| 1879 * @param {string} value | 1796 * @param {string} value |
| 1880 */ | 1797 */ |
| 1881 handleQueryParam: function(value) | 1798 handleQueryParam: function(value) |
| 1882 { | 1799 { |
| 1883 WebInspector.TimelinePanel.show(); | 1800 WebInspector.TimelinePanel.show(); |
| 1884 WebInspector.TimelinePanel.instance()._loadFromURL(value); | 1801 WebInspector.TimelinePanel.instance()._loadFromURL(value); |
| 1885 } | 1802 } |
| 1886 } | 1803 } |
| OLD | NEW |