diff options
author | mmenke@chromium.org <mmenke@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-10-07 16:25:11 +0000 |
---|---|---|
committer | mmenke@chromium.org <mmenke@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-10-07 16:25:11 +0000 |
commit | f7d310e6efba786c36ed71e05b44e6029f17a538 (patch) | |
tree | 91ae1e427ad922e667fdd4c1828917b311fee6f7 /chrome/browser/resources | |
parent | 580f18dc33016aac867053c6b239fc95f6e6b123 (diff) | |
download | chromium_src-f7d310e6efba786c36ed71e05b44e6029f17a538.zip chromium_src-f7d310e6efba786c36ed71e05b44e6029f17a538.tar.gz chromium_src-f7d310e6efba786c36ed71e05b44e6029f17a538.tar.bz2 |
Shows the default_address_family on both the DNS tab and in log dumps,
and adds an extra note emphasizing when IPv6 has been disabled to both
pages.
Also adds a button to enable IPv6 when it's been disabled, and maps
address family values on the DNS tab to their symbolic names.
BUG=55007,55005
TEST=manual
Review URL: http://codereview.chromium.org/3387007
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@61795 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/resources')
-rw-r--r-- | chrome/browser/resources/net_internals/dataview.js | 15 | ||||
-rw-r--r-- | chrome/browser/resources/net_internals/dnsview.js | 31 | ||||
-rw-r--r-- | chrome/browser/resources/net_internals/index.html | 12 | ||||
-rw-r--r-- | chrome/browser/resources/net_internals/main.css | 7 | ||||
-rw-r--r-- | chrome/browser/resources/net_internals/main.js | 41 | ||||
-rw-r--r-- | chrome/browser/resources/net_internals/proxyview.js | 2 |
6 files changed, 83 insertions, 25 deletions
diff --git a/chrome/browser/resources/net_internals/dataview.js b/chrome/browser/resources/net_internals/dataview.js index 97969c9..25072c1 100644 --- a/chrome/browser/resources/net_internals/dataview.js +++ b/chrome/browser/resources/net_internals/dataview.js @@ -102,6 +102,14 @@ DataView.prototype.onExportToText_ = function() { text.push('Command line: ' + ClientInfo.command_line); text.push(''); + var default_address_family = + g_browser.hostResolverInfo_.currentData_.default_address_family; + text.push('Default address family: ' + + getKeyWithValue(AddressFamily, default_address_family)); + if (default_address_family == AddressFamily.ADDRESS_FAMILY_IPV4) + text.push(' (IPv6 disabled)'); + + text.push(''); text.push('----------------------------------------------'); text.push(' Proxy settings (effective)'); text.push('----------------------------------------------'); @@ -144,9 +152,9 @@ DataView.prototype.onExportToText_ = function() { text.push('----------------------------------------------'); text.push(''); - var hostResolverCache = g_browser.hostResolverCache_.currentData_; + var hostResolverCache = g_browser.hostResolverInfo_.currentData_.cache; - text.push('Capcity: ' + hostResolverCache.capacity); + text.push('Capacity: ' + hostResolverCache.capacity); text.push('Time to live for successful resolves (ms): ' + hostResolverCache.ttl_success_ms); text.push('Time to live for failed resolves (ms): ' + @@ -159,7 +167,8 @@ DataView.prototype.onExportToText_ = function() { text.push(''); text.push('(' + (i+1) + ')'); text.push('Hostname: ' + e.hostname); - text.push('Address family: ' + e.address_family); + text.push('Address family: ' + + getKeyWithValue(AddressFamily, e.address_family)); if (e.error != undefined) { text.push('Error: ' + e.error); diff --git a/chrome/browser/resources/net_internals/dnsview.js b/chrome/browser/resources/net_internals/dnsview.js index b1f7d2f..8c1b6f4 100644 --- a/chrome/browser/resources/net_internals/dnsview.js +++ b/chrome/browser/resources/net_internals/dnsview.js @@ -5,6 +5,8 @@ /** * This view displays information on the host resolver: * + * - Shows the default address family. + * - Has a button to enable IPv6, if it is disabled. * - Shows the current host cache contents. * - Has a button to clear the host cache. * - Shows the parameters used to construct the host cache (capacity, ttl). @@ -14,6 +16,9 @@ function DnsView(mainBoxId, cacheTbodyId, clearCacheButtonId, + defaultFamilySpanId, + ipv6DisabledSpanId, + enableIPv6ButtonId, capacitySpanId, ttlSuccessSpanId, ttlFailureSpanId) { @@ -21,6 +26,12 @@ function DnsView(mainBoxId, // Hook up the UI components. this.cacheTbody_ = document.getElementById(cacheTbodyId); + this.defaultFamilySpan_ = document.getElementById(defaultFamilySpanId); + this.ipv6DisabledSpan_ = document.getElementById(ipv6DisabledSpanId); + + document.getElementById(enableIPv6ButtonId).onclick = + g_browser.enableIPv6.bind(g_browser); + this.capacitySpan_ = document.getElementById(capacitySpanId); this.ttlSuccessSpan_ = document.getElementById(ttlSuccessSpanId); this.ttlFailureSpan_ = document.getElementById(ttlFailureSpanId); @@ -29,24 +40,32 @@ function DnsView(mainBoxId, clearCacheButton.onclick = g_browser.sendClearHostResolverCache.bind(g_browser); - // Register to receive changes to the host resolver cache. - g_browser.addHostResolverCacheObserver(this); + // Register to receive changes to the host resolver info. + g_browser.addHostResolverInfoObserver(this); } inherits(DnsView, DivView); -DnsView.prototype.onHostResolverCacheChanged = function(hostResolverCache) { +DnsView.prototype.onHostResolverInfoChanged = function(hostResolverInfo) { // Clear the existing values. + this.defaultFamilySpan_.innerHTML = ''; this.capacitySpan_.innerHTML = ''; this.ttlSuccessSpan_.innerHTML = ''; this.ttlFailureSpan_.innerHTML = ''; this.cacheTbody_.innerHTML = ''; - // No cache. - if (!hostResolverCache) + // No info. + if (!hostResolverInfo) return; + var family = hostResolverInfo.default_address_family; + addTextNode(this.defaultFamilySpan_, getKeyWithValue(AddressFamily, family)); + + var ipv6Disabled = (family == AddressFamily.ADDRESS_FAMILY_IPV4); + setNodeDisplay(this.ipv6DisabledSpan_, ipv6Disabled); + // Fill in the basic cache information. + var hostResolverCache = hostResolverInfo.cache; addTextNode(this.capacitySpan_, hostResolverCache.capacity); addTextNode(this.ttlSuccessSpan_, hostResolverCache.ttl_success_ms); addTextNode(this.ttlFailureSpan_, hostResolverCache.ttl_failure_ms); @@ -60,7 +79,7 @@ DnsView.prototype.onHostResolverCacheChanged = function(hostResolverCache) { addTextNode(hostnameCell, e.hostname); var familyCell = addNode(tr, 'td'); - addTextNode(familyCell, e.address_family); + addTextNode(familyCell, getKeyWithValue(AddressFamily, e.address_family)); var addressesCell = addNode(tr, 'td'); diff --git a/chrome/browser/resources/net_internals/index.html b/chrome/browser/resources/net_internals/index.html index be8ffc5..1ab90e6 100644 --- a/chrome/browser/resources/net_internals/index.html +++ b/chrome/browser/resources/net_internals/index.html @@ -83,7 +83,17 @@ found in the LICENSE file. </div> <!-- Host resolver info --> <div id=dnsTabContent> - <a href='#events&q=type:HOST_RESOLVER_IMPL_REQUEST%20type:HOST_RESOLVER_IMPL_JOB%20is:active'>View pending lookups</a> + <h4>Host resolver</h4> + <ul> + <li><a href='#events&q=type:HOST_RESOLVER_IMPL_REQUEST%20type:HOST_RESOLVER_IMPL_JOB%20is:active'>View pending lookups</a></li> + <li>Default address family: <span id=hostResolverDefaultFamily></span> + <span id=hostResolverIPv6Disabled class=warningText style="display: none;"> + (IPv6 disabled) + <input type=button value="Enable IPv6" id=hostResolverEnableIPv6 /> + </span> + </li> + </ul> + <h4> Host resolver cache <input type=button value="Clear host cache" id=clearHostResolverCache /> diff --git a/chrome/browser/resources/net_internals/main.css b/chrome/browser/resources/net_internals/main.css index f411b05..0102cfb 100644 --- a/chrome/browser/resources/net_internals/main.css +++ b/chrome/browser/resources/net_internals/main.css @@ -254,3 +254,10 @@ table.styledTable, font-size: 100%; font-weight: bold; } + +/** + * Styling for text indicating a potential problem or error state. + */ +.warningText { + color: red; +} diff --git a/chrome/browser/resources/net_internals/main.js b/chrome/browser/resources/net_internals/main.js index fb14d38..d0fd947 100644 --- a/chrome/browser/resources/net_internals/main.js +++ b/chrome/browser/resources/net_internals/main.js @@ -11,6 +11,7 @@ var ClientInfo = null; var LogSourceType = null; var NetError = null; var LoadFlag = null; +var AddressFamily = null; /** * Object to communicate between the renderer and the browser. @@ -61,6 +62,9 @@ function onLoaded() { var dnsView = new DnsView("dnsTabContent", "hostResolverCacheTbody", "clearHostResolverCache", + "hostResolverDefaultFamily", + "hostResolverIPv6Disabled", + "hostResolverEnableIPv6", "hostResolverCacheCapacity", "hostResolverCacheTTLSuccess", "hostResolverCacheTTLFailure"); @@ -149,8 +153,8 @@ function BrowserBridge() { this.proxySettings_ = new PollableDataHelper('onProxySettingsChanged'); this.badProxies_ = new PollableDataHelper('onBadProxiesChanged'); this.httpCacheInfo_ = new PollableDataHelper('onHttpCacheInfoChanged'); - this.hostResolverCache_ = - new PollableDataHelper('onHostResolverCacheChanged'); + this.hostResolverInfo_ = + new PollableDataHelper('onHostResolverInfoChanged'); this.socketPoolInfo_ = new PollableDataHelper('onSocketPoolInfoChanged'); this.serviceProviders_ = new PollableDataHelper('onServiceProvidersChanged'); @@ -231,9 +235,9 @@ BrowserBridge.prototype.sendGetBadProxies = function() { chrome.send('getBadProxies'); }; -BrowserBridge.prototype.sendGetHostResolverCache = function() { - // The browser will call receivedHostResolverCache on completion. - chrome.send('getHostResolverCache'); +BrowserBridge.prototype.sendGetHostResolverInfo = function() { + // The browser will call receivedHostResolverInfo on completion. + chrome.send('getHostResolverInfo'); }; BrowserBridge.prototype.sendClearBadProxies = function() { @@ -260,6 +264,10 @@ BrowserBridge.prototype.sendGetServiceProviders = function() { chrome.send('getServiceProviders'); }; +BrowserBridge.prototype.enableIPv6 = function() { + chrome.send('enableIPv6'); +}; + //------------------------------------------------------------------------------ // Messages received from the browser //------------------------------------------------------------------------------ @@ -305,6 +313,11 @@ BrowserBridge.prototype.receivedNetErrorConstants = function(constantsMap) { NetError = constantsMap; }; +BrowserBridge.prototype.receivedAddressFamilyConstants = +function(constantsMap) { + AddressFamily = constantsMap; +}; + BrowserBridge.prototype.receivedTimeTickOffset = function(timeTickOffset) { this.timeTickOffset_ = timeTickOffset; }; @@ -317,9 +330,9 @@ BrowserBridge.prototype.receivedBadProxies = function(badProxies) { this.badProxies_.update(badProxies); }; -BrowserBridge.prototype.receivedHostResolverCache = -function(hostResolverCache) { - this.hostResolverCache_.update(hostResolverCache); +BrowserBridge.prototype.receivedHostResolverInfo = +function(hostResolverInfo) { + this.hostResolverInfo_.update(hostResolverInfo); }; BrowserBridge.prototype.receivedSocketPoolInfo = function(socketPoolInfo) { @@ -422,18 +435,18 @@ BrowserBridge.prototype.addProxySettingsObserver = function(observer) { * badProxies[i].bad_until: The time when the proxy stops being considered * bad. Note the time is in time ticks. */ -BrowserBridge.prototype.addBadProxiesObsever = function(observer) { +BrowserBridge.prototype.addBadProxiesObserver = function(observer) { this.badProxies_.addObserver(observer); }; /** - * Adds a listener of the host resolver cache. |observer| will be called back + * Adds a listener of the host resolver info. |observer| will be called back * when data is received, through: * - * observer.onHostResolverCacheChanged(hostResolverCache) + * observer.onHostResolverInfoChanged(hostResolverInfo) */ -BrowserBridge.prototype.addHostResolverCacheObserver = function(observer) { - this.hostResolverCache_.addObserver(observer); +BrowserBridge.prototype.addHostResolverInfoObserver = function(observer) { + this.hostResolverInfo_.addObserver(observer); }; /** @@ -558,7 +571,7 @@ BrowserBridge.prototype.doPolling_ = function() { // frequency poll since it won't impact the display. this.sendGetProxySettings(); this.sendGetBadProxies(); - this.sendGetHostResolverCache(); + this.sendGetHostResolverInfo(); this.sendGetHttpCacheInfo(); this.sendGetSocketPoolInfo(); if (this.isPlatformWindows()) diff --git a/chrome/browser/resources/net_internals/proxyview.js b/chrome/browser/resources/net_internals/proxyview.js index 6814609..54bb3fc 100644 --- a/chrome/browser/resources/net_internals/proxyview.js +++ b/chrome/browser/resources/net_internals/proxyview.js @@ -35,7 +35,7 @@ function ProxyView(mainBoxId, // Register to receive proxy information as it changes. g_browser.addProxySettingsObserver(this); - g_browser.addBadProxiesObsever(this); + g_browser.addBadProxiesObserver(this); } inherits(ProxyView, DivView); |