Changeset 120988 in webkit
- Timestamp:
- Jun 21, 2012, 6:30:19 PM (13 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r120985 r120988 1 2012-06-21 Andrey Kosyakov <caseq@chromium.org> 2 3 Web Inspector: exception in TimelinePresentationModel when recording timeline 4 https://bugs.webkit.org/show_bug.cgi?id=89716 5 6 Reviewed by Pavel Feldman. 7 8 * inspector/front-end/TimelinePanel.js: 9 (WebInspector.TimelinePanel.prototype._innerAddRecordToTimeline.processRecord): 10 (WebInspector.TimelinePanel.prototype._innerAddRecordToTimeline): 11 * inspector/front-end/TimelinePresentationModel.js: 12 (WebInspector.TimelinePresentationModel.prototype.filteredRecords): 13 (WebInspector.TimelinePresentationModel.prototype.isVisible): 14 1 15 2012-06-21 Oli Lan <olilan@chromium.org> 2 16 -
trunk/Source/WebCore/inspector/front-end/TimelinePanel.js
r120891 r120988 497 497 var recordTypes = WebInspector.TimelineModel.RecordType; 498 498 var timeStampRecords = this._timeStampRecords; 499 function addTimestampRecords(record) 499 var hasVisibleRecords = false; 500 var presentationModel = this._presentationModel; 501 function processRecord(record) 500 502 { 501 503 if (WebInspector.TimelinePresentationModel.isEventDivider(record)) 502 504 timeStampRecords.push(record); 505 hasVisibleRecords |= presentationModel.isVisible(record); 503 506 } 504 507 var records = [ formattedRecord ]; 505 WebInspector.TimelinePresentationModel.forAllRecords(records, addTimestampRecords); 506 return !!this._presentationModel.filterRecords(records).length || formattedRecord.parent !== this._presentationModel.rootRecord; 508 WebInspector.TimelinePresentationModel.forAllRecords(records, processRecord); 509 // Tell caller update is necessary either if we added a visible record or if we re-parented a record. 510 return hasVisibleRecords || formattedRecord.parent !== this._presentationModel.rootRecord; 507 511 }, 508 512 -
trunk/Source/WebCore/inspector/front-end/TimelinePresentationModel.js
r120891 r120988 296 296 filteredRecords: function() 297 297 { 298 return this.filterRecords(this._rootRecord.children);299 },300 301 filterRecords: function(records)302 {303 function filter(record)304 {305 for (var i = 0; i < this._filters.length; ++i) {306 if (!this._filters[i].accept(record))307 return false;308 }309 return true;310 }311 return this._innerFilterRecords(filter.bind(this), records);312 },313 314 /**315 * @param {function(WebInspector.TimelinePresentationModel.Record):boolean} filter316 * @param {Array.<WebInspector.TimelinePresentationModel.Record>} inputRecords317 */318 _innerFilterRecords: function(filter, inputRecords)319 {320 298 var recordsInWindow = []; 321 299 322 var stack = [{children: inputRecords, index: 0, parentIsCollapsed: false}];300 var stack = [{children: this._rootRecord.children, index: 0, parentIsCollapsed: false}]; 323 301 while (stack.length) { 324 302 var entry = stack[stack.length - 1]; … … 328 306 ++entry.index; 329 307 330 if ( filter(record)) {308 if (this.isVisible(record)) { 331 309 ++record.parent._invisibleChildrenCount; 332 310 if (!entry.parentIsCollapsed) … … 349 327 350 328 return recordsInWindow; 329 }, 330 331 isVisible: function(record) 332 { 333 for (var i = 0; i < this._filters.length; ++i) { 334 if (!this._filters[i].accept(record)) 335 return false; 336 } 337 return true; 351 338 } 352 339 }
Note:
See TracChangeset
for help on using the changeset viewer.