Changeset 56108 in webkit


Ignore:
Timestamp:
Mar 17, 2010 7:08:54 AM (14 years ago)
Author:
pfeldman@chromium.org
Message:

2010-03-17 Ilya Tikhonovsky <loislo@chromium.org>

Reviewed by Pavel Feldman.

WebInspector: Timeline improvements - next iteration.

The top level records should be collapsed.
Virtually linked events should be nested in Timeline like Send Request and
corresponding Received Responce, Timer Install and Timer Fire etc.
It should be possible to see Main Resource request.

https://bugs.webkit.org/show_bug.cgi?id=36122

  • inspector/InspectorController.cpp: (WebCore::InspectorController::resetScriptObjects): (WebCore::InspectorController::didReceiveResponse):
  • inspector/InspectorTimelineAgent.cpp: (WebCore::InspectorTimelineAgent::willReceiveResourceResponse): (WebCore::InspectorTimelineAgent::didReceiveResourceResponse):
  • inspector/InspectorTimelineAgent.h:
  • inspector/front-end/TimelinePanel.js: (WebInspector.TimelinePanel): (WebInspector.TimelinePanel.prototype._createStatusbarButtons): (WebInspector.TimelinePanel.prototype.addRecordToTimeline): (WebInspector.TimelinePanel.prototype._findParentRecord): (WebInspector.TimelinePanel.prototype._innerAddRecordToTimeline): (WebInspector.TimelinePanel.prototype.resize): (WebInspector.TimelinePanel.prototype._createTopLevelRecord): (WebInspector.TimelinePanel.prototype.reset): (WebInspector.TimelinePanel.prototype._clean): (WebInspector.TimelinePanel.prototype._refresh): (WebInspector.TimelinePanel.prototype._refreshRecords): (WebInspector.TimelinePanel.prototype._addToRecordsWindow): (WebInspector.TimelineCalculator.prototype.computeBarGraphPercentages): (WebInspector.TimelineCalculator.prototype.updateBoundaries): (WebInspector.TimelineRecordGraphRow): (WebInspector.TimelineRecordGraphRow.prototype.update): (WebInspector.TimelinePanel.FormattedRecord): (WebInspector.TimelinePanel.FormattedRecord.prototype.get children): (WebInspector.TimelinePanel.FormattedRecord.prototype._generatePopupContent):
  • inspector/front-end/inspector.css:
  • loader/ResourceLoader.cpp: (WebCore::ResourceLoader::didReceiveResponse):
Location:
trunk
Files:
14 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r56106 r56108  
     12010-03-17  Ilya Tikhonovsky  <loislo@chromium.org>
     2
     3        Reviewed by Pavel Feldman.
     4
     5        WebInspector: Timeline improvements - next iteration.
     6
     7        The top level records should be collapsed.
     8        Virtually linked events should be nested in Timeline like Send Request and
     9        corresponding Received Responce, Timer Install and Timer Fire etc.
     10        It should be possible to see Main Resource request.
     11
     12        https://bugs.webkit.org/show_bug.cgi?id=36122
     13
     14        * inspector/timeline-network-resource-expected.txt:
     15        * inspector/timeline-test.js:
     16        (frontend_getTimelineResults):
     17
    1182010-03-17  Csaba Osztrogonác  <ossy@webkit.org>
    219
  • trunk/LayoutTests/inspector/timeline-enum-stability-expected.txt

    r55277 r56108  
    1919WebInspector.TimelineAgent.RecordType.ResourceFinish : 14
    2020WebInspector.TimelineAgent.RecordType.FunctionCall : 15
     21WebInspector.TimelineAgent.RecordType.ResourceReceiveData : 16
    2122
  • trunk/LayoutTests/inspector/timeline-network-resource-expected.txt

    r55614 r56108  
    2121+- url : * DEFINED *
    2222+ }
     23+ children : * DEFINED *
     24+ endTime : * DEFINED *
    2325+ type : 13
    2426
  • trunk/LayoutTests/inspector/timeline-test.js

    r55365 r56108  
    137137        }
    138138    }
    139     addRecords(WebInspector.panels.timeline._records);
     139    addRecords(WebInspector.panels.timeline._rootRecord.children);
    140140    return result;
    141141}
  • trunk/WebCore/ChangeLog

    r56107 r56108  
     12010-03-17 Ilya Tikhonovsky  <loislo@chromium.org>
     2
     3        Reviewed by Pavel Feldman.
     4
     5        WebInspector: Timeline improvements - next iteration.
     6
     7        The top level records should be collapsed.
     8        Virtually linked events should be nested in Timeline like Send Request and
     9        corresponding Received Responce, Timer Install and Timer Fire etc.
     10        It should be possible to see Main Resource request.
     11
     12        https://bugs.webkit.org/show_bug.cgi?id=36122
     13
     14        * inspector/InspectorController.cpp:
     15        (WebCore::InspectorController::resetScriptObjects):
     16        (WebCore::InspectorController::didReceiveResponse):
     17        * inspector/InspectorTimelineAgent.cpp:
     18        (WebCore::InspectorTimelineAgent::willReceiveResourceResponse):
     19        (WebCore::InspectorTimelineAgent::didReceiveResourceResponse):
     20        * inspector/InspectorTimelineAgent.h:
     21        * inspector/front-end/TimelinePanel.js:
     22        (WebInspector.TimelinePanel):
     23        (WebInspector.TimelinePanel.prototype._createStatusbarButtons):
     24        (WebInspector.TimelinePanel.prototype.addRecordToTimeline):
     25        (WebInspector.TimelinePanel.prototype._findParentRecord):
     26        (WebInspector.TimelinePanel.prototype._innerAddRecordToTimeline):
     27        (WebInspector.TimelinePanel.prototype.resize):
     28        (WebInspector.TimelinePanel.prototype._createTopLevelRecord):
     29        (WebInspector.TimelinePanel.prototype.reset):
     30        (WebInspector.TimelinePanel.prototype._clean):
     31        (WebInspector.TimelinePanel.prototype._refresh):
     32        (WebInspector.TimelinePanel.prototype._refreshRecords):
     33        (WebInspector.TimelinePanel.prototype._addToRecordsWindow):
     34        (WebInspector.TimelineCalculator.prototype.computeBarGraphPercentages):
     35        (WebInspector.TimelineCalculator.prototype.updateBoundaries):
     36        (WebInspector.TimelineRecordGraphRow):
     37        (WebInspector.TimelineRecordGraphRow.prototype.update):
     38        (WebInspector.TimelinePanel.FormattedRecord):
     39        (WebInspector.TimelinePanel.FormattedRecord.prototype.get children):
     40        (WebInspector.TimelinePanel.FormattedRecord.prototype._generatePopupContent):
     41        * inspector/front-end/inspector.css:
     42        * loader/ResourceLoader.cpp:
     43        (WebCore::ResourceLoader::didReceiveResponse):
     44
    1452010-03-17  Alexander Pavlov  <apavlov@chromium.org>
    246
  • trunk/WebCore/inspector/InspectorController.cpp

    r56104 r56108  
    676676        // resources are cleared so that it has a chance to unbind them.
    677677        if (m_frontend) {
    678             if (m_timelineAgent)
    679                 m_timelineAgent->reset();
    680 
    681678            m_frontend->reset();
    682679            m_domAgent->reset();
     
    901898void InspectorController::didReceiveResponse(unsigned long identifier, const ResourceResponse& response)
    902899{
    903     if (m_timelineAgent)
    904         m_timelineAgent->didReceiveResourceResponse(identifier, response);
    905 
    906900    RefPtr<InspectorResource> resource = getTrackedResource(identifier);
    907901    if (!resource)
  • trunk/WebCore/inspector/InspectorTimelineAgent.cpp

    r55277 r56108  
    188188}
    189189
    190 void InspectorTimelineAgent::didReceiveResourceResponse(unsigned long identifier, const ResourceResponse& response)
    191 {
    192     ScriptObject record = TimelineRecordFactory::createGenericRecord(m_frontend, currentTimeInMilliseconds());
    193     record.set("data", TimelineRecordFactory::createResourceReceiveResponseData(m_frontend, identifier, response));
    194     record.set("type", ResourceReceiveResponseTimelineRecordType);
    195     m_frontend->addRecordToTimeline(record);
     190void InspectorTimelineAgent::willReceiveResourceData(unsigned long identifier)
     191{
     192    pushCurrentRecord(TimelineRecordFactory::createReceiveResourceData(m_frontend, identifier), ReceiveResourceDataTimelineRecordType);
     193}
     194
     195void InspectorTimelineAgent::didReceiveResourceData()
     196{
     197    didCompleteCurrentRecord(ReceiveResourceDataTimelineRecordType);
     198}
     199   
     200void InspectorTimelineAgent::willReceiveResourceResponse(unsigned long identifier, const ResourceResponse& response)
     201{
     202    pushCurrentRecord(TimelineRecordFactory::createResourceReceiveResponseData(m_frontend, identifier, response), ResourceReceiveResponseTimelineRecordType);
     203}
     204
     205void InspectorTimelineAgent::didReceiveResourceResponse()
     206{
     207    didCompleteCurrentRecord(ResourceReceiveResponseTimelineRecordType);
    196208}
    197209
  • trunk/WebCore/inspector/InspectorTimelineAgent.h

    r55277 r56108  
    6565        ResourceFinishTimelineRecordType = 14,
    6666        FunctionCallTimelineRecordType = 15,
     67        ReceiveResourceDataTimelineRecordType = 16,
    6768    };
    6869
     
    110111
    111112        void willSendResourceRequest(unsigned long, bool isMainResource, const ResourceRequest&);
    112         void didReceiveResourceResponse(unsigned long, const ResourceResponse&);
     113        void willReceiveResourceResponse(unsigned long, const ResourceResponse&);
     114        void didReceiveResourceResponse();
    113115        void didFinishLoadingResource(unsigned long, bool didFail);
    114 
     116        void willReceiveResourceData(unsigned long identifier);
     117        void didReceiveResourceData();
     118       
    115119        static int instanceCount() { return s_instanceCount; }
    116120        static InspectorTimelineAgent* retrieve(ScriptExecutionContext*);
  • trunk/WebCore/inspector/TimelineRecordFactory.cpp

    r55277 r56108  
    149149}
    150150
     151ScriptObject TimelineRecordFactory::createReceiveResourceData(InspectorFrontend* frontend, unsigned long identifier)
     152{
     153    ScriptObject data = frontend->newScriptObject();
     154    data.set("identifier", identifier);
     155    return data;
     156}
     157   
    151158ScriptObject TimelineRecordFactory::createPaintData(InspectorFrontend* frontend, const IntRect& rect)
    152159{
  • trunk/WebCore/inspector/TimelineRecordFactory.h

    r55277 r56108  
    6868        static ScriptObject createResourceReceiveResponseData(InspectorFrontend*, unsigned long identifier, const ResourceResponse&);
    6969
     70        static ScriptObject createReceiveResourceData(InspectorFrontend*, unsigned long identifier);
     71       
    7072        static ScriptObject createResourceFinishData(InspectorFrontend*, unsigned long identifier, bool didFail);
    7173
  • trunk/WebCore/inspector/front-end/TimelineAgent.js

    r55277 r56108  
    5050    ResourceReceiveResponse : 13,
    5151    ResourceFinish : 14,
    52     FunctionCall : 15
     52    FunctionCall : 15,
     53    ResourceReceiveData: 16
    5354};
    5455
  • trunk/WebCore/inspector/front-end/TimelinePanel.js

    r56103 r56108  
    7979    this._createStatusbarButtons();
    8080
    81     this._records = [];
     81    this._rootRecord = this._createRootRecord();
    8282    this._sendRequestRecords = {};
    8383    this._timerRecords = {};
     
    141141            recordStyles[recordTypes.ResourceFinish] = { title: WebInspector.UIString("Finish Loading"), category: this.categories.loading };
    142142            recordStyles[recordTypes.FunctionCall] = { title: WebInspector.UIString("Function Call"), category: this.categories.scripting };
     143            recordStyles[recordTypes.ResourceReceiveData] = { title: WebInspector.UIString("Receive Data"), category: this.categories.loading };
    143144            this._recordStylesArray = recordStyles;
    144145        }
     
    186187            }
    187188        }
    188         this._innerAddRecordToTimeline(record, this._records);
     189        this._innerAddRecordToTimeline(record, this._rootRecord);
    189190        this._scheduleRefresh();
    190191    },
    191192
    192     _innerAddRecordToTimeline: function(record, collection)
    193     {
    194         var formattedRecord = new WebInspector.TimelinePanel.FormattedRecord(record, this._recordStyles, this._sendRequestRecords, this._timerRecords);
     193    _findParentRecord: function(record)
     194    {
     195        var recordTypes = WebInspector.TimelineAgent.RecordType;
     196        var parentRecord;
     197        if (record.type === recordTypes.ResourceReceiveResponse ||
     198            record.type === recordTypes.ResourceFinish ||
     199            record.type === recordTypes.ResourceReceiveData)
     200            parentRecord = this._sendRequestRecords[record.data.identifier];
     201        else if (record.type === recordTypes.TimerFire)
     202            parentRecord = this._timerRecords[record.data.timerId];
     203        return parentRecord;
     204    },
     205
     206    _innerAddRecordToTimeline: function(record, parentRecord)
     207    {
     208        var connectedToOldRecord = false;
     209        if (parentRecord === this._rootRecord) {
     210            var newParentRecord = this._findParentRecord(record);
     211            if (newParentRecord) {
     212                parentRecord = newParentRecord;
     213                connectedToOldRecord = true;
     214            }
     215        }
     216
     217        var formattedRecord = new WebInspector.TimelinePanel.FormattedRecord(record, parentRecord, this._recordStyles, this._sendRequestRecords, this._timerRecords);
     218        if (parentRecord === this._rootRecord)
     219            formattedRecord.collapsed = true;
    195220
    196221        // Glue subsequent records with same category and title together if they are closer than 100ms to each other.
    197         if (this._lastRecord && (!record.children || !record.children.length) &&
    198                 this._lastRecord.category == formattedRecord.category &&
    199                 this._lastRecord.title == formattedRecord.title &&
    200                 this._lastRecord.details == formattedRecord.details &&
    201                 this._lastRecord.callerScriptName == formattedRecord.callerScriptName &&
    202                 this._lastRecord.callerScriptLine == formattedRecord.callerScriptLine &&
    203                 formattedRecord.startTime - this._lastRecord.endTime < 0.1) {
    204             this._lastRecord.endTime = formattedRecord.endTime;
    205             this._lastRecord.count++;
     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++;
    206232        } else {
    207             collection.push(formattedRecord);
    208             for (var i = 0; record.children && i < record.children.length; ++i) {
    209                 if (!formattedRecord.children)
    210                     formattedRecord.children = [];
    211                 var formattedChild = this._innerAddRecordToTimeline(record.children[i], formattedRecord.children);
    212                 formattedChild.parent = formattedRecord;
     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        }
     237
     238        if (connectedToOldRecord) {
     239            var record = formattedRecord;
     240            while (record.parent && record.parent._lastChildEndTime < record._lastChildEndTime) {
     241                record.parent._lastChildEndTime = record._lastChildEndTime;
     242                record = record.parent;
    213243            }
    214             this._lastRecord = record.children && record.children.length ? null : formattedRecord;
    215         }
    216         return formattedRecord;
     244        }
    217245    },
    218246
     
    231259    },
    232260
    233     resize: function() {
     261    resize: function()
     262    {
    234263        this._closeRecordDetails();
    235264        this._scheduleRefresh();
    236265    },
    237266
     267    _createRootRecord: function()
     268    {
     269        var rootRecord = {};
     270        rootRecord.children = [];
     271        rootRecord._lastRecord = null;
     272        return rootRecord;
     273    },
     274
    238275    _clearPanel: function()
    239276    {
    240         this._lastRecord = null;
    241277        this._sendRequestRecords = {};
    242278        this._timerRecords = {};
    243         this._records = [];
     279        this._rootRecord = this._createRootRecord();
    244280        this._boundariesAreValid = false;
    245281        this._overviewPane.reset();
     
    305341
    306342        if (!this._boundariesAreValid)
    307             this._overviewPane.update(this._records);
     343            this._overviewPane.update(this._rootRecord.children);
    308344        this._refreshRecords(!this._boundariesAreValid);
    309345        this._boundariesAreValid = true;
     
    317353            this._calculator.windowRight = this._overviewPane.windowRight;
    318354
    319             for (var i = 0; i < this._records.length; ++i)
    320                 this._calculator.updateBoundaries(this._records[i]);
     355            for (var i = 0; i < this._rootRecord.children.length; ++i)
     356                this._calculator.updateBoundaries(this._rootRecord.children[i]);
    321357
    322358            this._calculator.calculateWindow();
     
    324360
    325361        var recordsInWindow = [];
    326         for (var i = 0; i < this._records.length; ++i) {
    327             var record = this._records[i];
     362        for (var i = 0; i < this._rootRecord.children.length; ++i) {
     363            var record = this._rootRecord.children[i];
    328364            var percentages = this._calculator.computeBarGraphPercentages(record);
    329             if (percentages.start < 100 && percentages.end >= 0 && !record.category.hidden)
     365            if (percentages.start < 100 && percentages.endWithChildren >= 0 && !record.category.hidden)
    330366                this._addToRecordsWindow(record, recordsInWindow);
    331367        }
     
    408444        if (!record.collapsed) {
    409445            var index = recordsWindow.length;
    410             for (var i = 0; record.children && i < record.children.length; ++i)
     446            for (var i = 0; i < record.children.length; ++i)
    411447                this._addToRecordsWindow(record.children[i], recordsWindow);
    412448            record.visibleChildrenCount = recordsWindow.length - index;
     
    462498        var start = (record.startTime - this.minimumBoundary) / this.boundarySpan * 100;
    463499        var end = (record.endTime - this.minimumBoundary) / this.boundarySpan * 100;
    464         return {start: start, end: end};
     500        var endWithChildren = (record._lastChildEndTime - this.minimumBoundary) / this.boundarySpan * 100;
     501        return {start: start, end: end, endWithChildren: endWithChildren};
     502    },
     503
     504    computeBarGraphWindowPosition: function(record, clientWidth, expandOffset)
     505    {
     506        const minWidth = 5;
     507        const borderWidth = 4;
     508        var workingArea = clientWidth - expandOffset - minWidth - borderWidth;
     509        var percentages = this.computeBarGraphPercentages(record);
     510        var left = percentages.start / 100 * workingArea;
     511        var width = (percentages.end - percentages.start) / 100 * workingArea + minWidth;
     512        var widthWithChildren =  (percentages.endWithChildren - percentages.start) / 100 * workingArea;
     513        if (percentages.endWithChildren > percentages.end)
     514            widthWithChildren += borderWidth + minWidth;
     515        return {left: left, width: width, widthWithChildren: widthWithChildren};
    465516    },
    466517
     
    484535            this._absoluteMinimumBoundary = lowerBound;
    485536
    486         var upperBound = record.endTime;
     537        var upperBound = record._lastChildEndTime;
    487538        if (this._absoluteMaximumBoundary === -1 || upperBound > this._absoluteMaximumBoundary)
    488539            this._absoluteMaximumBoundary = upperBound;
     
    560611    this.element.appendChild(this._barAreaElement);
    561612
     613    this._barWithChildrenElement = document.createElement("div");
     614    this._barWithChildrenElement.className = "timeline-graph-bar with-children";
     615    this._barWithChildrenElement.row = this;
     616    this._barAreaElement.appendChild(this._barWithChildrenElement);
     617
    562618    this._barElement = document.createElement("div");
    563619    this._barElement.className = "timeline-graph-bar";
     
    582638    update: function(record, isEven, calculator, clientWidth, expandOffset, index)
    583639    {
    584         const minWidth = 5;
    585         const borderWidth = 4;
    586         var workingArea = clientWidth - expandOffset - minWidth - borderWidth;
    587640        this._record = record;
    588641        this.element.className = "timeline-graph-side timeline-category-" + record.category.name + (isEven ? " even" : "");
    589         var percentages = calculator.computeBarGraphPercentages(record);
    590         var left = percentages.start / 100 * workingArea;
    591         var width = (percentages.end - percentages.start) / 100 * workingArea;
    592         width = width > minWidth ? width : minWidth;
    593         this._barElement.style.left = (left + expandOffset) + "px";
    594         this._barElement.style.width = width + "px";
    595 
    596         if (record.visibleChildrenCount) {
     642        var barPosition = calculator.computeBarGraphWindowPosition(record, clientWidth, expandOffset);
     643        this._barWithChildrenElement.style.left = barPosition.left + expandOffset + "px";
     644        this._barWithChildrenElement.style.width = barPosition.widthWithChildren + "px";
     645        this._barElement.style.left = barPosition.left + expandOffset + "px";
     646        this._barElement.style.width =  barPosition.width + "px";
     647
     648        if (record.children.length) {
    597649            this._expandElement.style.top = index * this._rowHeight + "px";
    598             this._expandElement.style.left = left + "px";
    599             this._expandElement.style.width = Math.max(12, width + 25) + "px";
     650            this._expandElement.style.left = barPosition.left + "px";
     651            this._expandElement.style.width = Math.max(12, barPosition.width + 25) + "px";
    600652            if (!record.collapsed) {
    601653                this._expandElement.style.height = (record.visibleChildrenCount + 1) * this._rowHeight + "px";
     
    626678}
    627679
    628 WebInspector.TimelinePanel.FormattedRecord = function(record, recordStyles, sendRequestRecords, timerRecords)
     680WebInspector.TimelinePanel.FormattedRecord = function(record, parentRecord, recordStyles, sendRequestRecords, timerRecords)
    629681{
    630682    var recordTypes = WebInspector.TimelineAgent.RecordType;
    631683    var style = recordStyles[record.type];
    632684
     685    this.parent = parentRecord;
     686    parentRecord.children.push(this);
    633687    this.category = style.category;
    634688    this.title = style.title;
     
    638692    this.type = record.type;
    639693    this.endTime = (typeof record.endTime !== "undefined") ? record.endTime / 1000 : this.startTime;
     694    this._lastChildEndTime = this.endTime;
    640695    this.originalRecordForTests = record;
    641696    this.callerScriptName = record.callerScriptName;
     
    648703        var sendRequestRecord = sendRequestRecords[record.data.identifier];
    649704        if (sendRequestRecord) { // False if we started instrumentation in the middle of request.
    650             sendRequestRecord._responseReceivedFormattedTime = this.startTime;
    651705            record.data.url = sendRequestRecord.data.url;
    652             this.startTime = sendRequestRecord.startTime;
    653706            // Now that we have resource in the collection, recalculate details in order to display short url.
    654707            sendRequestRecord.details = this._getRecordDetails(sendRequestRecord, sendRequestRecords);
    655             this.callerScriptName = sendRequestRecord.callerScriptName;
    656             this.callerScriptLine = sendRequestRecord.callerScriptLine;
    657         }
     708        }
     709    } else if (record.type === recordTypes.ResourceReceiveData) {
     710        var sendRequestRecord = sendRequestRecords[record.data.identifier];
     711        if (sendRequestRecord) // False for main resource.
     712            record.data.url = sendRequestRecord.data.url;
    658713    } else if (record.type === recordTypes.ResourceFinish) {
    659714        var sendRequestRecord = sendRequestRecords[record.data.identifier];
    660         if (sendRequestRecord) {// False for main resource.
     715        if (sendRequestRecord) // False for main resource.
    661716            record.data.url = sendRequestRecord.data.url;
    662             this.startTime = sendRequestRecord._responseReceivedFormattedTime;
    663             this.callerScriptName = sendRequestRecord.callerScriptName;
    664             this.callerScriptLine = sendRequestRecord.callerScriptLine;
    665         }
    666717    } else if (record.type === recordTypes.TimerInstall) {
    667718        this.timeout = record.data.timeout;
     
    693744    },
    694745
     746    get children()
     747    {
     748        if (!this._children)
     749            this._children = [];
     750        return this._children;
     751    },
     752
    695753    _createRow: function(title, content)
    696754    {
     
    729787                this.type === recordTypes.TimerRemove) {
    730788                recordContentTable.appendChild(this._createRow(WebInspector.UIString("Timer Id"), this.data.timerId));
    731                 if (this.timeout) {
     789                if (typeof this.timeout === "number") {
    732790                    recordContentTable.appendChild(this._createRow(WebInspector.UIString("Timeout"), this.timeout));
    733791                    recordContentTable.appendChild(this._createRow(WebInspector.UIString("Repeats"), !this.singleShot));
    734792                }
    735                 if (this.callSiteScriptLine) {
     793                if (typeof this.callSiteScriptLine === "number") {
    736794                    var link = WebInspector.linkifyResourceAsNode(this.callSiteScriptName, "scripts", this.callSiteScriptLine, "timeline-details");
    737795                    recordContentTable.appendChild(this._createLinkRow(WebInspector.UIString("Call Site"), link));
     
    740798                var link = WebInspector.linkifyResourceAsNode(this.data.scriptName, "scripts", this.data.scriptLine, "timeline-details");
    741799                recordContentTable.appendChild(this._createLinkRow(WebInspector.UIString("Location"), link));
    742             } else if (this.type === recordTypes.ResourceSendRequest || this.type === recordTypes.ResourceReceiveResponse || this.type === recordTypes.ResourceFinish) {
     800            } else if (this.type === recordTypes.ResourceSendRequest ||
     801                       this.type === recordTypes.ResourceReceiveResponse ||
     802                       this.type === recordTypes.ResourceReceiveData ||
     803                       this.type === recordTypes.ResourceFinish) {
    743804                var link = WebInspector.linkifyResourceAsNode(this.data.url, "resources", null, "timeline-details");
    744805                recordContentTable.appendChild(this._createLinkRow(WebInspector.UIString("Resource"), link));
     806                if (this.data.requestMethod)
     807                    recordContentTable.appendChild(this._createRow(WebInspector.UIString("Request Method"), this.data.requestMethod));
     808                if (typeof this.data.statusCode === "number")
     809                    recordContentTable.appendChild(this._createRow(WebInspector.UIString("Status Code"), this.data.statusCode));
     810                if (this.data.mimeType)
     811                    recordContentTable.appendChild(this._createRow(WebInspector.UIString("Mime Type"), this.data.mimeType));
     812                if (typeof this.data.expectedContentLength === "number" && this.data.expectedContentLength !== -1)
     813                    recordContentTable.appendChild(this._createRow(WebInspector.UIString("Expected Content Length"), this.data.expectedContentLength));
    745814            } else if (this.type === recordTypes.EvaluateScript) {
    746815                var link = WebInspector.linkifyResourceAsNode(this.data.url, "scripts", null, "timeline-details");
     
    777846            case WebInspector.TimelineAgent.RecordType.EvaluateScript:
    778847            case WebInspector.TimelineAgent.RecordType.ResourceSendRequest:
     848            case WebInspector.TimelineAgent.RecordType.ResourceReceiveData:
    779849            case WebInspector.TimelineAgent.RecordType.ResourceReceiveResponse:
    780850            case WebInspector.TimelineAgent.RecordType.ResourceFinish:
  • trunk/WebCore/inspector/front-end/inspector.css

    r55790 r56108  
    35963596}
    35973597
     3598.timeline-graph-bar.with-children {
     3599    opacity: 0.3;
     3600}
     3601
    35983602.timeline-graph-side.even {
    35993603    background-color: rgba(0, 0, 0, 0.05);
  • trunk/WebCore/loader/ResourceLoader.cpp

    r55738 r56108  
    3535#include "Frame.h"
    3636#include "FrameLoader.h"
     37#include "InspectorTimelineAgent.h"
    3738#include "Page.h"
    3839#include "ProgressTracker.h"
     
    398399void ResourceLoader::didReceiveResponse(ResourceHandle*, const ResourceResponse& response)
    399400{
     401#if ENABLE(INSPECTOR)
     402    if (InspectorTimelineAgent::instanceCount()) {
     403        InspectorTimelineAgent* timelineAgent = m_frame->page() ? m_frame->page()->inspectorTimelineAgent() : 0;
     404        if (timelineAgent)
     405            timelineAgent->willReceiveResourceResponse(identifier(), response);
     406    }
     407#endif
    400408#if ENABLE(OFFLINE_WEB_APPLICATIONS)
    401409    if (documentLoader()->applicationCacheHost()->maybeLoadFallbackForResponse(this, response))
     
    403411#endif
    404412    didReceiveResponse(response);
     413#if ENABLE(INSPECTOR)
     414    if (InspectorTimelineAgent::instanceCount()) {
     415        InspectorTimelineAgent* timelineAgent = m_frame->page() ? m_frame->page()->inspectorTimelineAgent() : 0;
     416        if (timelineAgent)
     417            timelineAgent->didReceiveResourceResponse();
     418    }
     419#endif
    405420}
    406421
    407422void ResourceLoader::didReceiveData(ResourceHandle*, const char* data, int length, int lengthReceived)
    408423{
     424#if ENABLE(INSPECTOR)
     425    if (InspectorTimelineAgent::instanceCount()) {
     426        InspectorTimelineAgent* timelineAgent = m_frame->page() ? m_frame->page()->inspectorTimelineAgent() : 0;
     427        if (timelineAgent)
     428            timelineAgent->willReceiveResourceData(identifier());
     429    }
     430#endif
    409431    didReceiveData(data, length, lengthReceived, false);
     432#if ENABLE(INSPECTOR)
     433    if (InspectorTimelineAgent::instanceCount()) {
     434        InspectorTimelineAgent* timelineAgent = m_frame->page() ? m_frame->page()->inspectorTimelineAgent() : 0;
     435        if (timelineAgent)
     436            timelineAgent->didReceiveResourceData();
     437    }
     438#endif
    410439}
    411440
Note: See TracChangeset for help on using the changeset viewer.