diff options
Diffstat (limited to 'chrome/browser/resources/net_internals')
9 files changed, 35 insertions, 169 deletions
diff --git a/chrome/browser/resources/net_internals/browser_bridge.js b/chrome/browser/resources/net_internals/browser_bridge.js index 969df1c..c6822da 100644 --- a/chrome/browser/resources/net_internals/browser_bridge.js +++ b/chrome/browser/resources/net_internals/browser_bridge.js @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -295,10 +295,6 @@ var BrowserBridge = (function() { this.pollableDataHelpers_.serviceProviders.update(serviceProviders); }, - receivedPassiveLogEntries: function(entries) { - this.sourceTracker.onReceivedPassiveLogEntries(entries); - }, - receivedStartConnectionTestSuite: function() { for (var i = 0; i < this.connectionTestsObservers_.length; i++) this.connectionTestsObservers_[i].onStartedConnectionTestSuite(); diff --git a/chrome/browser/resources/net_internals/capture_view.html b/chrome/browser/resources/net_internals/capture_view.html index 3aaee18..f7c3c50 100644 --- a/chrome/browser/resources/net_internals/capture_view.html +++ b/chrome/browser/resources/net_internals/capture_view.html @@ -3,12 +3,8 @@ <b>Network events generated by the browser are being captured to this window ...</b> <table style="margin: 15px"> <tr> - <td>Passively captured events:</td> - <td align=right id=capture-view-passively-captured-count></td> - </tr> - <tr> - <td>Actively captured events:</td> - <td align=right id=capture-view-actively-captured-count></td> + <td>Captured events:</td> + <td align=right id=capture-view-captured-events-count></td> </tr> </table> <p> diff --git a/chrome/browser/resources/net_internals/capture_view.js b/chrome/browser/resources/net_internals/capture_view.js index 954a441..255c3fa 100644 --- a/chrome/browser/resources/net_internals/capture_view.js +++ b/chrome/browser/resources/net_internals/capture_view.js @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -24,9 +24,7 @@ var CaptureView = (function() { byteLoggingCheckbox.onclick = this.onSetByteLogging_.bind(this, byteLoggingCheckbox); - this.activelyCapturedCountBox_ = $(CaptureView.ACTIVELY_CAPTURED_COUNT_ID); - this.passivelyCapturedCountBox_ = - $(CaptureView.PASSIVELY_CAPTURED_COUNT_ID); + this.capturedEventsCountBox_ = $(CaptureView.CAPTURED_EVENTS_COUNT_ID); $(CaptureView.DELETE_ALL_ID).onclick = g_browser.sourceTracker.deleteAllSourceEntries.bind( g_browser.sourceTracker); @@ -45,10 +43,7 @@ var CaptureView = (function() { // IDs for special HTML elements in capture_view.html CaptureView.MAIN_BOX_ID = 'capture-view-tab-content'; CaptureView.BYTE_LOGGING_CHECKBOX_ID = 'capture-view-byte-logging-checkbox'; - CaptureView.PASSIVELY_CAPTURED_COUNT_ID = - 'capture-view-passively-captured-count'; - CaptureView.ACTIVELY_CAPTURED_COUNT_ID = - 'capture-view-actively-captured-count'; + CaptureView.CAPTURED_EVENTS_COUNT_ID = 'capture-view-captured-events-count'; CaptureView.DELETE_ALL_ID = 'capture-view-delete-all'; CaptureView.TIP_ANCHOR_ID = 'capture-view-tip-anchor'; CaptureView.TIP_DIV_ID = 'capture-view-tip-div'; @@ -104,10 +99,8 @@ var CaptureView = (function() { * Updates the counters showing how many events have been captured. */ updateEventCounts_: function() { - this.activelyCapturedCountBox_.textContent = - g_browser.sourceTracker.getNumActivelyCapturedEvents(); - this.passivelyCapturedCountBox_.textContent = - g_browser.sourceTracker.getNumPassivelyCapturedEvents(); + this.capturedEventsCountBox_.textContent = + g_browser.sourceTracker.getNumCapturedEvents(); }, /** diff --git a/chrome/browser/resources/net_internals/help.html b/chrome/browser/resources/net_internals/help.html index 54be2c7..9fb5c1c 100644 --- a/chrome/browser/resources/net_internals/help.html +++ b/chrome/browser/resources/net_internals/help.html @@ -1,6 +1,6 @@ <!DOCTYPE HTML> <html> -<!-- Copyright (c) 2011 The Chromium Authors. All rights reserved. +<!-- Copyright (c) 2012 The Chromium Authors. All rights reserved. Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. --> @@ -49,13 +49,6 @@ the <i>Events</i> tab.</li> <li>Once you close the net-internals window, the data it had captured will be discarded.</li> -<li>Chrome keeps around a small buffer of the most recent network events - even when the net-internals window is not open. That way if you open - chrome://net-internals/ <b>shortly after</b> encountering a problem, - you may still find the relevant data. - These <i>passively captured</i> events are less accurate however, and will - be prefixed in the log with <span style="font-family: monospace;">(P)</span>. -</li> </ul> <button id="popup-close-button">Close this popup</button> diff --git a/chrome/browser/resources/net_internals/log_util.js b/chrome/browser/resources/net_internals/log_util.js index 267f56d..d094dda 100644 --- a/chrome/browser/resources/net_internals/log_util.js +++ b/chrome/browser/resources/net_internals/log_util.js @@ -187,8 +187,8 @@ log_util = (function() { // Check for validity of each log entry, and then add the ones that pass. // Since the events are kept around, and we can't just hide a single view // on a bad event, we have more error checking for them than other data. - var validPassiveEvents = []; - var validActiveEvents = []; + var validEvents = []; + var numDeprecatedPassiveEvents = 0; for (var eventIndex = 0; eventIndex < logDump.events.length; ++eventIndex) { var event = logDump.events[eventIndex]; if (typeof(event) == 'object' && typeof(event.source) == 'object' && @@ -197,23 +197,30 @@ log_util = (function() { getKeyWithValue(LogSourceType, event.source.type) != '?' && getKeyWithValue(LogEventPhase, event.phase) != '?') { if (event.wasPassivelyCaptured) { - validPassiveEvents.push(event); - } else { - validActiveEvents.push(event); + // NOTE: Up until Chrome 18, log dumps included "passively captured" + // events. These are no longer supported, so skip past them + // to avoid confusing the rest of the code. + numDeprecatedPassiveEvents++; + continue; } + validEvents.push(event); } } - g_browser.sourceTracker.onReceivedPassiveLogEntries(validPassiveEvents); - g_browser.sourceTracker.onReceivedLogEntries(validActiveEvents); + g_browser.sourceTracker.onReceivedLogEntries(validEvents); - var numInvalidEvents = logDump.events.length - - validPassiveEvents.length - - validActiveEvents.length; + var numInvalidEvents = logDump.events.length - + (validEvents.length + numDeprecatedPassiveEvents); if (numInvalidEvents > 0) { errorString += 'Unable to load ' + numInvalidEvents + ' events, due to invalid data.\n\n'; } + if (numDeprecatedPassiveEvents > 0) { + errorString += 'Discarded ' + numDeprecatedPassiveEvents + + ' passively collected events. Use an older version of Chrome to' + + ' load this dump if you want to see them.\n\n'; + } + // Update all views with data from the file. Show only those views which // successfully load the data. for (var i = 0; i < tabIds.length; ++i) { diff --git a/chrome/browser/resources/net_internals/log_view_painter.js b/chrome/browser/resources/net_internals/log_view_painter.js index f380dce..7ff9578 100644 --- a/chrome/browser/resources/net_internals/log_view_painter.js +++ b/chrome/browser/resources/net_internals/log_view_painter.js @@ -21,9 +21,7 @@ function canCollapseBeginWithEnd(beginEntry) { beginEntry.isBegin() && beginEntry.end && beginEntry.end.index == beginEntry.index + 1 && - (!beginEntry.orig.params || !beginEntry.end.orig.params) && - beginEntry.orig.wasPassivelyCaptured == - beginEntry.end.orig.wasPassivelyCaptured; + (!beginEntry.orig.params || !beginEntry.end.orig.params); } /** @@ -48,9 +46,6 @@ printLogEntriesAsText = function(logEntries, parent) { if (!entry.isEnd() || !canCollapseBeginWithEnd(entry.begin)) { tablePrinter.addRow(); - // Annotate this entry with "(P)" if it was passively captured. - tablePrinter.addCell(entry.orig.wasPassivelyCaptured ? '(P) ' : ''); - tablePrinter.addCell('t='); var date = timeutil.convertTimeTicksToDate(entry.orig.time) ; var tCell = tablePrinter.addCell(date.getTime()); @@ -80,9 +75,8 @@ printLogEntriesAsText = function(logEntries, parent) { // Output the extra parameters. if (entry.orig.params != undefined) { - // Those 6 skipped cells are: passive annotation, two for "t=", and - // three for "st=". - tablePrinter.setNewRowCellIndent(6 + entry.getDepth()); + // Those 5 skipped cells are: two for "t=", and three for "st=". + tablePrinter.setNewRowCellIndent(5 + entry.getDepth()); addRowsForExtraParams(tablePrinter, entry.orig, g_browser.sourceTracker.getSecurityStripping()); diff --git a/chrome/browser/resources/net_internals/proxy_view.html b/chrome/browser/resources/net_internals/proxy_view.html index 59969e4..b5d9bca 100644 --- a/chrome/browser/resources/net_internals/proxy_view.html +++ b/chrome/browser/resources/net_internals/proxy_view.html @@ -31,17 +31,6 @@ </tr></table> - <h4>Proxy auto-config initialization</h4> - <ul> - <li> - <a href='#events&q=type:PROXY_SCRIPT_DECIDER'>View all events</a> - </li> - <li> - Latest proxy resolver event: - <div id=proxy-view-resolver-log class=event-log></div> - </li> - </ul> - <h4> Proxies which have failed recently, and are marked as bad <input type=button value="Clear bad proxies" id=proxy-view-clear-bad-proxies class="hideOnLoadLog" /> diff --git a/chrome/browser/resources/net_internals/proxy_view.js b/chrome/browser/resources/net_internals/proxy_view.js index e33589a..a97d36b 100644 --- a/chrome/browser/resources/net_internals/proxy_view.js +++ b/chrome/browser/resources/net_internals/proxy_view.js @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -7,7 +7,6 @@ * * - Shows the current proxy settings. * - Has a button to reload these settings. - * - Shows the log entries for the most recent PROXY_SCRIPT_DECIDER source * - Shows the list of proxy hostnames that are cached as "bad". * - Has a button to clear the cached bad proxies. */ @@ -26,8 +25,6 @@ var ProxyView = (function() { // Call superclass's constructor. superClass.call(this, ProxyView.MAIN_BOX_ID); - this.latestProxySourceId_ = 0; - // Hook up the UI components. $(ProxyView.RELOAD_SETTINGS_BUTTON_ID).onclick = g_browser.sendReloadProxySettings.bind(g_browser); @@ -37,7 +34,6 @@ var ProxyView = (function() { // Register to receive proxy information as it changes. g_browser.addProxySettingsObserver(this, true); g_browser.addBadProxiesObserver(this, true); - g_browser.sourceTracker.addSourceEntryObserver(this); } // ID for special HTML element in category_tabs.html @@ -50,7 +46,6 @@ var ProxyView = (function() { ProxyView.RELOAD_SETTINGS_BUTTON_ID = 'proxy-view-reload-settings'; ProxyView.BAD_PROXIES_TBODY_ID = 'proxy-view-bad-proxies-tbody'; ProxyView.CLEAR_BAD_PROXIES_BUTTON_ID = 'proxy-view-clear-bad-proxies'; - ProxyView.PROXY_RESOLVER_LOG_DIV_ID = 'proxy-view-resolver-log'; cr.addSingletonGetter(ProxyView); @@ -58,32 +53,11 @@ var ProxyView = (function() { // Inherit the superclass's methods. __proto__: superClass.prototype, - onLoadLogStart: function(data) { - // Need to reset this so the latest proxy source from the dump can be - // identified when the log entries are loaded. - this.latestProxySourceId_ = 0; - }, - - onLoadLogFinish: function(data, tabData) { - // It's possible that the last PROXY_SCRIPT_DECIDER source was deleted - // from the log, but earlier sources remain. When that happens, clear the - // list of entries here, to avoid displaying misleading information. - if (tabData != this.latestProxySourceId_) - this.clearLog_(); + onLoadLogFinish: function(data) { return this.onProxySettingsChanged(data.proxySettings) && this.onBadProxiesChanged(data.badProxies); }, - /** - * Save view-specific state. - * - * Save the greatest seen proxy source id, so we will not incorrectly - * identify the log source associated with the current proxy configuration. - */ - saveState: function() { - return this.latestProxySourceId_; - }, - onProxySettingsChanged: function(proxySettings) { // Both |original| and |effective| are dictionaries describing the // settings. @@ -123,47 +97,6 @@ var ProxyView = (function() { addTextNode(badUntilCell, badUntilDate.toLocaleString()); } return true; - }, - - /** - * Called whenever SourceEntries are updated with new log entries. Updates - * |proxyResolverLogPre_| with the log entries of the PROXY_SCRIPT_DECIDER - * SourceEntry with the greatest id. - */ - onSourceEntriesUpdated: function(sourceEntries) { - for (var i = sourceEntries.length - 1; i >= 0; --i) { - var sourceEntry = sourceEntries[i]; - - if (sourceEntry.getSourceType() != LogSourceType.PROXY_SCRIPT_DECIDER || - this.latestProxySourceId_ > sourceEntry.getSourceId()) { - continue; - } - - this.latestProxySourceId_ = sourceEntry.getSourceId(); - - $(ProxyView.PROXY_RESOLVER_LOG_DIV_ID).innerHTML = ''; - sourceEntry.printAsText($(ProxyView.PROXY_RESOLVER_LOG_DIV_ID)); - } - }, - - /** - * Clears the display of and log entries for the last proxy lookup. - */ - clearLog_: function() { - // Prevents display of partial logs. - ++this.latestProxySourceId_; - - $(ProxyView.PROXY_RESOLVER_LOG_DIV_ID).innerHTML = ''; - $(ProxyView.PROXY_RESOLVER_LOG_DIV_ID).innerText = 'Deleted.'; - }, - - onSourceEntriesDeleted: function(sourceIds) { - if (sourceIds.indexOf(this.latestProxySourceId_) != -1) - this.clearLog_(); - }, - - onAllSourceEntriesDeleted: function() { - this.clearLog_(); } }; diff --git a/chrome/browser/resources/net_internals/source_tracker.js b/chrome/browser/resources/net_internals/source_tracker.js index 153f529..d257f25 100644 --- a/chrome/browser/resources/net_internals/source_tracker.js +++ b/chrome/browser/resources/net_internals/source_tracker.js @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -40,8 +40,6 @@ var SourceTracker = (function() { // Needed to simplify deletion, identify associated GUI elements, etc. this.nextSourcelessEventId_ = -1; - this.numPassivelyCapturedEvents_ = 0; - // Ordered list of log entries. Needed to maintain original order when // generating log dumps this.capturedEvents_ = []; @@ -67,16 +65,8 @@ var SourceTracker = (function() { * Returns the number of events that were captured while we were * listening for events. */ - getNumActivelyCapturedEvents: function() { - return this.capturedEvents_.length - this.numPassivelyCapturedEvents_; - }, - - /** - * Returns the number of events that were captured passively by the - * browser prior to when the net-internals page was started. - */ - getNumPassivelyCapturedEvents: function() { - return this.numPassivelyCapturedEvents_; + getNumCapturedEvents: function() { + return this.capturedEvents_.length; }, /** @@ -97,28 +87,6 @@ var SourceTracker = (function() { return this.sourceEntries_[id]; }, - onReceivedPassiveLogEntries: function(logEntries) { - // Due to an expected race condition, it is possible to receive actively - // captured log entries before the passively logged entries are received. - // - // When that happens, we create a copy of the actively logged entries, - // delete all entries, and, after handling all the passively logged - // entries, add back the deleted actively logged entries. - var earlyActivelyCapturedEvents = this.capturedEvents_.slice(0); - if (earlyActivelyCapturedEvents.length > 0) - this.deleteAllSourceEntries(); - - this.numPassivelyCapturedEvents_ = logEntries.length; - for (var i = 0; i < logEntries.length; ++i) - logEntries[i].wasPassivelyCaptured = true; - - this.onReceivedLogEntries(logEntries); - - // Add back early actively captured events, if any. - if (earlyActivelyCapturedEvents.length) - this.onReceivedLogEntries(earlyActivelyCapturedEvents); - }, - /** * Sends each entry to all observers and updates |capturedEvents_|. * Also assigns unique ids to log entries without a source. @@ -179,11 +147,8 @@ var SourceTracker = (function() { var newEventList = []; for (var i = 0; i < this.capturedEvents_.length; ++i) { var id = this.capturedEvents_[i].source.id; - if (id in sourceIdDict) { - if (this.capturedEvents_[i].wasPassivelyCaptured) - --this.numPassivelyCapturedEvents_; + if (id in sourceIdDict) continue; - } newEventList.push(this.capturedEvents_[i]); } this.capturedEvents_ = newEventList; |