summaryrefslogtreecommitdiffstats
path: root/chrome/browser/resources
diff options
context:
space:
mode:
authoreroman@chromium.org <eroman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-05-27 19:37:45 +0000
committereroman@chromium.org <eroman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-05-27 19:37:45 +0000
commitbd0b63f1af2fbc06fa383c1fea20673a2498227f (patch)
treee60af8646a74cd49c8d4a897cad77e5947efb817 /chrome/browser/resources
parenta8cb0a251f89f1cf68c35801ecf4dded1cde50e0 (diff)
downloadchromium_src-bd0b63f1af2fbc06fa383c1fea20673a2498227f.zip
chromium_src-bd0b63f1af2fbc06fa383c1fea20673a2498227f.tar.gz
chromium_src-bd0b63f1af2fbc06fa383c1fea20673a2498227f.tar.bz2
net-internals: Display a "(P)" beside entries which were passively logged. This should help reduce confusion when reading logs that have a mixture of passive and actively captured events (since there may have been some loss of information along the boundaries).
Review URL: http://codereview.chromium.org/2094020 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@48420 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/resources')
-rw-r--r--chrome/browser/resources/net_internals/logviewpainter.js8
-rw-r--r--chrome/browser/resources/net_internals/main.js13
2 files changed, 14 insertions, 7 deletions
diff --git a/chrome/browser/resources/net_internals/logviewpainter.js b/chrome/browser/resources/net_internals/logviewpainter.js
index b66d7c9..a6fc93e 100644
--- a/chrome/browser/resources/net_internals/logviewpainter.js
+++ b/chrome/browser/resources/net_internals/logviewpainter.js
@@ -43,7 +43,9 @@ function canCollapseBeginWithEnd(beginEntry) {
!beginEntry.orig.params &&
beginEntry.end &&
beginEntry.end.index == beginEntry.index + 1 &&
- !beginEntry.end.orig.params;
+ !beginEntry.end.orig.params &&
+ beginEntry.orig.wasPassivelyCaptured ==
+ beginEntry.end.orig.wasPassivelyCaptured;
}
PrintSourceEntriesAsText = function(sourceEntries) {
@@ -60,6 +62,9 @@ PrintSourceEntriesAsText = function(sourceEntries) {
tablePrinter.addRow();
+ // Annotate this entry with "(P)" if it was passively captured.
+ tablePrinter.addCell(entry.orig.wasPassivelyCaptured ? '(P) ' : '');
+
tablePrinter.addCell('t=');
var tCell = tablePrinter.addCell(
g_browser.convertTimeTicksToDate(entry.orig.time).getTime());
@@ -95,6 +100,7 @@ PrintSourceEntriesAsText = function(sourceEntries) {
for (var j = 0; j < extraParamsTextLines.length; ++j) {
tablePrinter.addRow();
+ tablePrinter.addCell(''); // Empty passive annotation.
tablePrinter.addCell(''); // No t=.
tablePrinter.addCell('');
tablePrinter.addCell(' ');
diff --git a/chrome/browser/resources/net_internals/main.js b/chrome/browser/resources/net_internals/main.js
index 545608e..368ebf3 100644
--- a/chrome/browser/resources/net_internals/main.js
+++ b/chrome/browser/resources/net_internals/main.js
@@ -198,11 +198,9 @@ BrowserBridge.prototype.sendGetHttpCacheInfo = function() {
// Messages received from the browser
//------------------------------------------------------------------------------
-BrowserBridge.prototype.receivedLogEntry = function(logEntry,
- wasCapturedPassively) {
- if (!wasCapturedPassively) {
+BrowserBridge.prototype.receivedLogEntry = function(logEntry) {
+ if (!logEntry.wasPassivelyCaptured)
this.activelyCapturedEvents_.push(logEntry);
- }
for (var i = 0; i < this.logObservers_.length; ++i)
this.logObservers_[i].onLogEntryAdded(logEntry);
};
@@ -254,8 +252,11 @@ function(hostResolverCache) {
BrowserBridge.prototype.receivedPassiveLogEntries = function(entries) {
this.passivelyCapturedEvents_ =
this.passivelyCapturedEvents_.concat(entries);
- for (var i = 0; i < entries.length; ++i)
- this.receivedLogEntry(entries[i], true);
+ for (var i = 0; i < entries.length; ++i) {
+ var entry = entries[i];
+ entry.wasPassivelyCaptured = true;
+ this.receivedLogEntry(entry);
+ }
};