Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1281)

Unified Diff: Source/devtools/front_end/NetworkPanel.js

Issue 138843009: Notify when resource with error code >= 400 is finished. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: Source/devtools/front_end/NetworkPanel.js
diff --git a/Source/devtools/front_end/NetworkPanel.js b/Source/devtools/front_end/NetworkPanel.js
index a9fad2fbc6ade0377bd1b0fafe6eb9824a36fcf2..3b4f01b832ccedf397e219e995a0085a9501996a 100644
--- a/Source/devtools/front_end/NetworkPanel.js
+++ b/Source/devtools/front_end/NetworkPanel.js
@@ -2303,11 +2303,19 @@ WebInspector.NetworkDataGridNode.prototype = {
this._timelineCell.classList.add("resource-cached");
this._element.classList.add("network-item");
- this._element.enableStyleClass("network-error-row", this._request.failed || (this._request.statusCode >= 400));
+ this._element.enableStyleClass("network-error-row", this._isFailed());
this._updateElementStyleClasses(this._element);
},
/**
+ * @return {boolean}
+ */
+ _isFailed: function()
+ {
+ return !!this._request.failed || (this._request.statusCode >= 400);
+ },
+
+ /**
* @param {!Element} element
*/
_updateElementStyleClasses: function(element)
@@ -2356,37 +2364,30 @@ WebInspector.NetworkDataGridNode.prototype = {
_refreshStatusCell: function()
{
this._statusCell.removeChildren();
+ this._statusCell.enableStyleClass("network-dim-cell", !this._isFailed() && (this._request.cached || !this._request.statusCode));
- if (this._request.failed) {
- var failText = this._request.canceled ? WebInspector.UIString("(canceled)") : WebInspector.UIString("(failed)");
+ if (this._request.failed && !this._request.canceled) {
+ var failText = WebInspector.UIString("(failed)");
if (this._request.localizedFailDescription) {
this._statusCell.appendChild(document.createTextNode(failText));
this._appendSubtitle(this._statusCell, this._request.localizedFailDescription);
this._statusCell.title = failText + " " + this._request.localizedFailDescription;
} else
this._statusCell.setTextAndTitle(failText);
- this._statusCell.classList.add("network-dim-cell");
- return;
- }
-
- this._statusCell.classList.remove("network-dim-cell");
-
- if (this._request.statusCode) {
+ } else if (this._request.statusCode) {
this._statusCell.appendChild(document.createTextNode("" + this._request.statusCode));
this._appendSubtitle(this._statusCell, this._request.statusText);
this._statusCell.title = this._request.statusCode + " " + this._request.statusText;
- if (this._request.cached)
- this._statusCell.classList.add("network-dim-cell");
+ } else if (this._request.parsedURL.isDataURL()) {
+ this._statusCell.setTextAndTitle(WebInspector.UIString("(data)"));
+ } else if (this._request.isPingRequest()) {
+ this._statusCell.setTextAndTitle(WebInspector.UIString("(ping)"));
+ } else if (this._request.canceled) {
+ this._statusCell.setTextAndTitle(WebInspector.UIString("(canceled)"));
+ } else if (this._request.finished) {
+ this._statusCell.setTextAndTitle(WebInspector.UIString("Finished"));
} else {
- if (this._request.parsedURL.isDataURL())
- this._statusCell.setTextAndTitle(WebInspector.UIString("(data)"));
- else if (this._request.isPingRequest())
- this._statusCell.setTextAndTitle(WebInspector.UIString("(ping)"));
- else if (this._request.finished)
- this._statusCell.setTextAndTitle(WebInspector.UIString("Finished"));
- else
- this._statusCell.setTextAndTitle(WebInspector.UIString("(pending)"));
- this._statusCell.classList.add("network-dim-cell");
+ this._statusCell.setTextAndTitle(WebInspector.UIString("(pending)"));
}
},
« Source/core/fetch/ResourceLoader.cpp ('K') | « Source/core/fetch/ResourceLoader.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698