Changeset 218781 in webkit
- Timestamp:
- Jun 23, 2017 7:45:51 PM (7 years ago)
- Location:
- trunk/Source/WebInspectorUI
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebInspectorUI/ChangeLog
r218777 r218781 1 2017-06-23 Joseph Pecoraro <pecoraro@apple.com> 2 3 Web Inspector: Script Timeline bubbles sometimes appear to miss large events 4 https://bugs.webkit.org/show_bug.cgi?id=173746 5 <rdar://problem/32950808> 6 7 Reviewed by Brian Burg. 8 9 * UserInterface/Models/Timeline.js: 10 (WebInspector.Timeline.prototype.addRecord): 11 (WebInspector.Timeline.prototype._tryInsertInSortedOrder): 12 The list of records is assumed to be sorted by the code that draws bubbles 13 however the order in which we receive them may not be sorted. Make a quick 14 effort to sort recent records so that as we are drawing the timeline it is 15 more accurate. 16 1 17 2017-06-23 Brian Burg <bburg@apple.com> 2 18 -
trunk/Source/WebInspectorUI/UserInterface/Models/Timeline.js
r204507 r218781 72 72 record.addEventListener(WebInspector.TimelineRecord.Event.Updated, this._recordUpdated, this); 73 73 74 this._records.push(record); 74 // Because records can be nested, it is possible that outer records with an early start time 75 // may be completed and added to the Timeline after inner records with a later start time 76 // were already added. In most cases this is a small drift, so make an effort to still keep 77 // the list sorted. Do it now, when inserting, so if the timeline is visible it has the 78 // best chance of being as accurate as possible during a recording. 79 this._tryInsertingRecordInSortedOrder(record); 75 80 76 81 this._updateTimesIfNeeded(record); … … 125 130 this._updateTimesIfNeeded(event.target); 126 131 } 132 133 _tryInsertingRecordInSortedOrder(record) 134 { 135 // Fast case add to the end. 136 let lastValue = this._records.lastValue; 137 if (!lastValue || lastValue.startTime < record.startTime || record.updatesDynamically) { 138 this._records.push(record); 139 return; 140 } 141 142 // Slow case, try to insert in the last 20 records. 143 let start = this._records.length - 2; 144 let end = Math.max(this._records.length - 20, 0); 145 for (let i = start; i >= end; --i) { 146 if (this._records[i].startTime < record.startTime) { 147 this._records.insertAtIndex(record, i + 1); 148 return; 149 } 150 } 151 152 // Give up and add to the end. 153 this._records.push(record); 154 } 127 155 }; 128 156
Note: See TracChangeset
for help on using the changeset viewer.