Chromium Code Reviews| Index: chrome/browser/resources/net_internals/main.js |
| =================================================================== |
| --- chrome/browser/resources/net_internals/main.js (revision 66783) |
| +++ 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 a race condition, it is possible to receive actively captured log |
|
eroman
2010/11/30 01:43:37
nit: I suggest adding "known" or "expected" so thi
mmenke
2010/11/30 18:59:04
Done.
|
| + // entries before the passively logged entries are received. |
| + // |
| + // When that happens, we create a copy the actively logged entries, delete all |
| + // entries, and after handling all the passively logged entries, add back the |
| + // 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 in 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); |
| -}; |
| - |
| //------------------------------------------------------------------------------ |
| /** |