⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 119485 in webkit


Ignore:
Timestamp:
Jun 5, 2012, 7:50:04 AM (14 years ago)
Author:
caseq@chromium.org
Message:

Web Inspector: aggregate all events before first frame into a fake frame
https://bugs.webkit.org/show_bug.cgi?id=88229

  • in Timeline's frame mode, start aggregating events by frame even before we get first frame marker.
  • inspector/front-end/TimelineFrameController.js:

(WebInspector.TimelineFrameController.prototype._addRecord):
(WebInspector.TimelineFrameController.prototype._flushFrame):
(WebInspector.TimelineFrameController.prototype._createFrame):

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r119484 r119485  
     12012-06-05  Andrey Kosyakov  <caseq@chromium.org>
     2
     3        Web Inspector: aggregate all events before first frame into a fake frame
     4        https://bugs.webkit.org/show_bug.cgi?id=88229
     5
     6        - in Timeline's frame mode, start aggregating events by frame even before we get first frame marker.
     7
     8        * inspector/front-end/TimelineFrameController.js:
     9        (WebInspector.TimelineFrameController.prototype._addRecord):
     10        (WebInspector.TimelineFrameController.prototype._flushFrame):
     11        (WebInspector.TimelineFrameController.prototype._createFrame):
     12
    1132012-06-05  Charles Wei  <charles.wei@torchmobile.com.cn>
    214
  • trunk/Source/WebCore/inspector/front-end/TimelineFrameController.js

    r113994 r119485  
    6262    _addRecord: function(record)
    6363    {
    64         if (record.type === WebInspector.TimelineModel.RecordType.BeginFrame)
     64        if (record.type === WebInspector.TimelineModel.RecordType.BeginFrame && this._lastFrame)
    6565            this._flushFrame(record);
    66         else if (this._lastFrame) {
     66        else {
     67            if (!this._lastFrame)
     68                this._lastFrame = this._createFrame(record);
    6769            WebInspector.TimelineModel.aggregateTimeForRecord(this._lastFrame.timeByCategory, record);
    6870            this._lastFrame.cpuTime += WebInspector.TimelineModel.durationInSeconds(record);
    69         } else {
    70             // No frame records so far -- generate a synthetic frame per each top-level record, but only
    71             // dispatch these to the overview.
    72             this._overviewPane.addFrame(this._createSyntheticFrame(record));
    7371        }
    7472    },
     
    7674    _flushFrame: function(record)
    7775    {
    78         var frameBeginTime = WebInspector.TimelineModel.startTimeInSeconds(record);
    79         if (this._lastFrame) {
    80             this._lastFrame.endTime = frameBeginTime;
    81             this._lastFrame.duration = this._lastFrame.endTime - this._lastFrame.startTime;
    82             this._overviewPane.addFrame(this._lastFrame);
    83             this._presentationModel.addFrame(this._lastFrame);
    84         }
    85         this._lastFrame = new WebInspector.TimelineFrame();
    86         this._lastFrame.startTime = frameBeginTime;
    87         this._lastFrame.startTimeOffset = this._model.recordOffsetInSeconds(record);
     76        this._lastFrame.endTime = WebInspector.TimelineModel.startTimeInSeconds(record);
     77        this._lastFrame.duration = this._lastFrame.endTime - this._lastFrame.startTime;
     78        this._overviewPane.addFrame(this._lastFrame);
     79        this._presentationModel.addFrame(this._lastFrame);
     80        this._lastFrame = this._createFrame(record);
    8881    },
    8982
    90     _createSyntheticFrame: function(record)
     83    _createFrame: function(record)
    9184    {
    9285        var frame = new WebInspector.TimelineFrame();
    9386        frame.startTime = WebInspector.TimelineModel.startTimeInSeconds(record);
    9487        frame.startTimeOffset = this._model.recordOffsetInSeconds(record);
    95         frame.endTime = WebInspector.TimelineModel.endTimeInSeconds(record);
    96         frame.duration = WebInspector.TimelineModel.durationInSeconds(record);
    97         frame.cpuTime = frame.duration;
    9888        return frame;
    9989    },
Note: See TracChangeset for help on using the changeset viewer.