Changeset 56997 in webkit


Ignore:
Timestamp:
Apr 2, 2010 5:17:17 AM (14 years ago)
Author:
loislo@chromium.org
Message:

2010-04-02 Ilya Tikhonovsky <loislo@chromium.org>

Reviewed by Pavel Feldman.

WebInspector: Timeline Overview pane should support short records filtering.
https://bugs.webkit.org/show_bug.cgi?id=37020

  • English.lproj/localizedStrings.js:
  • inspector/front-end/TimelineOverviewPane.js: (WebInspector.TimelineOverviewPane.prototype.update.markTimeline): (WebInspector.TimelineOverviewPane.prototype.update):
  • inspector/front-end/TimelinePanel.js: (WebInspector.TimelinePanel): (WebInspector.TimelinePanel.prototype._createStatusbarButtons): (WebInspector.TimelinePanel.prototype._toggleFilterButtonClicked): (WebInspector.TimelinePanel.prototype._refresh): (WebInspector.TimelinePanel.prototype._addToRecordsWindow): (WebInspector.TimelinePanel.FormattedRecord.prototype.isLong):
Location:
trunk/WebCore
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/ChangeLog

    r56994 r56997  
     12010-04-02  Ilya Tikhonovsky  <loislo@chromium.org>
     2
     3        Reviewed by Pavel Feldman.
     4
     5        WebInspector: Timeline Overview pane should support short records filtering.
     6        https://bugs.webkit.org/show_bug.cgi?id=37020
     7
     8        * English.lproj/localizedStrings.js:
     9        * inspector/front-end/TimelineOverviewPane.js:
     10        (WebInspector.TimelineOverviewPane.prototype.update.markTimeline):
     11        (WebInspector.TimelineOverviewPane.prototype.update):
     12        * inspector/front-end/TimelinePanel.js:
     13        (WebInspector.TimelinePanel):
     14        (WebInspector.TimelinePanel.prototype._createStatusbarButtons):
     15        (WebInspector.TimelinePanel.prototype._toggleFilterButtonClicked):
     16        (WebInspector.TimelinePanel.prototype._refresh):
     17        (WebInspector.TimelinePanel.prototype._addToRecordsWindow):
     18        (WebInspector.TimelinePanel.FormattedRecord.prototype.isLong):
     19
    1202010-04-02  Laszlo Gombos  <laszlo.1.gombos@nokia.com>
    221
  • trunk/WebCore/inspector/front-end/TimelineOverviewPane.js

    r55530 r56997  
    9393}
    9494
    95 
    9695WebInspector.TimelineOverviewPane.prototype = {
    9796    _onCheckboxClicked: function (category, event) {
     
    104103    },
    105104
    106     update: function(records)
    107     {
     105    update: function(records, showShortEvents)
     106    {
     107        this._showShortEvents = showShortEvents;
    108108        // Clear summary bars.
    109109        var timelines = {};
     
    129129        function markTimeline(record)
    130130        {
     131            if (!(this._showShortEvents || record.isLong()))
     132                return;
    131133            var percentages = this._overviewCalculator.computeBarGraphPercentages(record);
    132134
  • trunk/WebCore/inspector/front-end/TimelinePanel.js

    r56789 r56997  
    7777    this._itemsGraphsElement.appendChild(this._bottomGapElement);
    7878
    79     this._createStatusbarButtons();
    80 
    8179    this._rootRecord = this._createRootRecord();
    8280    this._sendRequestRecords = {};
     
    8583    this._calculator = new WebInspector.TimelineCalculator();
    8684    this._calculator._showShortEvents = false;
     85    var shortRecordThresholdTitle = Number.secondsToString(WebInspector.TimelinePanel.shortRecordThreshold, WebInspector.UIString.bind(WebInspector));
     86    this._showShortRecordsTitleText = WebInspector.UIString("Show the records that are shorter than %s", shortRecordThresholdTitle);
     87    this._hideShortRecordsTitleText = WebInspector.UIString("Hide the records that are shorter than %s", shortRecordThresholdTitle);
     88    this._createStatusbarButtons();
     89
    8790    this._boundariesAreValid = true;
    8891    this._scrollTop = 0;
     
    9497    this._calculator._showShortEvents = this.toggleFilterButton.toggled;
    9598}
     99
     100WebInspector.TimelinePanel.shortRecordThreshold = 0.015;
    96101
    97102WebInspector.TimelinePanel.prototype = {
     
    160165        this.clearButton.addEventListener("click", this._clearPanel.bind(this), false);
    161166
    162         this.toggleFilterButton = new WebInspector.StatusBarButton(WebInspector.UIString("Hide short records"), "timeline-filter-status-bar-item");
     167        this.toggleFilterButton = new WebInspector.StatusBarButton(this._hideShortRecordsTitleText, "timeline-filter-status-bar-item");
    163168        this.toggleFilterButton.addEventListener("click", this._toggleFilterButtonClicked.bind(this), false);
    164169
     
    186191        this.toggleFilterButton.toggled = !this.toggleFilterButton.toggled;
    187192        this._calculator._showShortEvents = this.toggleFilterButton.toggled;
    188         this.toggleFilterButton.element.title = this._calculator._showShortEvents ? WebInspector.UIString("Hide short records") : WebInspector.UIString("Show short records");
     193        this.toggleFilterButton.element.title = this._calculator._showShortEvents ? this._hideShortRecordsTitleText : this._showShortRecordsTitleText;
    189194        this._scheduleRefresh(true);
    190195    },
     
    352357        }
    353358
    354         if (!this._boundariesAreValid)
    355             this._overviewPane.update(this._rootRecord.children);
     359        this._overviewPane.update(this._rootRecord.children, this._calculator._showShortEvents);
    356360        this._refreshRecords(!this._boundariesAreValid);
    357361        this._updateRecordsCounter();
     
    373377    _addToRecordsWindow: function(record, recordsWindow, parentIsCollapsed)
    374378    {
    375         if (!this._calculator._showShortEvents && !record._isLongEvent())
     379        if (!this._calculator._showShortEvents && !record.isLong())
    376380            return;
    377381        var percentages = this._calculator.computeBarGraphPercentages(record);
     
    758762
    759763WebInspector.TimelinePanel.FormattedRecord.prototype = {
    760     _isLongEvent: function()
    761     {
    762         const shortEventLength = 0.015;
    763         return (this._lastChildEndTime - this.startTime) > shortEventLength;
     764    isLong: function()
     765    {
     766        return (this._lastChildEndTime - this.startTime) > WebInspector.TimelinePanel.shortRecordThreshold;
    764767    },
    765768
Note: See TracChangeset for help on using the changeset viewer.