Changeset 87395 in webkit
- Timestamp:
- May 26, 2011 9:36:38 AM (13 years ago)
- Location:
- trunk
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r87393 r87395 1 2011-05-26 Andrey Kosyakov <caseq@chromium.org> 2 3 Reviewed by Yury Semikhatsky. 4 5 Web Inspector: TimelinePanel should not modify input timeline data when processing timeline event 6 https://bugs.webkit.org/show_bug.cgi?id=61529 7 8 Do not modify input timeline data when processing timeline event. 9 10 * inspector/timeline/timeline-network-resource-expected.txt: 11 * platform/chromium/inspector/timeline/timeline-network-resource-expected.txt 12 1 13 2011-05-26 Tony Chang <tony@chromium.org> 2 14 -
trunk/LayoutTests/inspector/timeline/timeline-network-resource-expected.txt
r82239 r87395 24 24 statusCode : 0 25 25 mimeType : <string> 26 url : <string>27 26 } 28 27 children : <object> … … 39 38 identifier : <number> 40 39 didFail : false 41 url : <string>42 40 } 43 41 type : "ResourceFinish" -
trunk/LayoutTests/platform/chromium/inspector/timeline/timeline-network-resource-expected.txt
r82239 r87395 25 25 statusCode : 0 26 26 mimeType : <string> 27 url : <string>28 27 } 29 28 children : <object> … … 40 39 identifier : <number> 41 40 didFail : false 42 url : <string>43 41 } 44 42 type : "ResourceFinish" -
trunk/Source/WebCore/ChangeLog
r87392 r87395 1 2011-05-26 Andrey Kosyakov <caseq@chromium.org> 2 3 Reviewed by Yury Semikhatsky. 4 5 Web Inspector: TimelinePanel should not modify input timeline data when processing timeline event 6 https://bugs.webkit.org/show_bug.cgi?id=61529 7 8 Do not modify input timeline data when processing timeline event. 9 10 * inspector/front-end/TimelinePanel.js: 11 (WebInspector.TimelinePanel.prototype._addRecordToTimeline): 12 (WebInspector.TimelinePanel.prototype._innerAddRecordToTimeline): 13 (WebInspector.TimelinePanel.FormattedRecord): 14 (WebInspector.TimelinePanel.FormattedRecord.prototype._generatePopupContent): 15 (WebInspector.TimelinePanel.FormattedRecord.prototype._refreshDetails): 16 (WebInspector.TimelinePanel.FormattedRecord.prototype._getRecordDetails): 17 1 18 2011-05-26 Rob Buis <rbuis@rim.com> 2 19 -
trunk/Source/WebCore/inspector/front-end/TimelinePanel.js
r85415 r87395 306 306 _addRecordToTimeline: function(record) 307 307 { 308 if (record.type == WebInspector.TimelineAgent.RecordType.ResourceSendRequest) {308 if (record.type === WebInspector.TimelineAgent.RecordType.ResourceSendRequest) { 309 309 var isMainResource = (record.data.identifier === WebInspector.mainResource.identifier); 310 310 if (isMainResource && this._mainResourceIdentifier !== record.data.identifier) { … … 349 349 } 350 350 351 if (record.type == recordTypes.TimerFire && record.children && record.children.length) { 352 var childRecord = record.children[0]; 351 var children = record.children; 352 var scriptDetails; 353 if (record.data.scriptName) { 354 scriptDetails = { 355 scriptName: record.data.scriptName, 356 scriptLine: record.data.scriptLine 357 } 358 }; 359 if (record.type === recordTypes.TimerFire && children && children.length) { 360 var childRecord = children[0]; 353 361 if (childRecord.type === recordTypes.FunctionCall) { 354 record.data.scriptName = childRecord.data.scriptName; 355 record.data.scriptLine = childRecord.data.scriptLine; 356 record.children.shift(); 357 record.children = childRecord.children.concat(record.children); 362 scriptDetails = { 363 scriptName: childRecord.data.scriptName, 364 scriptLine: childRecord.data.scriptLine 365 }; 366 children = childRecord.children.concat(children.slice(1)); 358 367 } 359 368 } 360 369 361 var formattedRecord = new WebInspector.TimelinePanel.FormattedRecord(record, parentRecord, this );370 var formattedRecord = new WebInspector.TimelinePanel.FormattedRecord(record, parentRecord, this, scriptDetails); 362 371 363 372 if (record.type === recordTypes.MarkDOMContent || record.type === recordTypes.MarkLoad) { … … 369 378 formattedRecord.collapsed = (parentRecord === this._rootRecord); 370 379 371 var childrenCount = record.children ? record.children.length : 0;380 var childrenCount = children ? children.length : 0; 372 381 for (var i = 0; i < childrenCount; ++i) 373 this._innerAddRecordToTimeline( record.children[i], formattedRecord);382 this._innerAddRecordToTimeline(children[i], formattedRecord); 374 383 375 384 formattedRecord._calculateAggregatedStats(this.categories); … … 858 867 } 859 868 860 WebInspector.TimelinePanel.FormattedRecord = function(record, parentRecord, panel )869 WebInspector.TimelinePanel.FormattedRecord = function(record, parentRecord, panel, scriptDetails) 861 870 { 862 871 var recordTypes = WebInspector.TimelineAgent.RecordType; … … 877 886 this.totalHeapSize = record.totalHeapSize; 878 887 this.usedHeapSize = record.usedHeapSize; 879 888 if (record.data.url) 889 this.url = record.data.url; 890 if (scriptDetails) { 891 this.scriptName = scriptDetails.scriptName; 892 this.scriptLine = scriptDetails.scriptLine; 893 } 880 894 // Make resource receive record last since request was sent; make finish record last since response received. 881 895 if (record.type === recordTypes.ResourceSendRequest) { … … 886 900 var sendRequestRecord = panel._sendRequestRecords[record.data.identifier]; 887 901 if (sendRequestRecord) { // False if we started instrumentation in the middle of request. 888 record.data.url = sendRequestRecord.data.url;902 this.url = sendRequestRecord.url; 889 903 // Now that we have resource in the collection, recalculate details in order to display short url. 890 sendRequestRecord. details = this._getRecordDetails(sendRequestRecord, panel._sendRequestRecords);904 sendRequestRecord._refreshDetails(); 891 905 if (sendRequestRecord.parent !== panel._rootRecord && sendRequestRecord.parent.type === recordTypes.ScheduleResourceRequest) 892 sendRequestRecord.parent. details = this._getRecordDetails(sendRequestRecord, panel._sendRequestRecords);893 } 894 } else if (record.type === recordTypes.ResourceReceivedData ) {906 sendRequestRecord.parent._refreshDetails(); 907 } 908 } else if (record.type === recordTypes.ResourceReceivedData || record.type === recordTypes.ResourceFinish) { 895 909 var sendRequestRecord = panel._sendRequestRecords[record.data.identifier]; 896 910 if (sendRequestRecord) // False for main resource. 897 record.data.url = sendRequestRecord.data.url; 898 } else if (record.type === recordTypes.ResourceFinish) { 899 var sendRequestRecord = panel._sendRequestRecords[record.data.identifier]; 900 if (sendRequestRecord) // False for main resource. 901 record.data.url = sendRequestRecord.data.url; 911 this.url = sendRequestRecord.url; 902 912 } else if (record.type === recordTypes.TimerInstall) { 903 913 this.timeout = record.data.timeout; … … 912 922 } 913 923 } 914 this. details = this._getRecordDetails(record, panel._sendRequestRecords);924 this._refreshDetails(); 915 925 } 916 926 … … 971 981 break; 972 982 case recordTypes.FunctionCall: 973 contentHelper._appendLinkRow(WebInspector.UIString("Location"), this. data.scriptName, this.data.scriptLine);983 contentHelper._appendLinkRow(WebInspector.UIString("Location"), this.scriptName, this.scriptLine); 974 984 break; 975 985 case recordTypes.ScheduleResourceRequest: … … 978 988 case recordTypes.ResourceReceivedData: 979 989 case recordTypes.ResourceFinish: 980 contentHelper._appendLinkRow(WebInspector.UIString("Resource"), this. data.url);990 contentHelper._appendLinkRow(WebInspector.UIString("Resource"), this.url); 981 991 if (this.data.requestMethod) 982 992 contentHelper._appendTextRow(WebInspector.UIString("Request Method"), this.data.requestMethod); … … 987 997 break; 988 998 case recordTypes.EvaluateScript: 989 if (this.data && this. data.url)990 contentHelper._appendLinkRow(WebInspector.UIString("Script"), this. data.url, this.data.lineNumber);999 if (this.data && this.url) 1000 contentHelper._appendLinkRow(WebInspector.UIString("Script"), this.url, this.data.lineNumber); 991 1001 break; 992 1002 case recordTypes.Paint: … … 1001 1011 } 1002 1012 1003 if (this. data.scriptName && this.type !== recordTypes.FunctionCall)1004 contentHelper._appendLinkRow(WebInspector.UIString("Function Call"), this. data.scriptName, this.data.scriptLine);1013 if (this.scriptName && this.type !== recordTypes.FunctionCall) 1014 contentHelper._appendLinkRow(WebInspector.UIString("Function Call"), this.scriptName, this.scriptLine); 1005 1015 1006 1016 if (this.usedHeapSize) … … 1016 1026 }, 1017 1027 1018 _getRecordDetails: function(record, sendRequestRecords) 1019 { 1020 switch (record.type) { 1028 _refreshDetails: function() 1029 { 1030 this.details = this._getRecordDetails(); 1031 }, 1032 1033 _getRecordDetails: function() 1034 { 1035 switch (this.type) { 1021 1036 case WebInspector.TimelineAgent.RecordType.GCEvent: 1022 return WebInspector.UIString("%s collected", Number.bytesToString( record.data.usedHeapSizeDelta));1037 return WebInspector.UIString("%s collected", Number.bytesToString(this.data.usedHeapSizeDelta)); 1023 1038 case WebInspector.TimelineAgent.RecordType.TimerFire: 1024 return record.data.scriptName ? WebInspector.linkifyResourceAsNode(record.data.scriptName, "scripts", record.data.scriptLine, "", "") : record.data.timerId;1039 return this.scriptName ? WebInspector.linkifyResourceAsNode(this.scriptName, "scripts", this.scriptLine, "", "") : this.data.timerId; 1025 1040 case WebInspector.TimelineAgent.RecordType.FunctionCall: 1026 return record.data.scriptName ? WebInspector.linkifyResourceAsNode(record.data.scriptName, "scripts", record.data.scriptLine, "", "") : null;1041 return this.scriptName ? WebInspector.linkifyResourceAsNode(this.scriptName, "scripts", this.scriptLine, "", "") : null; 1027 1042 case WebInspector.TimelineAgent.RecordType.EventDispatch: 1028 return record.data ? record.data.type : null;1043 return this.data ? this.data.type : null; 1029 1044 case WebInspector.TimelineAgent.RecordType.Paint: 1030 return record.data.width + "\u2009\u00d7\u2009" + record.data.height;1045 return this.data.width + "\u2009\u00d7\u2009" + this.data.height; 1031 1046 case WebInspector.TimelineAgent.RecordType.TimerInstall: 1032 1047 case WebInspector.TimelineAgent.RecordType.TimerRemove: 1033 return this.stackTrace ? WebInspector.linkifyResourceAsNode(this.stackTrace[0].url, "scripts", this.stackTrace[0].lineNumber, "", "") : record.data.timerId;1048 return this.stackTrace ? WebInspector.linkifyResourceAsNode(this.stackTrace[0].url, "scripts", this.stackTrace[0].lineNumber, "", "") : this.data.timerId; 1034 1049 case WebInspector.TimelineAgent.RecordType.ParseHTML: 1035 1050 case WebInspector.TimelineAgent.RecordType.RecalculateStyles: 1036 1051 return this.stackTrace ? WebInspector.linkifyResourceAsNode(this.stackTrace[0].url, "scripts", this.stackTrace[0].lineNumber, "", "") : null; 1037 1052 case WebInspector.TimelineAgent.RecordType.EvaluateScript: 1038 return record.data.url ? WebInspector.linkifyResourceAsNode(record.data.url, "scripts", record.data.lineNumber, "", "") : null;1053 return this.url ? WebInspector.linkifyResourceAsNode(this.url, "scripts", this.data.lineNumber, "", "") : null; 1039 1054 case WebInspector.TimelineAgent.RecordType.XHRReadyStateChange: 1040 1055 case WebInspector.TimelineAgent.RecordType.XHRLoad: … … 1044 1059 case WebInspector.TimelineAgent.RecordType.ResourceReceiveResponse: 1045 1060 case WebInspector.TimelineAgent.RecordType.ResourceFinish: 1046 return WebInspector.displayNameForURL( record.data.url);1061 return WebInspector.displayNameForURL(this.url); 1047 1062 case WebInspector.TimelineAgent.RecordType.MarkTimeline: 1048 return record.data.message;1063 return this.data.message; 1049 1064 default: 1050 1065 return null;
Note: See TracChangeset
for help on using the changeset viewer.