| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 /** | 5 /** |
| 6 * This view displays information on the host resolver: | 6 * This view displays information on the host resolver: |
| 7 * | 7 * |
| 8 * - Shows the default address family. | 8 * - Shows the default address family. |
| 9 * - Has a button to enable IPv6, if it is disabled. | 9 * - Has a button to enable IPv6, if it is disabled. |
| 10 * - Shows the current host cache contents. | 10 * - Shows the current host cache contents. |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 93 $(DnsView.CAPACITY_SPAN_ID).innerText = hostResolverCache.capacity; | 93 $(DnsView.CAPACITY_SPAN_ID).innerText = hostResolverCache.capacity; |
| 94 $(DnsView.TTL_SUCCESS_SPAN_ID).innerText = | 94 $(DnsView.TTL_SUCCESS_SPAN_ID).innerText = |
| 95 hostResolverCache.ttl_success_ms; | 95 hostResolverCache.ttl_success_ms; |
| 96 $(DnsView.TTL_FAILURE_SPAN_ID).innerText = | 96 $(DnsView.TTL_FAILURE_SPAN_ID).innerText = |
| 97 hostResolverCache.ttl_failure_ms; | 97 hostResolverCache.ttl_failure_ms; |
| 98 | 98 |
| 99 var expiredEntries = 0; | 99 var expiredEntries = 0; |
| 100 // Date the cache was logged. This will be either now, when actively | 100 // Date the cache was logged. This will be either now, when actively |
| 101 // logging data, or the date the log dump was created. | 101 // logging data, or the date the log dump was created. |
| 102 var logDate; | 102 var logDate; |
| 103 if (MainView.getInstance().isViewingLoadedLog()) { | 103 if (MainView.isViewingLoadedLog()) { |
| 104 if (typeof ClientInfo.numericDate == 'number') { | 104 if (typeof ClientInfo.numericDate == 'number') { |
| 105 logDate = new Date(ClientInfo.numericDate); | 105 logDate = new Date(ClientInfo.numericDate); |
| 106 } else { | 106 } else { |
| 107 // This is to prevent displaying entries as expired when loading | 107 // This is to prevent displaying entries as expired when loading |
| 108 // old logs. | 108 // old logs. |
| 109 // TODO(mmenke): Remove when Chrome 17 hits stable. | 109 // TODO(mmenke): Remove when Chrome 17 hits stable. |
| 110 logDate = new Date(0); | 110 logDate = new Date(0); |
| 111 } | 111 } |
| 112 } else { | 112 } else { |
| 113 logDate = new Date(); | 113 logDate = new Date(); |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 154 | 154 |
| 155 $(DnsView.ACTIVE_SPAN_ID).innerText = | 155 $(DnsView.ACTIVE_SPAN_ID).innerText = |
| 156 hostResolverCache.entries.length - expiredEntries; | 156 hostResolverCache.entries.length - expiredEntries; |
| 157 $(DnsView.EXPIRED_SPAN_ID).innerText = expiredEntries; | 157 $(DnsView.EXPIRED_SPAN_ID).innerText = expiredEntries; |
| 158 return true; | 158 return true; |
| 159 } | 159 } |
| 160 }; | 160 }; |
| 161 | 161 |
| 162 return DnsView; | 162 return DnsView; |
| 163 })(); | 163 })(); |
| OLD | NEW |