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

Unified Diff: Source/devtools/front_end/resources/ServiceWorkersView.js

Issue 1048763002: [DevTools] Show LastModified and ResponseTime of ServiceWorker script in DevTools (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 9 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/resources/ServiceWorkersView.js
diff --git a/Source/devtools/front_end/resources/ServiceWorkersView.js b/Source/devtools/front_end/resources/ServiceWorkersView.js
index eec898427161a22f3e1aff240945e0e72381c694..c06117592e30ce62cc72548cffdf7511a2222ff1 100644
--- a/Source/devtools/front_end/resources/ServiceWorkersView.js
+++ b/Source/devtools/front_end/resources/ServiceWorkersView.js
@@ -321,10 +321,22 @@ WebInspector.SWRegistrationElement.prototype = {
inspectButton.createTextChild(WebInspector.UIString("inspect"));
inspectButton.addEventListener("click", this._inspectButtonClicked.bind(this, version.id), false);
}
+
+ if (version.scriptLastModified) {
+ var scriptLastModifiedLabel = scriptURLDiv.createChild("label", " service-workers-info service-worker-script-last-modified", "dt-icon-label");
+ scriptLastModifiedLabel.type = "info-icon";
+ scriptLastModifiedLabel.createTextChild(WebInspector.UIString("Last-Modified: %s", (new Date(version.scriptLastModified * 1000)).toConsoleTime()));
+ }
+ if (version.scriptResponseTime) {
+ var scriptResponseTimeDiv = scriptURLDiv.createChild("label", " service-workers-info service-worker-script-response-time", "dt-icon-label");
+ scriptResponseTimeDiv.type = "info-icon";
+ scriptResponseTimeDiv.createTextChild(WebInspector.UIString("Server response time: %s", (new Date(version.scriptResponseTime * 1000)).toConsoleTime()));
+ }
+
var errorMessages = version.errorMessages;
for (var index = 0; index < errorMessages.length; ++index) {
var errorDiv = scriptURLDiv.createChild("div", "service-workers-error");
- errorDiv.createChild("div", "service-workers-error-icon");
+ errorDiv.createChild("label", "", "dt-icon-label").type = "error-icon";
errorDiv.createChild("div", "service-workers-error-message").createTextChild(errorMessages[index].errorMessage);
var script_path = errorMessages[index].sourceURL;
var script_url;
@@ -334,6 +346,7 @@ WebInspector.SWRegistrationElement.prototype = {
script_path = String.sprintf("%s:%d", script_path, errorMessages[index].lineNumber);
errorDiv.createChild("div", "service-workers-error-line").createTextChild(script_path);
}
+
}
if (!versions.length) {
var stateRowElement = versionsElement.createChild("div", "service-workers-version-row");

Powered by Google App Engine
This is Rietveld 408576698