Changeset 56613 in webkit
- Timestamp:
- Mar 26, 2010 1:05:08 AM (14 years ago)
- Location:
- trunk/WebCore
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebCore/ChangeLog
r56610 r56613 1 2010-03-25 Ilya Tikhonovsky <loislo@chromium.org> 2 3 Reviewed by Pavel Feldman. 4 5 Web Inspector: Shot record filter is implemented in Timeline Panel. 6 https://bugs.webkit.org/show_bug.cgi?id=36606 7 8 * English.lproj/localizedStrings.js: 9 * inspector/front-end/TimelinePanel.js: 10 (WebInspector.TimelinePanel): 11 (WebInspector.TimelinePanel.prototype.get statusBarItems): 12 (WebInspector.TimelinePanel.prototype._createStatusbarButtons): 13 (WebInspector.TimelinePanel.prototype._toggleFilterButtonClicked): 14 (WebInspector.TimelinePanel.prototype._innerAddRecordToTimeline): 15 (WebInspector.TimelinePanel.prototype._addToRecordsWindow): 16 (WebInspector.TimelineRecordGraphRow.prototype.update): 17 (WebInspector.TimelinePanel.FormattedRecord.prototype.get _isLongEvent): 18 * inspector/front-end/inspector.css: 19 1 20 2010-03-25 Pavel Feldman <pfeldman@chromium.org> 2 21 -
trunk/WebCore/inspector/front-end/TimelinePanel.js
r56467 r56613 84 84 85 85 this._calculator = new WebInspector.TimelineCalculator(); 86 this._calculator._showShortEvents = false; 86 87 this._boundariesAreValid = true; 87 88 this._scrollTop = 0; 88 89 89 90 this._popoverHelper = new WebInspector.PopoverHelper(this._containerElement, this._getPopoverAnchor.bind(this), this._showPopover.bind(this), true); 91 92 // Disable short events filter by default. 93 this.toggleFilterButton.toggled = true; 94 this._calculator._showShortEvents = this.toggleFilterButton.toggled; 90 95 } 91 96 … … 100 105 get statusBarItems() 101 106 { 102 return [this.toggle TimelineButton.element, this.clearButton.element];107 return [this.toggleFilterButton.element, this.toggleTimelineButton.element, this.clearButton.element]; 103 108 }, 104 109 … … 149 154 _createStatusbarButtons: function() 150 155 { 151 this.toggleTimelineButton = new WebInspector.StatusBarButton( "", "record-profile-status-bar-item");156 this.toggleTimelineButton = new WebInspector.StatusBarButton(WebInspector.UIString("Record"), "record-profile-status-bar-item"); 152 157 this.toggleTimelineButton.addEventListener("click", this._toggleTimelineButtonClicked.bind(this), false); 153 158 154 this.clearButton = new WebInspector.StatusBarButton( "", "timeline-clear-status-bar-item");159 this.clearButton = new WebInspector.StatusBarButton(WebInspector.UIString("Clear"), "timeline-clear-status-bar-item"); 155 160 this.clearButton.addEventListener("click", this._clearPanel.bind(this), false); 161 162 this.toggleFilterButton = new WebInspector.StatusBarButton(WebInspector.UIString("Show short records"), "timeline-filter-status-bar-item"); 163 this.toggleFilterButton.addEventListener("click", this._toggleFilterButtonClicked.bind(this), false); 156 164 }, 157 165 … … 164 172 InspectorBackend.startTimelineProfiler(); 165 173 } 174 }, 175 176 _toggleFilterButtonClicked: function() 177 { 178 this.toggleFilterButton.toggled = !this.toggleFilterButton.toggled; 179 this._calculator._showShortEvents = this.toggleFilterButton.toggled; 180 this._scheduleRefresh(true); 166 181 }, 167 182 … … 219 234 formattedRecord.collapsed = true; 220 235 221 // Glue subsequent records with same category and title together if they are closer than 100ms to each other. 222 var lastRecord = parentRecord._lastRecord; 223 if (lastRecord && (!record.children || !record.children.length) && 224 lastRecord.category == formattedRecord.category && 225 lastRecord.title == formattedRecord.title && 226 lastRecord.details == formattedRecord.details && 227 lastRecord.callerScriptName == formattedRecord.callerScriptName && 228 lastRecord.callerScriptLine == formattedRecord.callerScriptLine && 229 formattedRecord.startTime - lastRecord.endTime < 0.1) { 230 lastRecord.endTime = formattedRecord.endTime; 231 lastRecord.count++; 232 } else { 233 for (var i = 0; record.children && i < record.children.length; ++i) 234 this._innerAddRecordToTimeline(record.children[i], formattedRecord); 235 parentRecord._lastRecord = record.children && record.children.length ? null : formattedRecord; 236 } 236 var hasLongChildrenEvents = false; 237 for (var i = 0; record.children && i < record.children.length; ++i) 238 hasLongChildrenEvents |= this._innerAddRecordToTimeline(record.children[i], formattedRecord); 239 formattedRecord._hasLongChildrenEvents = hasLongChildrenEvents; 237 240 238 241 if (connectedToOldRecord) { … … 242 245 record = record.parent; 243 246 } 244 } 247 // We have attached a fresh event record received from Timeline Agent to some old event record. 248 // If that old parent record haven't had long children events and new child record has it 249 // then we want to propagate _hasLongChildrenEvents flag to parent, grand-parent etc. 250 if (record._isLongEvent()) { 251 record = formattedRecord; 252 while (record.parent && !record.parent._isLongEvent()) { 253 record = record.parent; 254 record._hasLongChildrenEvents = true; 255 } 256 } 257 } 258 return hasLongChildrenEvents || formattedRecord._isLongEvent(); 245 259 }, 246 260 … … 269 283 var rootRecord = {}; 270 284 rootRecord.children = []; 271 rootRecord._lastRecord = null;272 285 return rootRecord; 273 286 }, … … 360 373 _addToRecordsWindow: function(record, recordsWindow) 361 374 { 375 if (!this._calculator._showShortEvents && !record._isLongEvent()) 376 return; 377 362 378 recordsWindow.push(record); 379 var index = recordsWindow.length; 363 380 if (!record.collapsed) { 364 var index = recordsWindow.length;365 381 for (var i = 0; i < record.children.length; ++i) 366 382 this._addToRecordsWindow(record.children[i], recordsWindow); 367 record.visibleChildrenCount = recordsWindow.length - index;368 }383 } 384 record.visibleChildrenCount = recordsWindow.length - index; 369 385 }, 370 386 … … 652 668 this._barElement.style.width = barPosition.width + "px"; 653 669 654 if (record. children.length) {670 if (record.visibleChildrenCount || record._hasLongChildrenEvents || (calculator._showShortEvents && record.children.length)) { 655 671 this._expandElement.style.top = index * this._rowHeight + "px"; 656 672 this._expandElement.style.left = barPosition.left + "px"; … … 738 754 739 755 WebInspector.TimelinePanel.FormattedRecord.prototype = { 756 _isLongEvent: function() 757 { 758 const shortEventLength = 0.015; 759 return (this._lastChildEndTime - this.startTime) > shortEventLength; 760 }, 761 740 762 _createCell: function(content, styleName) 741 763 { -
trunk/WebCore/inspector/front-end/inspector.css
r56608 r56613 3627 3627 } 3628 3628 3629 .timeline-details { 3630 -webkit-user-select: text; 3631 } 3632 3633 .timeline-details-row-title { 3634 font-weight: bold; 3635 text-align: right; 3636 white-space: nowrap; 3637 } 3638 3639 .timeline-details-row-data { 3640 white-space: nowrap; 3641 } 3642 3643 .timeline-details-title { 3644 font-weight: bold; 3645 white-space: nowrap; 3646 } 3647 3648 .timeline-filter-status-bar-item .glyph { 3649 -webkit-mask-image: url(Images/largerResourcesButtonGlyph.png); 3650 } 3651 3652 .timeline-filter-status-bar-item.toggled-on .glyph { 3653 background-color: rgb(66, 129, 235) !important; 3654 } 3655 3629 3656 /* Profiler Style */ 3630 3657 … … 3889 3916 } 3890 3917 3891 .timeline-details {3892 -webkit-user-select: text;3893 }3894 3895 .timeline-details-row-title {3896 font-weight: bold;3897 text-align: right;3898 white-space: nowrap;3899 }3900 3901 .timeline-details-row-data {3902 white-space: nowrap;3903 }3904 3905 .timeline-details-title {3906 font-weight: bold;3907 white-space: nowrap;3908 }3909 3910 3918 .workers-list { 3911 3919 list-style: none;
Note: See TracChangeset
for help on using the changeset viewer.