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

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

Issue 6465001: Display more information at chrome://net-internals/#spdy... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 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 | « chrome/browser/resources/net_internals/main.js ('k') | net/http/http_alternate_protocols.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/resources/net_internals/spdyview.js
===================================================================
--- chrome/browser/resources/net_internals/spdyview.js (revision 74346)
+++ chrome/browser/resources/net_internals/spdyview.js (working copy)
@@ -8,11 +8,27 @@
*
* @constructor
*/
-function SpdyView(mainBoxId, spdySessionNoneSpanId, spdySessionLinkSpanId,
+function SpdyView(mainBoxId, spdyEnabledSpanId,
+ spdyUseAlternateProtocolSpanId,
+ spdyForceAlwaysSpanId, spdyForceOverSslSpanId,
+ spdyNextProtocolsSpanId, spdyAlternateProtocolMappingsDivId,
+ spdySessionNoneSpanId, spdySessionLinkSpanId,
spdySessionDivId) {
DivView.call(this, mainBoxId);
g_browser.addSpdySessionInfoObserver(this);
+ g_browser.addSpdyStatusObserver(this);
+ g_browser.addSpdyAlternateProtocolMappingsObserver(this);
+ this.spdyEnabledSpan_ = document.getElementById(spdyEnabledSpanId);
+ this.spdyUseAlternateProtocolSpan_ =
+ document.getElementById(spdyUseAlternateProtocolSpanId);
+ this.spdyForceAlwaysSpan_ = document.getElementById(spdyForceAlwaysSpanId);
+ this.spdyForceOverSslSpan_ = document.getElementById(spdyForceOverSslSpanId);
+ this.spdyNextProtocolsSpan_ =
+ document.getElementById(spdyNextProtocolsSpanId);
+
+ this.spdyAlternateProtocolMappingsDiv_ =
+ document.getElementById(spdyAlternateProtocolMappingsDivId);
this.spdySessionNoneSpan_ = document.getElementById(spdySessionNoneSpanId);
this.spdySessionLinkSpan_ = document.getElementById(spdySessionLinkSpanId);
this.spdySessionDiv_ = document.getElementById(spdySessionDivId);
@@ -36,9 +52,42 @@
var tablePrinter = SpdyView.createSessionTablePrinter(spdySessionInfo);
tablePrinter.toHTML(this.spdySessionDiv_, 'styledTable');
+
};
/**
+ * Displays information on the global SPDY status.
+ */
+SpdyView.prototype.onSpdyStatusChanged = function(spdyStatus) {
+ this.spdyEnabledSpan_.innerText = spdyStatus.spdy_enabled;
+ this.spdyUseAlternateProtocolSpan_.innerText =
+ spdyStatus.use_alternate_protocols;
+ this.spdyForceAlwaysSpan_.innerText = spdyStatus.force_spdy_always;
+ this.spdyForceOverSslSpan_.innerText = spdyStatus.force_spdy_over_ssl;
+ this.spdyNextProtocolsSpan_.innerText = spdyStatus.next_protos;
+}
+
+/**
+ * If |spdyAlternateProtocolMappings| is not empty, displays a single table
+ * with information on each alternate protocol enabled server. Otherwise,
+ * displays "None".
+ */
+SpdyView.prototype.onSpdyAlternateProtocolMappingsChanged =
+ function(spdyAlternateProtocolMappings) {
+
+ this.spdyAlternateProtocolMappingsDiv_.innerHTML = '';
+
+ if (spdyAlternateProtocolMappings != null &&
+ spdyAlternateProtocolMappings.length > 0) {
+ var tabPrinter = SpdyView.createAlternateProtocolMappingsTablePrinter(
+ spdyAlternateProtocolMappings);
+ tabPrinter.toHTML(this.spdyAlternateProtocolMappingsDiv_, 'styledTable');
+ } else {
+ this.spdyAlternateProtocolMappingsDiv_.innerHTML = 'None';
+ }
+};
+
+/**
* Creates a table printer to print out the state of list of SPDY sessions.
*/
SpdyView.createSessionTablePrinter = function(spdySessions) {
@@ -85,3 +134,24 @@
return tablePrinter;
};
+
+/**
+ * Creates a table printer to print out the list of alternate protocol
+ * mappings.
+ */
+SpdyView.createAlternateProtocolMappingsTablePrinter =
+ function(spdyAlternateProtocolMappings) {
+ var tablePrinter = new TablePrinter();
+ tablePrinter.addHeaderCell('Host');
+ tablePrinter.addHeaderCell('Alternate Protocol');
+
+ for (var i = 0; i < spdyAlternateProtocolMappings.length; i++) {
+ var entry = spdyAlternateProtocolMappings[i];
+ tablePrinter.addRow();
+
+ tablePrinter.addCell(entry.host_port_pair);
+ tablePrinter.addCell(entry.alternate_protocol);
+ }
+ return tablePrinter;
+};
+
« no previous file with comments | « chrome/browser/resources/net_internals/main.js ('k') | net/http/http_alternate_protocols.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698