| 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 716 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 727 * @param {?Map<number, ?SDK.DOMNode>} relatedNodesMap | 727 * @param {?Map<number, ?SDK.DOMNode>} relatedNodesMap |
| 728 * @return {!DocumentFragment} | 728 * @return {!DocumentFragment} |
| 729 */ | 729 */ |
| 730 static _buildTraceEventDetailsSynchronously(event, model, linkifier, detailed,
relatedNodesMap) { | 730 static _buildTraceEventDetailsSynchronously(event, model, linkifier, detailed,
relatedNodesMap) { |
| 731 var recordTypes = TimelineModel.TimelineModel.RecordType; | 731 var recordTypes = TimelineModel.TimelineModel.RecordType; |
| 732 // This message may vary per event.name; | 732 // This message may vary per event.name; |
| 733 var relatedNodeLabel; | 733 var relatedNodeLabel; |
| 734 | 734 |
| 735 var contentHelper = new Timeline.TimelineDetailsContentHelper(model.targetBy
Event(event), linkifier); | 735 var contentHelper = new Timeline.TimelineDetailsContentHelper(model.targetBy
Event(event), linkifier); |
| 736 contentHelper.addSection( | 736 contentHelper.addSection( |
| 737 Timeline.TimelineUIUtils.eventTitle(event), Timeline.TimelineUIUtils.eve
ntStyle(event).category); | 737 Timeline.TimelineUIUtils.eventTitle(event), Timeline.TimelineUIUtils.eve
ntStyle(event).category.color); |
| 738 | 738 |
| 739 var eventData = event.args['data']; | 739 var eventData = event.args['data']; |
| 740 var timelineData = TimelineModel.TimelineData.forEvent(event); | 740 var timelineData = TimelineModel.TimelineData.forEvent(event); |
| 741 var initiator = timelineData.initiator(); | 741 var initiator = timelineData.initiator(); |
| 742 | 742 |
| 743 if (timelineData.warning) | 743 if (timelineData.warning) |
| 744 contentHelper.appendWarningRow(event); | 744 contentHelper.appendWarningRow(event); |
| 745 if (event.name === recordTypes.JSFrame && eventData['deoptReason']) | 745 if (event.name === recordTypes.JSFrame && eventData['deoptReason']) |
| 746 contentHelper.appendWarningRow(event, TimelineModel.TimelineModel.WarningT
ype.V8Deopt); | 746 contentHelper.appendWarningRow(event, TimelineModel.TimelineModel.WarningT
ype.V8Deopt); |
| 747 | 747 |
| (...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1010 aggregatedStats[categoryName] = (aggregatedStats[categoryName] || 0) + ownTi
me; | 1010 aggregatedStats[categoryName] = (aggregatedStats[categoryName] || 0) + ownTi
me; |
| 1011 } | 1011 } |
| 1012 | 1012 |
| 1013 /** | 1013 /** |
| 1014 * @param {!TimelineModel.TimelineModel.NetworkRequest} request | 1014 * @param {!TimelineModel.TimelineModel.NetworkRequest} request |
| 1015 * @param {!TimelineModel.TimelineModel} model | 1015 * @param {!TimelineModel.TimelineModel} model |
| 1016 * @param {!Components.Linkifier} linkifier | 1016 * @param {!Components.Linkifier} linkifier |
| 1017 * @return {!Promise<!DocumentFragment>} | 1017 * @return {!Promise<!DocumentFragment>} |
| 1018 */ | 1018 */ |
| 1019 static buildNetworkRequestDetails(request, model, linkifier) { | 1019 static buildNetworkRequestDetails(request, model, linkifier) { |
| 1020 var target = model.targetByEvent(request.children[0]); | 1020 const target = model.targetByEvent(request.children[0]); |
| 1021 var contentHelper = new Timeline.TimelineDetailsContentHelper(target, linkif
ier); | 1021 const contentHelper = new Timeline.TimelineDetailsContentHelper(target, link
ifier); |
| 1022 const category = Timeline.TimelineUIUtils.networkRequestCategory(request); |
| 1023 const color = Timeline.TimelineUIUtils.networkCategoryColor(category); |
| 1024 contentHelper.addSection(Common.UIString('Network request'), color); |
| 1022 | 1025 |
| 1023 var duration = request.endTime - (request.startTime || -Infinity); | 1026 const duration = request.endTime - (request.startTime || -Infinity); |
| 1024 if (request.url) | 1027 if (request.url) |
| 1025 contentHelper.appendElementRow(Common.UIString('URL'), Components.Linkifie
r.linkifyURL(request.url)); | 1028 contentHelper.appendElementRow(Common.UIString('URL'), Components.Linkifie
r.linkifyURL(request.url)); |
| 1026 if (isFinite(duration)) | 1029 if (isFinite(duration)) |
| 1027 contentHelper.appendTextRow(Common.UIString('Duration'), Number.millisToSt
ring(duration, true)); | 1030 contentHelper.appendTextRow(Common.UIString('Duration'), Number.millisToSt
ring(duration, true)); |
| 1028 if (request.requestMethod) | 1031 if (request.requestMethod) |
| 1029 contentHelper.appendTextRow(Common.UIString('Request Method'), request.req
uestMethod); | 1032 contentHelper.appendTextRow(Common.UIString('Request Method'), request.req
uestMethod); |
| 1030 if (typeof request.priority === 'string') { | 1033 if (typeof request.priority === 'string') { |
| 1031 var priority = | 1034 var priority = |
| 1032 Components.uiLabelForPriority(/** @type {!Protocol.Network.ResourcePri
ority} */ (request.priority)); | 1035 Components.uiLabelForPriority(/** @type {!Protocol.Network.ResourcePri
ority} */ (request.priority)); |
| 1033 contentHelper.appendTextRow(Common.UIString('Priority'), priority); | 1036 contentHelper.appendTextRow(Common.UIString('Priority'), priority); |
| (...skipping 1071 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2105 this._linkifier = linkifier; | 2108 this._linkifier = linkifier; |
| 2106 this._target = target; | 2109 this._target = target; |
| 2107 | 2110 |
| 2108 this.element = createElementWithClass('div', 'timeline-details-view-block'); | 2111 this.element = createElementWithClass('div', 'timeline-details-view-block'); |
| 2109 this._tableElement = this.element.createChild('div', 'vbox timeline-details-
chip-body'); | 2112 this._tableElement = this.element.createChild('div', 'vbox timeline-details-
chip-body'); |
| 2110 this.fragment.appendChild(this.element); | 2113 this.fragment.appendChild(this.element); |
| 2111 } | 2114 } |
| 2112 | 2115 |
| 2113 /** | 2116 /** |
| 2114 * @param {string} title | 2117 * @param {string} title |
| 2115 * @param {!Timeline.TimelineCategory=} category | 2118 * @param {string=} swatchColor |
| 2116 */ | 2119 */ |
| 2117 addSection(title, category) { | 2120 addSection(title, swatchColor) { |
| 2118 if (!this._tableElement.hasChildNodes()) { | 2121 if (!this._tableElement.hasChildNodes()) { |
| 2119 this.element.removeChildren(); | 2122 this.element.removeChildren(); |
| 2120 } else { | 2123 } else { |
| 2121 this.element = createElementWithClass('div', 'timeline-details-view-block'
); | 2124 this.element = createElementWithClass('div', 'timeline-details-view-block'
); |
| 2122 this.fragment.appendChild(this.element); | 2125 this.fragment.appendChild(this.element); |
| 2123 } | 2126 } |
| 2124 | 2127 |
| 2125 if (title) { | 2128 if (title) { |
| 2126 var titleElement = this.element.createChild('div', 'timeline-details-chip-
title'); | 2129 var titleElement = this.element.createChild('div', 'timeline-details-chip-
title'); |
| 2127 if (category) | 2130 if (swatchColor) |
| 2128 titleElement.createChild('div').style.backgroundColor = category.color; | 2131 titleElement.createChild('div').style.backgroundColor = swatchColor; |
| 2129 titleElement.createTextChild(title); | 2132 titleElement.createTextChild(title); |
| 2130 } | 2133 } |
| 2131 | 2134 |
| 2132 this._tableElement = this.element.createChild('div', 'vbox timeline-details-
chip-body'); | 2135 this._tableElement = this.element.createChild('div', 'vbox timeline-details-
chip-body'); |
| 2133 this.fragment.appendChild(this.element); | 2136 this.fragment.appendChild(this.element); |
| 2134 } | 2137 } |
| 2135 | 2138 |
| 2136 /** | 2139 /** |
| 2137 * @return {?Components.Linkifier} | 2140 * @return {?Components.Linkifier} |
| 2138 */ | 2141 */ |
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2235 /** | 2238 /** |
| 2236 * @param {!SDK.TracingModel.Event} event | 2239 * @param {!SDK.TracingModel.Event} event |
| 2237 * @param {string=} warningType | 2240 * @param {string=} warningType |
| 2238 */ | 2241 */ |
| 2239 appendWarningRow(event, warningType) { | 2242 appendWarningRow(event, warningType) { |
| 2240 var warning = Timeline.TimelineUIUtils.eventWarning(event, warningType); | 2243 var warning = Timeline.TimelineUIUtils.eventWarning(event, warningType); |
| 2241 if (warning) | 2244 if (warning) |
| 2242 this.appendElementRow(Common.UIString('Warning'), warning, true); | 2245 this.appendElementRow(Common.UIString('Warning'), warning, true); |
| 2243 } | 2246 } |
| 2244 }; | 2247 }; |
| OLD | NEW |