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

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: Returned assert in releaseResources. Created 6 years, 10 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
« no previous file with comments | « Source/core/fetch/ResourceLoader.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/devtools/front_end/NetworkPanel.js
diff --git a/Source/devtools/front_end/NetworkPanel.js b/Source/devtools/front_end/NetworkPanel.js
index 27decdc143d12120eb99fc6e55bb5b8979084d91..52bd3f363a179bca148d4e854a0c658cd47a9507 100644
--- a/Source/devtools/front_end/NetworkPanel.js
+++ b/Source/devtools/front_end/NetworkPanel.js
@@ -2305,11 +2305,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)
@@ -2358,37 +2366,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)"));
}
},
« no previous file with comments | « Source/core/fetch/ResourceLoader.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698