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

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: incorporated dgozman's comment 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..24ae0cc5626c4782fbf25575c1f48135e81adb8d 100644
--- a/Source/devtools/front_end/resources/ServiceWorkersView.js
+++ b/Source/devtools/front_end/resources/ServiceWorkersView.js
@@ -321,10 +321,24 @@ WebInspector.SWRegistrationElement.prototype = {
inspectButton.createTextChild(WebInspector.UIString("inspect"));
inspectButton.addEventListener("click", this._inspectButtonClicked.bind(this, version.id), false);
}
+
+ if (version.scriptLastModified) {
+ var scriptLastModifiedDiv = scriptURLDiv.createChild("div", "service-workers-info");
dgozman 2015/03/30 15:22:16 You can just create "dt-icon-label" in scriptURLDi
horo 2015/03/30 15:39:52 Done.
+ var scriptLastModifiedText = WebInspector.UIString("Last-Modified: %s", (new Date(version.scriptLastModified * 1000)).toConsoleTime());
+ scriptLastModifiedDiv.createChild("label", "", "dt-icon-label").type = "info-icon";
+ scriptLastModifiedDiv.createChild("div", "service-workers-info-message service-worker-script-last-modified").createTextChild(scriptLastModifiedText);
dgozman 2015/03/30 15:22:15 I don't see where you use these classes.
horo 2015/03/30 15:39:52 Removed service-workers-info-message. service-work
+ }
+ if (version.scriptResponseTime) {
+ var scriptResponseTimeDiv = scriptURLDiv.createChild("div", "service-workers-info");
+ var scriptResponseTimeText = WebInspector.UIString("Server response time: %s", (new Date(version.scriptLastModified * 1000)).toConsoleTime());
+ scriptResponseTimeDiv.createChild("label", "", "dt-icon-label").type = "info-icon";
+ scriptResponseTimeDiv.createChild("div", "service-workers-info-message service-worker-script-response-time").createTextChild(scriptResponseTimeText);
dgozman 2015/03/30 15:22:16 ditto
horo 2015/03/30 15:39:52 Removed service-workers-info-message. service-work
+ }
+
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 +348,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