| Index: chrome/browser/resources/net_internals/main.js
|
| ===================================================================
|
| --- chrome/browser/resources/net_internals/main.js (revision 67848)
|
| +++ chrome/browser/resources/net_internals/main.js (working copy)
|
| @@ -308,9 +308,6 @@
|
| //------------------------------------------------------------------------------
|
|
|
| BrowserBridge.prototype.receivedLogEntry = function(logEntry) {
|
| - // Silently drop entries received before ready to receive them.
|
| - if (!this.areLogTypesReady_())
|
| - return;
|
| // Assign unique ID, if needed.
|
| if (logEntry.source.id == 0) {
|
| logEntry.source.id = this.nextSourcelessEventId_;
|
| @@ -388,12 +385,27 @@
|
| };
|
|
|
| BrowserBridge.prototype.receivedPassiveLogEntries = function(entries) {
|
| - this.numPassivelyCapturedEvents_ += entries.length;
|
| + // 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.deleteAllEvents();
|
| +
|
| + this.numPassivelyCapturedEvents_ = entries.length;
|
| for (var i = 0; i < entries.length; ++i) {
|
| var entry = entries[i];
|
| entry.wasPassivelyCaptured = true;
|
| this.receivedLogEntry(entry);
|
| }
|
| +
|
| + // Add back early actively captured events, if any.
|
| + for (var i = 0; i < earlyActivelyCapturedEvents.length; ++i) {
|
| + this.receivedLogEntry(earlyActivelyCapturedEvents[i]);
|
| + }
|
| };
|
|
|
|
|
| @@ -427,12 +439,6 @@
|
| this.pollableDataHelpers_.httpCacheInfo.update(info);
|
| };
|
|
|
| -BrowserBridge.prototype.areLogTypesReady_ = function() {
|
| - return (LogEventType != null &&
|
| - LogEventPhase != null &&
|
| - LogSourceType != null);
|
| -};
|
| -
|
| //------------------------------------------------------------------------------
|
|
|
| /**
|
|
|