diff options
author | eroman@chromium.org <eroman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-05-17 21:03:44 +0000 |
---|---|---|
committer | eroman@chromium.org <eroman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-05-17 21:03:44 +0000 |
commit | dd963e61f462ae0ec47d5d559d6b52f6219a9c19 (patch) | |
tree | 2763ac8b79a15f6e083eb55fa17ef4f40110ffae /chrome | |
parent | cfe515964240f086da17ea380e680f2e1d1ea862 (diff) | |
download | chromium_src-dd963e61f462ae0ec47d5d559d6b52f6219a9c19.zip chromium_src-dd963e61f462ae0ec47d5d559d6b52f6219a9c19.tar.gz chromium_src-dd963e61f462ae0ec47d5d559d6b52f6219a9c19.tar.bz2 |
On the net-internals text dump, display times as unix timestamps rather than timeticks.
Also use a prettier display for the DNS cache and "bad proxy" cache.
BUG=37421
Review URL: http://codereview.chromium.org/2120002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@47450 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r-- | chrome/browser/resources/net_internals/dataview.js | 49 | ||||
-rw-r--r-- | chrome/browser/resources/net_internals/logviewpainter.js | 3 |
2 files changed, 36 insertions, 16 deletions
diff --git a/chrome/browser/resources/net_internals/dataview.js b/chrome/browser/resources/net_internals/dataview.js index 97b6ac4..6810452 100644 --- a/chrome/browser/resources/net_internals/dataview.js +++ b/chrome/browser/resources/net_internals/dataview.js @@ -38,7 +38,6 @@ DataView.prototype.onExportToText_ = function() { 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 @@ DataView.prototype.onExportToText_ = function() { 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 @@ DataView.prototype.onExportToText_ = function() { 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 @@ DataView.prototype.setText_ = function(text) { }; /** - * 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]' : ''); }; + diff --git a/chrome/browser/resources/net_internals/logviewpainter.js b/chrome/browser/resources/net_internals/logviewpainter.js index 2f060c7..85b5f41 100644 --- a/chrome/browser/resources/net_internals/logviewpainter.js +++ b/chrome/browser/resources/net_internals/logviewpainter.js @@ -55,7 +55,8 @@ PrintSourceEntriesAsText = function(sourceEntries) { tablePrinter.addRow(); tablePrinter.addCell('t='); - var tCell = tablePrinter.addCell(entry.orig.time); + var tCell = tablePrinter.addCell( + g_browser.convertTimeTicksToDate(entry.orig.time).getTime()); tCell.alignRight = true; tablePrinter.addCell(' '); |