OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 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 549 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
560 | 560 |
561 if (i < startIndex) { | 561 if (i < startIndex) { |
562 var lastChildIndex = i + record.visibleChildrenCount(); | 562 var lastChildIndex = i + record.visibleChildrenCount(); |
563 if (lastChildIndex >= startIndex && lastChildIndex < endIndex) { | 563 if (lastChildIndex >= startIndex && lastChildIndex < endIndex) { |
564 var expandElement = new WebInspector.TimelineExpandableEleme
nt(this._expandElements); | 564 var expandElement = new WebInspector.TimelineExpandableEleme
nt(this._expandElements); |
565 var positions = this._calculator.computeBarGraphWindowPositi
on(record); | 565 var positions = this._calculator.computeBarGraphWindowPositi
on(record); |
566 expandElement._update(record, i, positions.left - this._expa
ndOffset, positions.width); | 566 expandElement._update(record, i, positions.left - this._expa
ndOffset, positions.width); |
567 } | 567 } |
568 } else { | 568 } else { |
569 if (!listRowElement) { | 569 if (!listRowElement) { |
570 listRowElement = new WebInspector.TimelineRecordListRow(this
._linkifier, selectRecordCallback, scheduleRefreshCallback).element; | 570 listRowElement = new WebInspector.TimelineRecordListRow(this
._linkifier, this._model.target(), selectRecordCallback, scheduleRefreshCallback
).element; |
571 this._sidebarListElement.appendChild(listRowElement); | 571 this._sidebarListElement.appendChild(listRowElement); |
572 } | 572 } |
573 if (!graphRowElement) { | 573 if (!graphRowElement) { |
574 graphRowElement = new WebInspector.TimelineRecordGraphRow(th
is._itemsGraphsElement, selectRecordCallback, scheduleRefreshCallback).element; | 574 graphRowElement = new WebInspector.TimelineRecordGraphRow(th
is._itemsGraphsElement, selectRecordCallback, scheduleRefreshCallback).element; |
575 this._graphRowsElement.appendChild(graphRowElement); | 575 this._graphRowsElement.appendChild(graphRowElement); |
576 } | 576 } |
577 | 577 |
578 listRowElement.row.update(record, visibleTop); | 578 listRowElement.row.update(record, visibleTop); |
579 graphRowElement.row.update(record, this._calculator, this._expan
dOffset, i); | 579 graphRowElement.row.update(record, this._calculator, this._expan
dOffset, i); |
580 if (this._lastSelectedRecord === record) { | 580 if (this._lastSelectedRecord === record) { |
(...skipping 431 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1012 boundarySpan: function() | 1012 boundarySpan: function() |
1013 { | 1013 { |
1014 return this._maximumBoundary - this._minimumBoundary; | 1014 return this._maximumBoundary - this._minimumBoundary; |
1015 } | 1015 } |
1016 } | 1016 } |
1017 | 1017 |
1018 /** | 1018 /** |
1019 * @constructor | 1019 * @constructor |
1020 * @param {!WebInspector.Linkifier} linkifier | 1020 * @param {!WebInspector.Linkifier} linkifier |
1021 * @param {function(!WebInspector.TimelinePresentationModel.Record)} selectRecor
d | 1021 * @param {function(!WebInspector.TimelinePresentationModel.Record)} selectRecor
d |
| 1022 * @param {?WebInspector.Target} target |
1022 * @param {function()} scheduleRefresh | 1023 * @param {function()} scheduleRefresh |
1023 */ | 1024 */ |
1024 WebInspector.TimelineRecordListRow = function(linkifier, selectRecord, scheduleR
efresh) | 1025 WebInspector.TimelineRecordListRow = function(linkifier, target, selectRecord, s
cheduleRefresh) |
1025 { | 1026 { |
1026 this.element = createElement("div"); | 1027 this.element = createElement("div"); |
1027 this.element.row = this; | 1028 this.element.row = this; |
1028 this.element.style.cursor = "pointer"; | 1029 this.element.style.cursor = "pointer"; |
1029 this.element.addEventListener("click", this._onClick.bind(this), false); | 1030 this.element.addEventListener("click", this._onClick.bind(this), false); |
1030 this.element.addEventListener("mouseover", this._onMouseOver.bind(this), fal
se); | 1031 this.element.addEventListener("mouseover", this._onMouseOver.bind(this), fal
se); |
1031 this.element.addEventListener("mouseleave", this._onMouseLeave.bind(this), f
alse); | 1032 this.element.addEventListener("mouseleave", this._onMouseLeave.bind(this), f
alse); |
1032 this._linkifier = linkifier; | 1033 this._linkifier = linkifier; |
1033 | 1034 |
1034 // Warning is float right block, it goes first. | 1035 // Warning is float right block, it goes first. |
1035 this._warningElement = this.element.createChild("div", "timeline-tree-item-w
arning hidden"); | 1036 this._warningElement = this.element.createChild("div", "timeline-tree-item-w
arning hidden"); |
1036 | 1037 |
1037 this._expandArrowElement = this.element.createChild("div", "timeline-tree-it
em-expand-arrow"); | 1038 this._expandArrowElement = this.element.createChild("div", "timeline-tree-it
em-expand-arrow"); |
1038 this._expandArrowElement.addEventListener("click", this._onExpandClick.bind(
this), false); | 1039 this._expandArrowElement.addEventListener("click", this._onExpandClick.bind(
this), false); |
1039 var iconElement = this.element.createChild("span", "timeline-tree-icon"); | 1040 var iconElement = this.element.createChild("span", "timeline-tree-icon"); |
1040 this._typeElement = this.element.createChild("span", "type"); | 1041 this._typeElement = this.element.createChild("span", "type"); |
1041 | 1042 |
1042 this._dataElement = this.element.createChild("span", "data dimmed"); | 1043 this._dataElement = this.element.createChild("span", "data dimmed"); |
1043 this._scheduleRefresh = scheduleRefresh; | 1044 this._scheduleRefresh = scheduleRefresh; |
1044 this._selectRecord = selectRecord; | 1045 this._selectRecord = selectRecord; |
| 1046 this._target = target; |
1045 } | 1047 } |
1046 | 1048 |
1047 WebInspector.TimelineRecordListRow.prototype = { | 1049 WebInspector.TimelineRecordListRow.prototype = { |
1048 /** | 1050 /** |
1049 * @param {!WebInspector.TimelinePresentationModel.Record} presentationRecor
d | 1051 * @param {!WebInspector.TimelinePresentationModel.Record} presentationRecor
d |
1050 * @param {number} offset | 1052 * @param {number} offset |
1051 */ | 1053 */ |
1052 update: function(presentationRecord, offset) | 1054 update: function(presentationRecord, offset) |
1053 { | 1055 { |
1054 this._record = presentationRecord; | 1056 this._record = presentationRecord; |
(...skipping 13 matching lines...) Expand all Loading... |
1068 | 1070 |
1069 if (this._dataElement.firstChild) | 1071 if (this._dataElement.firstChild) |
1070 this._dataElement.removeChildren(); | 1072 this._dataElement.removeChildren(); |
1071 | 1073 |
1072 this._warningElement.classList.toggle("hidden", !presentationRecord.hasW
arnings() && !presentationRecord.childHasWarnings()); | 1074 this._warningElement.classList.toggle("hidden", !presentationRecord.hasW
arnings() && !presentationRecord.childHasWarnings()); |
1073 this._warningElement.classList.toggle("timeline-tree-item-child-warning"
, presentationRecord.childHasWarnings() && !presentationRecord.hasWarnings()); | 1075 this._warningElement.classList.toggle("timeline-tree-item-child-warning"
, presentationRecord.childHasWarnings() && !presentationRecord.hasWarnings()); |
1074 | 1076 |
1075 if (presentationRecord.coalesced()) { | 1077 if (presentationRecord.coalesced()) { |
1076 this._dataElement.createTextChild(WebInspector.UIString("× %d", pres
entationRecord.presentationChildren().length)); | 1078 this._dataElement.createTextChild(WebInspector.UIString("× %d", pres
entationRecord.presentationChildren().length)); |
1077 } else { | 1079 } else { |
1078 var detailsNode = WebInspector.TimelineUIUtils.buildDetailsNodeForTr
aceEvent(record.traceEvent(), this._linkifier); | 1080 var detailsNode = WebInspector.TimelineUIUtils.buildDetailsNodeForTr
aceEvent(record.traceEvent(), this._target, this._linkifier); |
1079 if (detailsNode) { | 1081 if (detailsNode) { |
1080 this._dataElement.createTextChild("("); | 1082 this._dataElement.createTextChild("("); |
1081 this._dataElement.appendChild(detailsNode); | 1083 this._dataElement.appendChild(detailsNode); |
1082 this._dataElement.createTextChild(")"); | 1084 this._dataElement.createTextChild(")"); |
1083 } | 1085 } |
1084 } | 1086 } |
1085 | 1087 |
1086 this._expandArrowElement.classList.toggle("parent", presentationRecord.e
xpandable()); | 1088 this._expandArrowElement.classList.toggle("parent", presentationRecord.e
xpandable()); |
1087 this._expandArrowElement.classList.toggle("expanded", !!presentationReco
rd.visibleChildrenCount()); | 1089 this._expandArrowElement.classList.toggle("expanded", !!presentationReco
rd.visibleChildrenCount()); |
1088 this._record.setListRow(this); | 1090 this._record.setListRow(this); |
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1288 } else { | 1290 } else { |
1289 this._element.classList.add("hidden"); | 1291 this._element.classList.add("hidden"); |
1290 } | 1292 } |
1291 }, | 1293 }, |
1292 | 1294 |
1293 _dispose: function() | 1295 _dispose: function() |
1294 { | 1296 { |
1295 this._element.remove(); | 1297 this._element.remove(); |
1296 } | 1298 } |
1297 } | 1299 } |
OLD | NEW |