Changeset 140123 in webkit


Ignore:
Timestamp:
Jan 18, 2013 4:15:29 AM (11 years ago)
Author:
commit-queue@webkit.org
Message:

Web Inspector: Timeline: nest time/timeEnd records when possible (in glue-mode)
https://bugs.webkit.org/show_bug.cgi?id=100114

Patch by Eugene Klyuchnikov <eustas.bug@gmail.com> on 2013-01-18
Reviewed by Pavel Feldman.

Source/WebCore:

Nesting time/timeEnd intervals will provide a better overview on
what is happening.

  • inspector/front-end/TimelinePresentationModel.js: Added logic that

reparents "time" record when "timeEnd" arrives.

LayoutTests:

Changed test to adopt new gluing rules.

  • inspector/timeline/timeline-time.html: Updated test.
Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r140121 r140123  
     12013-01-18  Eugene Klyuchnikov  <eustas.bug@gmail.com>
     2
     3        Web Inspector: Timeline: nest time/timeEnd records when possible (in glue-mode)
     4        https://bugs.webkit.org/show_bug.cgi?id=100114
     5
     6        Reviewed by Pavel Feldman.
     7
     8        Changed test to adopt new gluing rules.
     9
     10        * inspector/timeline/timeline-time.html: Updated test.
     11
    1122013-01-18  Zan Dobersek  <zdobersek@igalia.com>
    213
  • trunk/LayoutTests/inspector/timeline/timeline-time.html

    r133863 r140123  
    4949    {
    5050        var root = presentationModel.rootRecord();
    51         InspectorTest.assertEquals(5, root.children.length);
     51        InspectorTest.assertEquals(4, root.children.length);
    5252
    5353        var time1 = root.children[1];
    5454        InspectorTest.assertEquals("Time", time1.type);
    55         InspectorTest.assertEquals(1, time1.children.length);
    56         var timeEnd1 = time1.children[0];
     55        InspectorTest.assertEquals(2, time1.children.length);
     56        var timeEnd1 = time1.children[1];
    5757        InspectorTest.assertEquals("TimeEnd", timeEnd1.type);
    5858        InspectorTest.assertEquals(time1, timeEnd1.timeRecord);
    5959        InspectorTest.assertEquals(timeEnd1, time1.timeEndRecord);
    6060
    61         var time2 = root.children[3];
     61        var time2 = time1.children[0];
    6262        InspectorTest.assertEquals("Time", time2.type);
    6363        InspectorTest.assertEquals(1, time2.children.length);
  • trunk/Source/WebCore/ChangeLog

    r140122 r140123  
     12013-01-18  Eugene Klyuchnikov  <eustas.bug@gmail.com>
     2
     3        Web Inspector: Timeline: nest time/timeEnd records when possible (in glue-mode)
     4        https://bugs.webkit.org/show_bug.cgi?id=100114
     5
     6        Reviewed by Pavel Feldman.
     7
     8        Nesting time/timeEnd intervals will provide a better overview on
     9        what is happening.
     10
     11        * inspector/front-end/TimelinePresentationModel.js: Added logic that
     12        reparents "time" record when "timeEnd" arrives.
     13
    1142013-01-18  Pavel Feldman  <pfeldman@chromium.org>
    215
  • trunk/Source/WebCore/inspector/front-end/TimelinePresentationModel.js

    r138244 r140123  
    263263        this._requestAnimationFrameRecords = {};
    264264        this._timeRecords = {};
     265        this._timeRecordStack = [];
    265266        this._frames = [];
    266267        this._minimumRecordTime = -1;
     
    586587
    587588    case recordTypes.Time:
    588         presentationModel._timeRecords[record.data["message"]] = this;
     589        var message = record.data["message"];
     590        var oldReference = presentationModel._timeRecords[message];
     591        if (oldReference)
     592            break;
     593        presentationModel._timeRecords[message] = this;
     594        if (origin)
     595            presentationModel._timeRecordStack.push(this);
    589596        break;
    590597
     
    599606            this.intervalDuration = intervalDuration;
    600607            timeRecord.intervalDuration = intervalDuration;
     608            if (!origin)
     609                break;
     610            var recordStack = presentationModel._timeRecordStack;
     611            recordStack.splice(recordStack.indexOf(timeRecord), 1);
     612            for (var index = recordStack.length; index; --index) {
     613                var openRecord = recordStack[index - 1];
     614                if (openRecord.startTime > timeRecord.startTime)
     615                    continue;
     616                function compareStartTime(value, record)
     617                {
     618                    return value < record.startTime ? -1 : 1;
     619                }
     620                timeRecord.parent.children.splice(timeRecord.parent.children.indexOf(timeRecord));
     621                openRecord.children.splice(insertionIndexForObjectInListSortedByFunction(timeRecord.startTime, openRecord.children, compareStartTime), 0, timeRecord);
     622                break;
     623            }
    601624        }
    602625        break;
Note: See TracChangeset for help on using the changeset viewer.