Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4435)

Unified Diff: chrome/browser/resources/net_internals/dataview.js

Issue 1994006: Add the requests dumps to the text summary on chrome://net2#data (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 10 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/resources/net_internals/index.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/resources/net_internals/dataview.js
===================================================================
--- chrome/browser/resources/net_internals/dataview.js (revision 46639)
+++ chrome/browser/resources/net_internals/dataview.js (working copy)
@@ -143,17 +143,64 @@
text.push('');
text.push('----------------------------------------------');
- text.push(' URL requests');
+ text.push(' Requests');
text.push('----------------------------------------------');
text.push('');
- // TODO(eroman): Output the per-request events.
- text.push('TODO');
+ this.appendRequestsPrintedAsText_(text);
// Open a new window to display this text.
this.displayPopupWindow_(text.join('\n'));
};
+DataView.prototype.appendRequestsPrintedAsText_ = function(out) {
+ // Concatenate the passively captured events with the actively captured events
+ // into a single array.
+ var allEvents = g_browser.getAllPassivelyCapturedEvents().concat(
+ g_browser.getAllActivelyCapturedEvents());
+
+ // Group the events into buckets by source ID, and buckets by source type.
+ var sourceIds = [];
+ var sourceIdToEventList = {};
+ var sourceTypeToSourceIdList = {}
+
+ for (var i = 0; i < allEvents.length; ++i) {
+ var e = allEvents[i];
+ var eventList = sourceIdToEventList[e.source.id];
+ if (!eventList) {
+ eventList = [];
+ sourceIdToEventList[e.source.id] = eventList;
+
+ // Update sourceIds
+ sourceIds.push(e.source.id);
+
+ // Update the sourceTypeToSourceIdList list.
+ var idList = sourceTypeToSourceIdList[e.source.type];
+ if (!idList) {
+ idList = [];
+ sourceTypeToSourceIdList[e.source.type] = idList;
+ }
+ idList.push(e.source.id);
+ }
+ eventList.push(e);
+ }
+
+
+ // For each source (ordered by when that source was first started).
+ for (var i = 0; i < sourceIds.length; ++i) {
+ var sourceId = sourceIds[i];
+ var eventList = sourceIdToEventList[sourceId];
+ var sourceType = eventList[0].source.type;
+
+ out.push('------------------------------');
+ out.push(getKeyWithValue(LogSourceType, sourceType) +
+ ' (id=' + sourceId + ')');
+ out.push('------------------------------');
+
+ out.push(PrintSourceEntriesAsText(eventList));
+ }
+};
+
/**
* Helper function to open a new window and display |text| in it.
*/
« no previous file with comments | « no previous file | chrome/browser/resources/net_internals/index.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698