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

Unified Diff: chrome/browser/resources/net_internals/dataview.js

Issue 2120002: On the net-internals text dump, display times as unix timestamps rather than ... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 10 years, 7 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 | « no previous file | chrome/browser/resources/net_internals/logviewpainter.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/resources/net_internals/dataview.js
===================================================================
--- chrome/browser/resources/net_internals/dataview.js (revision 47219)
+++ chrome/browser/resources/net_internals/dataview.js (working copy)
@@ -38,7 +38,6 @@
g_browser.getAllPassivelyCapturedEvents().length);
text.push('Number of actively captured events: ' +
g_browser.getAllActivelyCapturedEvents().length);
- text.push('Timetick to timestamp offset: ' + g_browser.timeTickOffset_);
text.push('');
// TODO(eroman): fill this with proper values.
text.push('Chrome version: ' + 'TODO');
@@ -56,13 +55,19 @@
text.push('----------------------------------------------');
text.push(' Bad proxies cache');
text.push('----------------------------------------------');
- text.push('');
var badProxiesList = g_browser.badProxies_.currentData_;
if (badProxiesList.length == 0) {
+ text.push('');
text.push('None');
} else {
- this.appendPrettyPrintedTable_(badProxiesList, text);
+ for (var i = 0; i < badProxiesList.length; ++i) {
+ var e = badProxiesList[i];
+ text.push('');
+ text.push('(' + (i+1) + ')');
+ text.push('Proxy: ' + e.proxy_uri);
+ text.push('Bad until: ' + this.formatExpirationTime_(e.bad_until));
+ }
}
text.push('');
@@ -80,8 +85,27 @@
hostResolverCache.ttl_failure_ms);
if (hostResolverCache.entries.length > 0) {
+ for (var i = 0; i < hostResolverCache.entries.length; ++i) {
+ var e = hostResolverCache.entries[i];
+
+ text.push('');
+ text.push('(' + (i+1) + ')');
+ text.push('Hostname: ' + e.hostname);
+ text.push('Address family: ' + e.address_family);
+
+ if (e.error != undefined) {
+ text.push('Error: ' + e.error);
+ } else {
+ for (var j = 0; j < e.addresses.length; ++j) {
+ text.push('Address ' + (j + 1) + ': ' + e.addresses[j]);
+ }
+ }
+
+ text.push('Valid until: ' + this.formatExpirationTime_(e.expiration));
+ }
+ } else {
text.push('');
- this.appendPrettyPrintedTable_(hostResolverCache.entries, text);
+ text.push('None');
}
text.push('');
@@ -153,17 +177,12 @@
};
/**
- * Stringifies |arrayData| to formatted table output, and appends it to the
- * line buffer |out|.
+ * Format a time ticks count as a timestamp.
*/
-DataView.prototype.appendPrettyPrintedTable_ = function(arrayData, out) {
- for (var i = 0; i < arrayData.length; ++i) {
- var e = arrayData[i];
- var eString = '[' + i + ']: ';
- for (var key in e) {
- eString += key + "=" + e[key] + "; ";
- }
- out.push(eString);
- }
+DataView.prototype.formatExpirationTime_ = function(timeTicks) {
+ var d = g_browser.convertTimeTicksToDate(timeTicks);
+ var isExpired = d.getTime() < (new Date()).getTime();
+ return 't=' + d.getTime() + (isExpired ? ' [EXPIRED]' : '');
};
+
« no previous file with comments | « no previous file | chrome/browser/resources/net_internals/logviewpainter.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698