Changeset 57609 in webkit
- Timestamp:
- Apr 14, 2010 2:49:03 PM (14 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r57607 r57609 1 2010-04-14 Andrey Kosyakov <caseq@chromium.ru> 2 3 Reviewed by Timothy Hatcher. 4 5 Log error message to inspector console if a resource fails to load. 6 Disable checking of mime-type consistency for failed resources. 7 https://bugs.webkit.org/show_bug.cgi?id=37215 8 9 * inspector/console-resource-errors-expected.txt: Added. 10 * inspector/console-resource-errors.html: Added. 11 1 12 2010-04-14 Alejandro G. Castro <alex@igalia.com> 2 13 -
trunk/WebCore/ChangeLog
r57606 r57609 1 2010-04-14 Andrey Kosyakov <caseq@chromium.ru> 2 3 Reviewed by Timothy Hatcher. 4 5 Log error message to inspector console if a resource fails to load. 6 Disable checking of mime-type consistency for failed resources. 7 https://bugs.webkit.org/show_bug.cgi?id=37215 8 9 Test: inspector/console-resource-errors.html 10 11 * inspector/InspectorController.cpp: 12 (WebCore::InspectorController::didReceiveResponse): 13 (WebCore::InspectorController::didFailLoading): 14 * inspector/front-end/Resource.js: 15 (WebInspector.Resource.prototype._mimeTypeIsConsistentWithType): 16 * inspector/front-end/ResourcesPanel.js: 17 (WebInspector.ResourcesPanel.prototype.recreateViewForResourceIfNeeded): 18 1 19 2010-04-14 Sheriff Bot <webkit.review.bot@gmail.com> 2 20 -
trunk/WebCore/inspector/InspectorController.cpp
r57505 r57609 893 893 void InspectorController::didReceiveResponse(unsigned long identifier, const ResourceResponse& response) 894 894 { 895 RefPtr<InspectorResource> resource = getTrackedResource(identifier); 896 if (!resource) 897 return; 898 899 resource->updateResponse(response); 900 resource->markResponseReceivedTime(); 901 902 if (resource != m_mainResource && m_frontend) 903 resource->updateScriptObject(m_frontend.get()); 895 if (RefPtr<InspectorResource> resource = getTrackedResource(identifier)) { 896 resource->updateResponse(response); 897 resource->markResponseReceivedTime(); 898 899 if (resource != m_mainResource && m_frontend) 900 resource->updateScriptObject(m_frontend.get()); 901 } 902 if (response.httpStatusCode() >= 400) { 903 // The ugly code below is due to that String::format() is not utf8-safe at the moment. 904 String message = String::format("Failed to load resource: the server responded with a status of %u (", response.httpStatusCode()) + response.httpStatusText() + ")"; 905 906 addMessageToConsole(OtherMessageSource, LogMessageType, ErrorMessageLevel, message, 0, response.url().string()); 907 } 904 908 } 905 909 … … 932 936 } 933 937 934 void InspectorController::didFailLoading(unsigned long identifier, const ResourceError& /*error*/)938 void InspectorController::didFailLoading(unsigned long identifier, const ResourceError& error) 935 939 { 936 940 if (m_timelineAgent) 937 941 m_timelineAgent->didFinishLoadingResource(identifier, true); 942 943 String message = "Failed to load resource"; 944 if (!error.localizedDescription().isEmpty()) 945 message += ": " + error.localizedDescription(); 946 addMessageToConsole(OtherMessageSource, LogMessageType, ErrorMessageLevel, message, 0, error.failingURL()); 938 947 939 948 RefPtr<InspectorResource> resource = getTrackedResource(identifier); -
trunk/WebCore/inspector/front-end/Resource.js
r55466 r57609 537 537 _mimeTypeIsConsistentWithType: function() 538 538 { 539 // If status is an error, content is likely to be of an inconsistent type, 540 // as it's going to be an error message. We do not want to emit a warning 541 // for this, though, as this will already be reported as resource loading failure. 542 if (this.statusCode >= 400) 543 return true; 544 539 545 if (typeof this.type === "undefined" 540 546 || this.type === WebInspector.Resource.Type.Other -
trunk/WebCore/inspector/front-end/ResourcesPanel.js
r57280 r57609 444 444 return; 445 445 446 resource.warnings = 0;447 resource.errors = 0;448 449 446 if (!this.currentQuery && resource._itemsTreeElement) 450 447 resource._itemsTreeElement.updateErrorsAndWarnings();
Note: See TracChangeset
for help on using the changeset viewer.