| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2014 Google Inc. All rights reserved. | 2 * Copyright (C) 2014 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 920 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 931 * @override | 931 * @override |
| 932 * @param {number} index | 932 * @param {number} index |
| 933 * @return {boolean} | 933 * @return {boolean} |
| 934 */ | 934 */ |
| 935 forceDecoration: function(index) | 935 forceDecoration: function(index) |
| 936 { | 936 { |
| 937 return true; | 937 return true; |
| 938 }, | 938 }, |
| 939 | 939 |
| 940 /** | 940 /** |
| 941 * @override |
| 942 * @param {number} index |
| 943 * @return {?Array<!{title: string, value: (string|!Element)}>} |
| 944 */ |
| 945 prepareHighlightedEntryInfo: function(index) |
| 946 { |
| 947 var /** @const */ maxURLChars = 80; |
| 948 var request = /** @type {!WebInspector.TimelineModel.NetworkRequest} */
(this._requests[index]); |
| 949 if (!request.url) |
| 950 return null; |
| 951 var value = createElement("div"); |
| 952 var duration = request.endTime - request.startTime; |
| 953 if (request.startTime && isFinite(duration)) |
| 954 value.createChild("span", "timeline-network-info-duration").textCont
ent = Number.millisToString(duration); |
| 955 value.createChild("span", "timeline-network-info-method").textContent =
request.requestMethod; |
| 956 value.createChild("span", "timeline-network-info-url").textContent = req
uest.url.trimMiddle(maxURLChars); |
| 957 return [{ title: "", value: value }]; |
| 958 }, |
| 959 |
| 960 /** |
| 941 * @param {!Array.<!WebInspector.TracingModel.Event>} events | 961 * @param {!Array.<!WebInspector.TracingModel.Event>} events |
| 942 */ | 962 */ |
| 943 _appendTimelineData: function(events) | 963 _appendTimelineData: function(events) |
| 944 { | 964 { |
| 945 this._minimumBoundary = this._model.minimumRecordTime(); | 965 this._minimumBoundary = this._model.minimumRecordTime(); |
| 946 this._maximumBoundary = this._model.maximumRecordTime(); | 966 this._maximumBoundary = this._model.maximumRecordTime(); |
| 947 this._timeSpan = this._model.isEmpty() ? 1000 : this._maximumBoundary -
this._minimumBoundary; | 967 this._timeSpan = this._model.isEmpty() ? 1000 : this._maximumBoundary -
this._minimumBoundary; |
| 948 this._model.networkRequests().forEach(this._appendEntry.bind(this)); | 968 this._model.networkRequests().forEach(this._appendEntry.bind(this)); |
| 949 this._updateTimelineData(); | 969 this._updateTimelineData(); |
| 950 }, | 970 }, |
| (...skipping 339 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1290 /** | 1310 /** |
| 1291 * @constructor | 1311 * @constructor |
| 1292 * @param {!WebInspector.TimelineSelection} selection | 1312 * @param {!WebInspector.TimelineSelection} selection |
| 1293 * @param {number} entryIndex | 1313 * @param {number} entryIndex |
| 1294 */ | 1314 */ |
| 1295 WebInspector.TimelineFlameChartView.Selection = function(selection, entryIndex) | 1315 WebInspector.TimelineFlameChartView.Selection = function(selection, entryIndex) |
| 1296 { | 1316 { |
| 1297 this.timelineSelection = selection; | 1317 this.timelineSelection = selection; |
| 1298 this.entryIndex = entryIndex; | 1318 this.entryIndex = entryIndex; |
| 1299 } | 1319 } |
| OLD | NEW |