| 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 | 116 |
| 117 this._detailsSplitWidget.show(timelinePane.element); | 117 this._detailsSplitWidget.show(timelinePane.element); |
| 118 this._detailsSplitWidget.hideSidebar(); | 118 this._detailsSplitWidget.hideSidebar(); |
| 119 WebInspector.targetManager.addEventListener(WebInspector.TargetManager.Event
s.SuspendStateChanged, this._onSuspendStateChanged, this); | 119 WebInspector.targetManager.addEventListener(WebInspector.TargetManager.Event
s.SuspendStateChanged, this._onSuspendStateChanged, this); |
| 120 this._showRecordingHelpMessage(); | 120 this._showRecordingHelpMessage(); |
| 121 | 121 |
| 122 /** @type {!WebInspector.TracingModel.Event}|undefined */ | 122 /** @type {!WebInspector.TracingModel.Event}|undefined */ |
| 123 this._selectedSearchResult; | 123 this._selectedSearchResult; |
| 124 /** @type {!Array<!WebInspector.TracingModel.Event>}|undefined */ | 124 /** @type {!Array<!WebInspector.TracingModel.Event>}|undefined */ |
| 125 this._searchResults; | 125 this._searchResults; |
| 126 } | 126 }; |
| 127 | 127 |
| 128 /** | 128 /** |
| 129 * @enum {string} | 129 * @enum {string} |
| 130 */ | 130 */ |
| 131 WebInspector.TimelinePanel.Perspectives = { | 131 WebInspector.TimelinePanel.Perspectives = { |
| 132 Load: "Load", | 132 Load: "Load", |
| 133 Responsiveness: "Responsiveness", | 133 Responsiveness: "Responsiveness", |
| 134 Custom: "Custom" | 134 Custom: "Custom" |
| 135 } | 135 }; |
| 136 | 136 |
| 137 /** | 137 /** |
| 138 * @enum {string} | 138 * @enum {string} |
| 139 */ | 139 */ |
| 140 WebInspector.TimelinePanel.DetailsTab = { | 140 WebInspector.TimelinePanel.DetailsTab = { |
| 141 Details: "Details", | 141 Details: "Details", |
| 142 Events: "Events", | 142 Events: "Events", |
| 143 CallTree: "CallTree", | 143 CallTree: "CallTree", |
| 144 BottomUp: "BottomUp", | 144 BottomUp: "BottomUp", |
| 145 PaintProfiler: "PaintProfiler", | 145 PaintProfiler: "PaintProfiler", |
| 146 LayerViewer: "LayerViewer" | 146 LayerViewer: "LayerViewer" |
| 147 } | 147 }; |
| 148 | 148 |
| 149 /** | 149 /** |
| 150 * @enum {symbol} | 150 * @enum {symbol} |
| 151 */ | 151 */ |
| 152 WebInspector.TimelinePanel.State = { | 152 WebInspector.TimelinePanel.State = { |
| 153 Idle: Symbol("Idle"), | 153 Idle: Symbol("Idle"), |
| 154 StartPending: Symbol("StartPending"), | 154 StartPending: Symbol("StartPending"), |
| 155 Recording: Symbol("Recording"), | 155 Recording: Symbol("Recording"), |
| 156 StopPending: Symbol("StopPending"), | 156 StopPending: Symbol("StopPending"), |
| 157 Loading: Symbol("Loading") | 157 Loading: Symbol("Loading") |
| 158 } | 158 }; |
| 159 | 159 |
| 160 // Define row and header height, should be in sync with styles for timeline grap
hs. | 160 // Define row and header height, should be in sync with styles for timeline grap
hs. |
| 161 WebInspector.TimelinePanel.rowHeight = 18; | 161 WebInspector.TimelinePanel.rowHeight = 18; |
| 162 WebInspector.TimelinePanel.headerHeight = 20; | 162 WebInspector.TimelinePanel.headerHeight = 20; |
| 163 | 163 |
| 164 WebInspector.TimelinePanel.prototype = { | 164 WebInspector.TimelinePanel.prototype = { |
| 165 /** | 165 /** |
| 166 * @override | 166 * @override |
| 167 * @return {?WebInspector.SearchableView} | 167 * @return {?WebInspector.SearchableView} |
| 168 */ | 168 */ |
| (...skipping 527 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 696 | 696 |
| 697 /** | 697 /** |
| 698 * @override | 698 * @override |
| 699 */ | 699 */ |
| 700 recordingStarted: function() | 700 recordingStarted: function() |
| 701 { | 701 { |
| 702 this._clear(); | 702 this._clear(); |
| 703 this._setState(WebInspector.TimelinePanel.State.Recording); | 703 this._setState(WebInspector.TimelinePanel.State.Recording); |
| 704 this._showRecordingStarted(); | 704 this._showRecordingStarted(); |
| 705 this._statusPane.updateStatus(WebInspector.UIString("Recording\u2026")); | 705 this._statusPane.updateStatus(WebInspector.UIString("Recording\u2026")); |
| 706 this._statusPane.updateProgressBar(WebInspector.UIString("Buffer usage")
, 0) | 706 this._statusPane.updateProgressBar(WebInspector.UIString("Buffer usage")
, 0); |
| 707 this._statusPane.startTimer(); | 707 this._statusPane.startTimer(); |
| 708 this._hideRecordingHelpMessage(); | 708 this._hideRecordingHelpMessage(); |
| 709 }, | 709 }, |
| 710 | 710 |
| 711 /** | 711 /** |
| 712 * @override | 712 * @override |
| 713 * @param {number} usage | 713 * @param {number} usage |
| 714 */ | 714 */ |
| 715 recordingProgress: function(usage) | 715 recordingProgress: function(usage) |
| 716 { | 716 { |
| (...skipping 555 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1272 leftTime = this._tracingModel.minimumRecordTime(); | 1272 leftTime = this._tracingModel.minimumRecordTime(); |
| 1273 rightTime = this._tracingModel.maximumRecordTime(); | 1273 rightTime = this._tracingModel.maximumRecordTime(); |
| 1274 } else { | 1274 } else { |
| 1275 leftTime = Math.max(leftTime - 0.05 * span, this._tracingModel.minim
umRecordTime()); | 1275 leftTime = Math.max(leftTime - 0.05 * span, this._tracingModel.minim
umRecordTime()); |
| 1276 rightTime = Math.min(rightTime + 0.05 * span, this._tracingModel.max
imumRecordTime()); | 1276 rightTime = Math.min(rightTime + 0.05 * span, this._tracingModel.max
imumRecordTime()); |
| 1277 } | 1277 } |
| 1278 this.requestWindowTimes(leftTime, rightTime); | 1278 this.requestWindowTimes(leftTime, rightTime); |
| 1279 }, | 1279 }, |
| 1280 | 1280 |
| 1281 __proto__: WebInspector.Panel.prototype | 1281 __proto__: WebInspector.Panel.prototype |
| 1282 } | 1282 }; |
| 1283 | 1283 |
| 1284 /** | 1284 /** |
| 1285 * @interface | 1285 * @interface |
| 1286 */ | 1286 */ |
| 1287 WebInspector.TimelineLifecycleDelegate = function() | 1287 WebInspector.TimelineLifecycleDelegate = function() |
| 1288 { | 1288 { |
| 1289 } | 1289 }; |
| 1290 | 1290 |
| 1291 WebInspector.TimelineLifecycleDelegate.prototype = { | 1291 WebInspector.TimelineLifecycleDelegate.prototype = { |
| 1292 recordingStarted: function() {}, | 1292 recordingStarted: function() {}, |
| 1293 | 1293 |
| 1294 /** | 1294 /** |
| 1295 * @param {number} usage | 1295 * @param {number} usage |
| 1296 */ | 1296 */ |
| 1297 recordingProgress: function(usage) {}, | 1297 recordingProgress: function(usage) {}, |
| 1298 | 1298 |
| 1299 loadingStarted: function() {}, | 1299 loadingStarted: function() {}, |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1338 | 1338 |
| 1339 var callTreeView = new WebInspector.CallTreeTimelineTreeView(timelineModel,
filters); | 1339 var callTreeView = new WebInspector.CallTreeTimelineTreeView(timelineModel,
filters); |
| 1340 this.appendTab(tabIds.CallTree, WebInspector.UIString("Call Tree"), callTree
View); | 1340 this.appendTab(tabIds.CallTree, WebInspector.UIString("Call Tree"), callTree
View); |
| 1341 this._rangeDetailViews.set(tabIds.CallTree, callTreeView); | 1341 this._rangeDetailViews.set(tabIds.CallTree, callTreeView); |
| 1342 | 1342 |
| 1343 var eventsView = new WebInspector.EventsTimelineTreeView(timelineModel, filt
ers, delegate); | 1343 var eventsView = new WebInspector.EventsTimelineTreeView(timelineModel, filt
ers, delegate); |
| 1344 this.appendTab(tabIds.Events, WebInspector.UIString("Event Log"), eventsView
); | 1344 this.appendTab(tabIds.Events, WebInspector.UIString("Event Log"), eventsView
); |
| 1345 this._rangeDetailViews.set(tabIds.Events, eventsView); | 1345 this._rangeDetailViews.set(tabIds.Events, eventsView); |
| 1346 | 1346 |
| 1347 this.addEventListener(WebInspector.TabbedPane.Events.TabSelected, this._tabS
elected, this); | 1347 this.addEventListener(WebInspector.TabbedPane.Events.TabSelected, this._tabS
elected, this); |
| 1348 } | 1348 }; |
| 1349 | 1349 |
| 1350 WebInspector.TimelineDetailsView.prototype = { | 1350 WebInspector.TimelineDetailsView.prototype = { |
| 1351 /** | 1351 /** |
| 1352 * @param {!Node} node | 1352 * @param {!Node} node |
| 1353 */ | 1353 */ |
| 1354 setContent: function(node) | 1354 setContent: function(node) |
| 1355 { | 1355 { |
| 1356 var allTabs = this.otherTabs(WebInspector.TimelinePanel.DetailsTab.Detai
ls); | 1356 var allTabs = this.otherTabs(WebInspector.TimelinePanel.DetailsTab.Detai
ls); |
| 1357 for (var i = 0; i < allTabs.length; ++i) { | 1357 for (var i = 0; i < allTabs.length; ++i) { |
| 1358 if (!this._rangeDetailViews.has(allTabs[i])) | 1358 if (!this._rangeDetailViews.has(allTabs[i])) |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1402 */ | 1402 */ |
| 1403 _tabSelected: function(event) | 1403 _tabSelected: function(event) |
| 1404 { | 1404 { |
| 1405 if (!event.data.isUserGesture) | 1405 if (!event.data.isUserGesture) |
| 1406 return; | 1406 return; |
| 1407 this.setPreferredTab(event.data.tabId); | 1407 this.setPreferredTab(event.data.tabId); |
| 1408 this.updateContents(this._selection); | 1408 this.updateContents(this._selection); |
| 1409 }, | 1409 }, |
| 1410 | 1410 |
| 1411 __proto__: WebInspector.TabbedPane.prototype | 1411 __proto__: WebInspector.TabbedPane.prototype |
| 1412 } | 1412 }; |
| 1413 | 1413 |
| 1414 /** | 1414 /** |
| 1415 * @constructor | 1415 * @constructor |
| 1416 * @param {!WebInspector.TimelineSelection.Type} type | 1416 * @param {!WebInspector.TimelineSelection.Type} type |
| 1417 * @param {number} startTime | 1417 * @param {number} startTime |
| 1418 * @param {number} endTime | 1418 * @param {number} endTime |
| 1419 * @param {!Object=} object | 1419 * @param {!Object=} object |
| 1420 */ | 1420 */ |
| 1421 WebInspector.TimelineSelection = function(type, startTime, endTime, object) | 1421 WebInspector.TimelineSelection = function(type, startTime, endTime, object) |
| 1422 { | 1422 { |
| 1423 this._type = type; | 1423 this._type = type; |
| 1424 this._startTime = startTime; | 1424 this._startTime = startTime; |
| 1425 this._endTime = endTime; | 1425 this._endTime = endTime; |
| 1426 this._object = object || null; | 1426 this._object = object || null; |
| 1427 } | 1427 }; |
| 1428 | 1428 |
| 1429 /** | 1429 /** |
| 1430 * @enum {string} | 1430 * @enum {string} |
| 1431 */ | 1431 */ |
| 1432 WebInspector.TimelineSelection.Type = { | 1432 WebInspector.TimelineSelection.Type = { |
| 1433 Frame: "Frame", | 1433 Frame: "Frame", |
| 1434 NetworkRequest: "NetworkRequest", | 1434 NetworkRequest: "NetworkRequest", |
| 1435 TraceEvent: "TraceEvent", | 1435 TraceEvent: "TraceEvent", |
| 1436 Range: "Range" | 1436 Range: "Range" |
| 1437 }; | 1437 }; |
| 1438 | 1438 |
| 1439 /** | 1439 /** |
| 1440 * @param {!WebInspector.TimelineFrame} frame | 1440 * @param {!WebInspector.TimelineFrame} frame |
| 1441 * @return {!WebInspector.TimelineSelection} | 1441 * @return {!WebInspector.TimelineSelection} |
| 1442 */ | 1442 */ |
| 1443 WebInspector.TimelineSelection.fromFrame = function(frame) | 1443 WebInspector.TimelineSelection.fromFrame = function(frame) |
| 1444 { | 1444 { |
| 1445 return new WebInspector.TimelineSelection( | 1445 return new WebInspector.TimelineSelection( |
| 1446 WebInspector.TimelineSelection.Type.Frame, | 1446 WebInspector.TimelineSelection.Type.Frame, |
| 1447 frame.startTime, frame.endTime, | 1447 frame.startTime, frame.endTime, |
| 1448 frame); | 1448 frame); |
| 1449 } | 1449 }; |
| 1450 | 1450 |
| 1451 /** | 1451 /** |
| 1452 * @param {!WebInspector.TimelineModel.NetworkRequest} request | 1452 * @param {!WebInspector.TimelineModel.NetworkRequest} request |
| 1453 * @return {!WebInspector.TimelineSelection} | 1453 * @return {!WebInspector.TimelineSelection} |
| 1454 */ | 1454 */ |
| 1455 WebInspector.TimelineSelection.fromNetworkRequest = function(request) | 1455 WebInspector.TimelineSelection.fromNetworkRequest = function(request) |
| 1456 { | 1456 { |
| 1457 return new WebInspector.TimelineSelection( | 1457 return new WebInspector.TimelineSelection( |
| 1458 WebInspector.TimelineSelection.Type.NetworkRequest, | 1458 WebInspector.TimelineSelection.Type.NetworkRequest, |
| 1459 request.startTime, request.endTime || request.startTime, | 1459 request.startTime, request.endTime || request.startTime, |
| 1460 request); | 1460 request); |
| 1461 } | 1461 }; |
| 1462 | 1462 |
| 1463 /** | 1463 /** |
| 1464 * @param {!WebInspector.TracingModel.Event} event | 1464 * @param {!WebInspector.TracingModel.Event} event |
| 1465 * @return {!WebInspector.TimelineSelection} | 1465 * @return {!WebInspector.TimelineSelection} |
| 1466 */ | 1466 */ |
| 1467 WebInspector.TimelineSelection.fromTraceEvent = function(event) | 1467 WebInspector.TimelineSelection.fromTraceEvent = function(event) |
| 1468 { | 1468 { |
| 1469 return new WebInspector.TimelineSelection( | 1469 return new WebInspector.TimelineSelection( |
| 1470 WebInspector.TimelineSelection.Type.TraceEvent, | 1470 WebInspector.TimelineSelection.Type.TraceEvent, |
| 1471 event.startTime, event.endTime || (event.startTime + 1), | 1471 event.startTime, event.endTime || (event.startTime + 1), |
| 1472 event); | 1472 event); |
| 1473 } | 1473 }; |
| 1474 | 1474 |
| 1475 /** | 1475 /** |
| 1476 * @param {number} startTime | 1476 * @param {number} startTime |
| 1477 * @param {number} endTime | 1477 * @param {number} endTime |
| 1478 * @return {!WebInspector.TimelineSelection} | 1478 * @return {!WebInspector.TimelineSelection} |
| 1479 */ | 1479 */ |
| 1480 WebInspector.TimelineSelection.fromRange = function(startTime, endTime) | 1480 WebInspector.TimelineSelection.fromRange = function(startTime, endTime) |
| 1481 { | 1481 { |
| 1482 return new WebInspector.TimelineSelection( | 1482 return new WebInspector.TimelineSelection( |
| 1483 WebInspector.TimelineSelection.Type.Range, | 1483 WebInspector.TimelineSelection.Type.Range, |
| 1484 startTime, endTime); | 1484 startTime, endTime); |
| 1485 } | 1485 }; |
| 1486 | 1486 |
| 1487 WebInspector.TimelineSelection.prototype = { | 1487 WebInspector.TimelineSelection.prototype = { |
| 1488 /** | 1488 /** |
| 1489 * @return {!WebInspector.TimelineSelection.Type} | 1489 * @return {!WebInspector.TimelineSelection.Type} |
| 1490 */ | 1490 */ |
| 1491 type: function() | 1491 type: function() |
| 1492 { | 1492 { |
| 1493 return this._type; | 1493 return this._type; |
| 1494 }, | 1494 }, |
| 1495 | 1495 |
| (...skipping 21 matching lines...) Expand all Loading... |
| 1517 return this._endTime; | 1517 return this._endTime; |
| 1518 } | 1518 } |
| 1519 }; | 1519 }; |
| 1520 | 1520 |
| 1521 /** | 1521 /** |
| 1522 * @interface | 1522 * @interface |
| 1523 * @extends {WebInspector.EventTarget} | 1523 * @extends {WebInspector.EventTarget} |
| 1524 */ | 1524 */ |
| 1525 WebInspector.TimelineModeView = function() | 1525 WebInspector.TimelineModeView = function() |
| 1526 { | 1526 { |
| 1527 } | 1527 }; |
| 1528 | 1528 |
| 1529 WebInspector.TimelineModeView.prototype = { | 1529 WebInspector.TimelineModeView.prototype = { |
| 1530 /** | 1530 /** |
| 1531 * @return {!WebInspector.Widget} | 1531 * @return {!WebInspector.Widget} |
| 1532 */ | 1532 */ |
| 1533 view: function() {}, | 1533 view: function() {}, |
| 1534 | 1534 |
| 1535 dispose: function() {}, | 1535 dispose: function() {}, |
| 1536 | 1536 |
| 1537 /** | 1537 /** |
| (...skipping 20 matching lines...) Expand all Loading... |
| 1558 | 1558 |
| 1559 /** | 1559 /** |
| 1560 * @param {?WebInspector.TimelineSelection} selection | 1560 * @param {?WebInspector.TimelineSelection} selection |
| 1561 */ | 1561 */ |
| 1562 setSelection: function(selection) {}, | 1562 setSelection: function(selection) {}, |
| 1563 | 1563 |
| 1564 /** | 1564 /** |
| 1565 * @param {?WebInspector.TracingModel.Event} event | 1565 * @param {?WebInspector.TracingModel.Event} event |
| 1566 */ | 1566 */ |
| 1567 highlightEvent: function(event) { } | 1567 highlightEvent: function(event) { } |
| 1568 } | 1568 }; |
| 1569 | 1569 |
| 1570 /** | 1570 /** |
| 1571 * @interface | 1571 * @interface |
| 1572 */ | 1572 */ |
| 1573 WebInspector.TimelineModeViewDelegate = function() {} | 1573 WebInspector.TimelineModeViewDelegate = function() {}; |
| 1574 | 1574 |
| 1575 WebInspector.TimelineModeViewDelegate.prototype = { | 1575 WebInspector.TimelineModeViewDelegate.prototype = { |
| 1576 /** | 1576 /** |
| 1577 * @param {number} startTime | 1577 * @param {number} startTime |
| 1578 * @param {number} endTime | 1578 * @param {number} endTime |
| 1579 */ | 1579 */ |
| 1580 requestWindowTimes: function(startTime, endTime) {}, | 1580 requestWindowTimes: function(startTime, endTime) {}, |
| 1581 | 1581 |
| 1582 /** | 1582 /** |
| 1583 * @param {?WebInspector.TimelineSelection} selection | 1583 * @param {?WebInspector.TimelineSelection} selection |
| 1584 * @param {!WebInspector.TimelinePanel.DetailsTab=} preferredTab | 1584 * @param {!WebInspector.TimelinePanel.DetailsTab=} preferredTab |
| 1585 */ | 1585 */ |
| 1586 select: function(selection, preferredTab) {}, | 1586 select: function(selection, preferredTab) {}, |
| 1587 | 1587 |
| 1588 /** | 1588 /** |
| 1589 * @param {number} time | 1589 * @param {number} time |
| 1590 */ | 1590 */ |
| 1591 selectEntryAtTime: function(time) {}, | 1591 selectEntryAtTime: function(time) {}, |
| 1592 | 1592 |
| 1593 /** | 1593 /** |
| 1594 * @param {!Node} node | 1594 * @param {!Node} node |
| 1595 */ | 1595 */ |
| 1596 showInDetails: function(node) {}, | 1596 showInDetails: function(node) {}, |
| 1597 | 1597 |
| 1598 /** | 1598 /** |
| 1599 * @param {?WebInspector.TracingModel.Event} event | 1599 * @param {?WebInspector.TracingModel.Event} event |
| 1600 */ | 1600 */ |
| 1601 highlightEvent: function(event) {} | 1601 highlightEvent: function(event) {} |
| 1602 } | 1602 }; |
| 1603 | 1603 |
| 1604 /** | 1604 /** |
| 1605 * @constructor | 1605 * @constructor |
| 1606 * @extends {WebInspector.TimelineModel.Filter} | 1606 * @extends {WebInspector.TimelineModel.Filter} |
| 1607 */ | 1607 */ |
| 1608 WebInspector.TimelineCategoryFilter = function() | 1608 WebInspector.TimelineCategoryFilter = function() |
| 1609 { | 1609 { |
| 1610 WebInspector.TimelineModel.Filter.call(this); | 1610 WebInspector.TimelineModel.Filter.call(this); |
| 1611 } | 1611 }; |
| 1612 | 1612 |
| 1613 WebInspector.TimelineCategoryFilter.prototype = { | 1613 WebInspector.TimelineCategoryFilter.prototype = { |
| 1614 /** | 1614 /** |
| 1615 * @override | 1615 * @override |
| 1616 * @param {!WebInspector.TracingModel.Event} event | 1616 * @param {!WebInspector.TracingModel.Event} event |
| 1617 * @return {boolean} | 1617 * @return {boolean} |
| 1618 */ | 1618 */ |
| 1619 accept: function(event) | 1619 accept: function(event) |
| 1620 { | 1620 { |
| 1621 return !WebInspector.TimelineUIUtils.eventStyle(event).category.hidden; | 1621 return !WebInspector.TimelineUIUtils.eventStyle(event).category.hidden; |
| 1622 }, | 1622 }, |
| 1623 | 1623 |
| 1624 __proto__: WebInspector.TimelineModel.Filter.prototype | 1624 __proto__: WebInspector.TimelineModel.Filter.prototype |
| 1625 } | 1625 }; |
| 1626 | 1626 |
| 1627 /** | 1627 /** |
| 1628 * @constructor | 1628 * @constructor |
| 1629 * @extends {WebInspector.TimelineModel.Filter} | 1629 * @extends {WebInspector.TimelineModel.Filter} |
| 1630 */ | 1630 */ |
| 1631 WebInspector.TimelineIsLongFilter = function() | 1631 WebInspector.TimelineIsLongFilter = function() |
| 1632 { | 1632 { |
| 1633 WebInspector.TimelineModel.Filter.call(this); | 1633 WebInspector.TimelineModel.Filter.call(this); |
| 1634 this._minimumRecordDuration = 0; | 1634 this._minimumRecordDuration = 0; |
| 1635 } | 1635 }; |
| 1636 | 1636 |
| 1637 WebInspector.TimelineIsLongFilter.prototype = { | 1637 WebInspector.TimelineIsLongFilter.prototype = { |
| 1638 /** | 1638 /** |
| 1639 * @param {number} value | 1639 * @param {number} value |
| 1640 */ | 1640 */ |
| 1641 setMinimumRecordDuration: function(value) | 1641 setMinimumRecordDuration: function(value) |
| 1642 { | 1642 { |
| 1643 this._minimumRecordDuration = value; | 1643 this._minimumRecordDuration = value; |
| 1644 }, | 1644 }, |
| 1645 | 1645 |
| 1646 /** | 1646 /** |
| 1647 * @override | 1647 * @override |
| 1648 * @param {!WebInspector.TracingModel.Event} event | 1648 * @param {!WebInspector.TracingModel.Event} event |
| 1649 * @return {boolean} | 1649 * @return {boolean} |
| 1650 */ | 1650 */ |
| 1651 accept: function(event) | 1651 accept: function(event) |
| 1652 { | 1652 { |
| 1653 var duration = event.endTime ? event.endTime - event.startTime : 0; | 1653 var duration = event.endTime ? event.endTime - event.startTime : 0; |
| 1654 return duration >= this._minimumRecordDuration; | 1654 return duration >= this._minimumRecordDuration; |
| 1655 }, | 1655 }, |
| 1656 | 1656 |
| 1657 __proto__: WebInspector.TimelineModel.Filter.prototype | 1657 __proto__: WebInspector.TimelineModel.Filter.prototype |
| 1658 | 1658 |
| 1659 } | 1659 }; |
| 1660 | 1660 |
| 1661 /** | 1661 /** |
| 1662 * @constructor | 1662 * @constructor |
| 1663 * @extends {WebInspector.TimelineModel.Filter} | 1663 * @extends {WebInspector.TimelineModel.Filter} |
| 1664 * @param {!RegExp=} regExp | 1664 * @param {!RegExp=} regExp |
| 1665 */ | 1665 */ |
| 1666 WebInspector.TimelineTextFilter = function(regExp) | 1666 WebInspector.TimelineTextFilter = function(regExp) |
| 1667 { | 1667 { |
| 1668 WebInspector.TimelineModel.Filter.call(this); | 1668 WebInspector.TimelineModel.Filter.call(this); |
| 1669 this._setRegExp(regExp || null); | 1669 this._setRegExp(regExp || null); |
| 1670 } | 1670 }; |
| 1671 | 1671 |
| 1672 WebInspector.TimelineTextFilter.prototype = { | 1672 WebInspector.TimelineTextFilter.prototype = { |
| 1673 /** | 1673 /** |
| 1674 * @param {?RegExp} regExp | 1674 * @param {?RegExp} regExp |
| 1675 */ | 1675 */ |
| 1676 _setRegExp: function(regExp) | 1676 _setRegExp: function(regExp) |
| 1677 { | 1677 { |
| 1678 this._regExp = regExp; | 1678 this._regExp = regExp; |
| 1679 }, | 1679 }, |
| 1680 | 1680 |
| 1681 /** | 1681 /** |
| 1682 * @override | 1682 * @override |
| 1683 * @param {!WebInspector.TracingModel.Event} event | 1683 * @param {!WebInspector.TracingModel.Event} event |
| 1684 * @return {boolean} | 1684 * @return {boolean} |
| 1685 */ | 1685 */ |
| 1686 accept: function(event) | 1686 accept: function(event) |
| 1687 { | 1687 { |
| 1688 return !this._regExp || WebInspector.TimelineUIUtils.testContentMatching
(event, this._regExp); | 1688 return !this._regExp || WebInspector.TimelineUIUtils.testContentMatching
(event, this._regExp); |
| 1689 }, | 1689 }, |
| 1690 | 1690 |
| 1691 __proto__: WebInspector.TimelineModel.Filter.prototype | 1691 __proto__: WebInspector.TimelineModel.Filter.prototype |
| 1692 } | 1692 }; |
| 1693 | 1693 |
| 1694 /** | 1694 /** |
| 1695 * @constructor | 1695 * @constructor |
| 1696 * @extends {WebInspector.VBox} | 1696 * @extends {WebInspector.VBox} |
| 1697 * @param {boolean} showTimer | 1697 * @param {boolean} showTimer |
| 1698 * @param {function()} stopCallback | 1698 * @param {function()} stopCallback |
| 1699 */ | 1699 */ |
| 1700 WebInspector.TimelinePanel.StatusPane = function(showTimer, stopCallback) | 1700 WebInspector.TimelinePanel.StatusPane = function(showTimer, stopCallback) |
| 1701 { | 1701 { |
| 1702 WebInspector.VBox.call(this, true); | 1702 WebInspector.VBox.call(this, true); |
| 1703 this.registerRequiredCSS("timeline/timelineStatusDialog.css"); | 1703 this.registerRequiredCSS("timeline/timelineStatusDialog.css"); |
| 1704 this.contentElement.classList.add("timeline-status-dialog"); | 1704 this.contentElement.classList.add("timeline-status-dialog"); |
| 1705 | 1705 |
| 1706 var statusLine = this.contentElement.createChild("div", "status-dialog-line
status"); | 1706 var statusLine = this.contentElement.createChild("div", "status-dialog-line
status"); |
| 1707 statusLine.createChild("div", "label").textContent = WebInspector.UIString("
Status"); | 1707 statusLine.createChild("div", "label").textContent = WebInspector.UIString("
Status"); |
| 1708 this._status = statusLine.createChild("div", "content"); | 1708 this._status = statusLine.createChild("div", "content"); |
| 1709 | 1709 |
| 1710 if (showTimer) { | 1710 if (showTimer) { |
| 1711 var timeLine = this.contentElement.createChild("div", "status-dialog-lin
e time"); | 1711 var timeLine = this.contentElement.createChild("div", "status-dialog-lin
e time"); |
| 1712 timeLine.createChild("div", "label").textContent = WebInspector.UIString
("Time"); | 1712 timeLine.createChild("div", "label").textContent = WebInspector.UIString
("Time"); |
| 1713 this._time = timeLine.createChild("div", "content"); | 1713 this._time = timeLine.createChild("div", "content"); |
| 1714 } | 1714 } |
| 1715 var progressLine = this.contentElement.createChild("div", "status-dialog-lin
e progress"); | 1715 var progressLine = this.contentElement.createChild("div", "status-dialog-lin
e progress"); |
| 1716 this._progressLabel = progressLine.createChild("div", "label"); | 1716 this._progressLabel = progressLine.createChild("div", "label"); |
| 1717 this._progressBar = progressLine.createChild("div", "indicator-container").c
reateChild("div", "indicator"); | 1717 this._progressBar = progressLine.createChild("div", "indicator-container").c
reateChild("div", "indicator"); |
| 1718 | 1718 |
| 1719 this._stopButton = createTextButton(WebInspector.UIString("Stop"), stopCallb
ack); | 1719 this._stopButton = createTextButton(WebInspector.UIString("Stop"), stopCallb
ack); |
| 1720 this.contentElement.createChild("div", "stop-button").appendChild(this._stop
Button); | 1720 this.contentElement.createChild("div", "stop-button").appendChild(this._stop
Button); |
| 1721 } | 1721 }; |
| 1722 | 1722 |
| 1723 WebInspector.TimelinePanel.StatusPane.prototype = { | 1723 WebInspector.TimelinePanel.StatusPane.prototype = { |
| 1724 finish: function() | 1724 finish: function() |
| 1725 { | 1725 { |
| 1726 this._stopTimer(); | 1726 this._stopTimer(); |
| 1727 this._stopButton.disabled = true; | 1727 this._stopButton.disabled = true; |
| 1728 }, | 1728 }, |
| 1729 | 1729 |
| 1730 hide: function() | 1730 hide: function() |
| 1731 { | 1731 { |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1782 */ | 1782 */ |
| 1783 _updateTimer: function(precise) | 1783 _updateTimer: function(precise) |
| 1784 { | 1784 { |
| 1785 if (!this._timeUpdateTimer) | 1785 if (!this._timeUpdateTimer) |
| 1786 return; | 1786 return; |
| 1787 var elapsed = (Date.now() - this._startTime) / 1000; | 1787 var elapsed = (Date.now() - this._startTime) / 1000; |
| 1788 this._time.textContent = WebInspector.UIString("%s\u2009sec", elapsed.to
Fixed(precise ? 1 : 0)); | 1788 this._time.textContent = WebInspector.UIString("%s\u2009sec", elapsed.to
Fixed(precise ? 1 : 0)); |
| 1789 }, | 1789 }, |
| 1790 | 1790 |
| 1791 __proto__: WebInspector.VBox.prototype | 1791 __proto__: WebInspector.VBox.prototype |
| 1792 } | 1792 }; |
| 1793 | 1793 |
| 1794 /** | 1794 /** |
| 1795 * @return {!WebInspector.TimelinePanel} | 1795 * @return {!WebInspector.TimelinePanel} |
| 1796 */ | 1796 */ |
| 1797 WebInspector.TimelinePanel.instance = function() | 1797 WebInspector.TimelinePanel.instance = function() |
| 1798 { | 1798 { |
| 1799 return /** @type {!WebInspector.TimelinePanel} */ (self.runtime.sharedInstan
ce(WebInspector.TimelinePanel)); | 1799 return /** @type {!WebInspector.TimelinePanel} */ (self.runtime.sharedInstan
ce(WebInspector.TimelinePanel)); |
| 1800 } | 1800 }; |
| 1801 | 1801 |
| 1802 /** | 1802 /** |
| 1803 * @constructor | 1803 * @constructor |
| 1804 * @implements {WebInspector.QueryParamHandler} | 1804 * @implements {WebInspector.QueryParamHandler} |
| 1805 */ | 1805 */ |
| 1806 WebInspector.LoadTimelineHandler = function() | 1806 WebInspector.LoadTimelineHandler = function() |
| 1807 { | 1807 { |
| 1808 } | 1808 }; |
| 1809 | 1809 |
| 1810 WebInspector.LoadTimelineHandler.prototype = { | 1810 WebInspector.LoadTimelineHandler.prototype = { |
| 1811 /** | 1811 /** |
| 1812 * @override | 1812 * @override |
| 1813 * @param {string} value | 1813 * @param {string} value |
| 1814 */ | 1814 */ |
| 1815 handleQueryParam: function(value) | 1815 handleQueryParam: function(value) |
| 1816 { | 1816 { |
| 1817 WebInspector.viewManager.showView("timeline").then(() => { | 1817 WebInspector.viewManager.showView("timeline").then(() => { |
| 1818 WebInspector.TimelinePanel.instance()._loadFromURL(window.decodeURIC
omponent(value)); | 1818 WebInspector.TimelinePanel.instance()._loadFromURL(window.decodeURIC
omponent(value)); |
| 1819 }); | 1819 }); |
| 1820 } | 1820 } |
| 1821 } | 1821 }; |
| 1822 | 1822 |
| 1823 /** | 1823 /** |
| 1824 * @constructor | 1824 * @constructor |
| 1825 * @implements {WebInspector.ActionDelegate} | 1825 * @implements {WebInspector.ActionDelegate} |
| 1826 */ | 1826 */ |
| 1827 WebInspector.TimelinePanel.ActionDelegate = function() | 1827 WebInspector.TimelinePanel.ActionDelegate = function() |
| 1828 { | 1828 { |
| 1829 } | 1829 }; |
| 1830 | 1830 |
| 1831 WebInspector.TimelinePanel.ActionDelegate.prototype = { | 1831 WebInspector.TimelinePanel.ActionDelegate.prototype = { |
| 1832 /** | 1832 /** |
| 1833 * @override | 1833 * @override |
| 1834 * @param {!WebInspector.Context} context | 1834 * @param {!WebInspector.Context} context |
| 1835 * @param {string} actionId | 1835 * @param {string} actionId |
| 1836 * @return {boolean} | 1836 * @return {boolean} |
| 1837 */ | 1837 */ |
| 1838 handleAction: function(context, actionId) | 1838 handleAction: function(context, actionId) |
| 1839 { | 1839 { |
| (...skipping 11 matching lines...) Expand all Loading... |
| 1851 return true; | 1851 return true; |
| 1852 case "timeline.jump-to-previous-frame": | 1852 case "timeline.jump-to-previous-frame": |
| 1853 panel._jumpToFrame(-1); | 1853 panel._jumpToFrame(-1); |
| 1854 return true; | 1854 return true; |
| 1855 case "timeline.jump-to-next-frame": | 1855 case "timeline.jump-to-next-frame": |
| 1856 panel._jumpToFrame(1); | 1856 panel._jumpToFrame(1); |
| 1857 return true; | 1857 return true; |
| 1858 } | 1858 } |
| 1859 return false; | 1859 return false; |
| 1860 } | 1860 } |
| 1861 } | 1861 }; |
| 1862 | 1862 |
| 1863 /** | 1863 /** |
| 1864 * @constructor | 1864 * @constructor |
| 1865 * @extends {WebInspector.Object} | 1865 * @extends {WebInspector.Object} |
| 1866 */ | 1866 */ |
| 1867 WebInspector.TimelineFilters = function() | 1867 WebInspector.TimelineFilters = function() |
| 1868 { | 1868 { |
| 1869 WebInspector.Object.call(this); | 1869 WebInspector.Object.call(this); |
| 1870 | 1870 |
| 1871 this._categoryFilter = new WebInspector.TimelineCategoryFilter(); | 1871 this._categoryFilter = new WebInspector.TimelineCategoryFilter(); |
| 1872 this._durationFilter = new WebInspector.TimelineIsLongFilter(); | 1872 this._durationFilter = new WebInspector.TimelineIsLongFilter(); |
| 1873 this._textFilter = new WebInspector.TimelineTextFilter(); | 1873 this._textFilter = new WebInspector.TimelineTextFilter(); |
| 1874 this._filters = [this._categoryFilter, this._durationFilter, this._textFilte
r]; | 1874 this._filters = [this._categoryFilter, this._durationFilter, this._textFilte
r]; |
| 1875 | 1875 |
| 1876 this._createFilterBar(); | 1876 this._createFilterBar(); |
| 1877 } | 1877 }; |
| 1878 | 1878 |
| 1879 /** @enum {symbol} */ | 1879 /** @enum {symbol} */ |
| 1880 WebInspector.TimelineFilters.Events = { | 1880 WebInspector.TimelineFilters.Events = { |
| 1881 FilterChanged: Symbol("FilterChanged") | 1881 FilterChanged: Symbol("FilterChanged") |
| 1882 }; | 1882 }; |
| 1883 | 1883 |
| 1884 WebInspector.TimelineFilters._durationFilterPresetsMs = [0, 1, 15]; | 1884 WebInspector.TimelineFilters._durationFilterPresetsMs = [0, 1, 15]; |
| 1885 | 1885 |
| 1886 WebInspector.TimelineFilters.prototype = { | 1886 WebInspector.TimelineFilters.prototype = { |
| 1887 /** | 1887 /** |
| (...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1999 /** | 1999 /** |
| 2000 * @constructor | 2000 * @constructor |
| 2001 * @extends {WebInspector.Object} | 2001 * @extends {WebInspector.Object} |
| 2002 * @implements {WebInspector.TargetManager.Observer} | 2002 * @implements {WebInspector.TargetManager.Observer} |
| 2003 */ | 2003 */ |
| 2004 WebInspector.CPUThrottlingManager = function() | 2004 WebInspector.CPUThrottlingManager = function() |
| 2005 { | 2005 { |
| 2006 this._targets = []; | 2006 this._targets = []; |
| 2007 this._throttlingRate = 1.; // No throttling | 2007 this._throttlingRate = 1.; // No throttling |
| 2008 WebInspector.targetManager.observeTargets(this, WebInspector.Target.Capabili
ty.Browser); | 2008 WebInspector.targetManager.observeTargets(this, WebInspector.Target.Capabili
ty.Browser); |
| 2009 } | 2009 }; |
| 2010 | 2010 |
| 2011 WebInspector.CPUThrottlingManager.prototype = { | 2011 WebInspector.CPUThrottlingManager.prototype = { |
| 2012 /** | 2012 /** |
| 2013 * @param {number} value | 2013 * @param {number} value |
| 2014 */ | 2014 */ |
| 2015 setRate: function(value) | 2015 setRate: function(value) |
| 2016 { | 2016 { |
| 2017 this._throttlingRate = value; | 2017 this._throttlingRate = value; |
| 2018 this._targets.forEach(target => target.emulationAgent().setCPUThrottling
Rate(value)); | 2018 this._targets.forEach(target => target.emulationAgent().setCPUThrottling
Rate(value)); |
| 2019 if (value !== 1) | 2019 if (value !== 1) |
| (...skipping 23 matching lines...) Expand all Loading... |
| 2043 /** | 2043 /** |
| 2044 * @override | 2044 * @override |
| 2045 * @param {!WebInspector.Target} target | 2045 * @param {!WebInspector.Target} target |
| 2046 */ | 2046 */ |
| 2047 targetRemoved: function(target) | 2047 targetRemoved: function(target) |
| 2048 { | 2048 { |
| 2049 this._targets.remove(target, true); | 2049 this._targets.remove(target, true); |
| 2050 }, | 2050 }, |
| 2051 | 2051 |
| 2052 __proto__: WebInspector.Object.prototype | 2052 __proto__: WebInspector.Object.prototype |
| 2053 } | 2053 }; |
| 2054 | 2054 |
| 2055 /** | 2055 /** |
| 2056 * @constructor | 2056 * @constructor |
| 2057 * @extends {WebInspector.HBox} | 2057 * @extends {WebInspector.HBox} |
| 2058 */ | 2058 */ |
| 2059 WebInspector.TimelinePanel.CustomCPUThrottlingRateDialog = function() | 2059 WebInspector.TimelinePanel.CustomCPUThrottlingRateDialog = function() |
| 2060 { | 2060 { |
| 2061 WebInspector.HBox.call(this, true); | 2061 WebInspector.HBox.call(this, true); |
| 2062 this.registerRequiredCSS("ui_lazy/dialog.css"); | 2062 this.registerRequiredCSS("ui_lazy/dialog.css"); |
| 2063 this.contentElement.createChild("label").textContent = WebInspector.UIString
("CPU Slowdown Rate: "); | 2063 this.contentElement.createChild("label").textContent = WebInspector.UIString
("CPU Slowdown Rate: "); |
| 2064 | 2064 |
| 2065 this._input = this.contentElement.createChild("input"); | 2065 this._input = this.contentElement.createChild("input"); |
| 2066 this._input.setAttribute("type", "text"); | 2066 this._input.setAttribute("type", "text"); |
| 2067 this._input.style.width = "64px"; | 2067 this._input.style.width = "64px"; |
| 2068 this._input.addEventListener("keydown", this._onKeyDown.bind(this), false); | 2068 this._input.addEventListener("keydown", this._onKeyDown.bind(this), false); |
| 2069 | 2069 |
| 2070 var addButton = this.contentElement.createChild("button"); | 2070 var addButton = this.contentElement.createChild("button"); |
| 2071 addButton.textContent = WebInspector.UIString("Set"); | 2071 addButton.textContent = WebInspector.UIString("Set"); |
| 2072 addButton.addEventListener("click", this._apply.bind(this), false); | 2072 addButton.addEventListener("click", this._apply.bind(this), false); |
| 2073 | 2073 |
| 2074 this.setDefaultFocusedElement(this._input); | 2074 this.setDefaultFocusedElement(this._input); |
| 2075 this.contentElement.tabIndex = 0; | 2075 this.contentElement.tabIndex = 0; |
| 2076 this._resultPromise = new Promise(fulfill => this._callback = fulfill); | 2076 this._resultPromise = new Promise(fulfill => this._callback = fulfill); |
| 2077 } | 2077 }; |
| 2078 | 2078 |
| 2079 /** | 2079 /** |
| 2080 * @param {!Element=} anchor | 2080 * @param {!Element=} anchor |
| 2081 * @return {!Promise<string>} | 2081 * @return {!Promise<string>} |
| 2082 */ | 2082 */ |
| 2083 WebInspector.TimelinePanel.CustomCPUThrottlingRateDialog.show = function(anchor) | 2083 WebInspector.TimelinePanel.CustomCPUThrottlingRateDialog.show = function(anchor) |
| 2084 { | 2084 { |
| 2085 var dialog = new WebInspector.Dialog(); | 2085 var dialog = new WebInspector.Dialog(); |
| 2086 var dialogContent = new WebInspector.TimelinePanel.CustomCPUThrottlingRateDi
alog(); | 2086 var dialogContent = new WebInspector.TimelinePanel.CustomCPUThrottlingRateDi
alog(); |
| 2087 dialogContent.show(dialog.element); | 2087 dialogContent.show(dialog.element); |
| 2088 dialog.setWrapsContent(true); | 2088 dialog.setWrapsContent(true); |
| 2089 if (anchor) | 2089 if (anchor) |
| 2090 dialog.setPosition(anchor.totalOffsetLeft() - 32, anchor.totalOffsetTop(
) + anchor.offsetHeight); | 2090 dialog.setPosition(anchor.totalOffsetLeft() - 32, anchor.totalOffsetTop(
) + anchor.offsetHeight); |
| 2091 dialog.show(); | 2091 dialog.show(); |
| 2092 return dialogContent.result().then(value => (dialog.detach(), value)); | 2092 return dialogContent.result().then(value => (dialog.detach(), value)); |
| 2093 } | 2093 }; |
| 2094 | 2094 |
| 2095 WebInspector.TimelinePanel.CustomCPUThrottlingRateDialog.prototype = { | 2095 WebInspector.TimelinePanel.CustomCPUThrottlingRateDialog.prototype = { |
| 2096 /** | 2096 /** |
| 2097 * @return {!Promise<string>} | 2097 * @return {!Promise<string>} |
| 2098 */ | 2098 */ |
| 2099 result: function() | 2099 result: function() |
| 2100 { | 2100 { |
| 2101 return this._resultPromise; | 2101 return this._resultPromise; |
| 2102 }, | 2102 }, |
| 2103 | 2103 |
| 2104 _apply: function() | 2104 _apply: function() |
| 2105 { | 2105 { |
| 2106 this._callback(this._input.value); | 2106 this._callback(this._input.value); |
| 2107 }, | 2107 }, |
| 2108 | 2108 |
| 2109 /** | 2109 /** |
| 2110 * @param {!Event} event | 2110 * @param {!Event} event |
| 2111 */ | 2111 */ |
| 2112 _onKeyDown: function(event) | 2112 _onKeyDown: function(event) |
| 2113 { | 2113 { |
| 2114 if (event.keyCode === WebInspector.KeyboardShortcut.Keys.Enter.code) { | 2114 if (event.keyCode === WebInspector.KeyboardShortcut.Keys.Enter.code) { |
| 2115 event.preventDefault(); | 2115 event.preventDefault(); |
| 2116 this._apply(); | 2116 this._apply(); |
| 2117 } | 2117 } |
| 2118 }, | 2118 }, |
| 2119 | 2119 |
| 2120 __proto__: WebInspector.HBox.prototype | 2120 __proto__: WebInspector.HBox.prototype |
| 2121 } | 2121 }; |
| OLD | NEW |