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

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

Issue 10870080: Add SPDY request headers to DevTools. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: sync Created 8 years, 4 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
Index: chrome/browser/resources/net_internals/log_view_painter.js
===================================================================
--- chrome/browser/resources/net_internals/log_view_painter.js (revision 154235)
+++ chrome/browser/resources/net_internals/log_view_painter.js (working copy)
@@ -442,12 +442,20 @@
* If |entry| has headers, returns a copy of |entry| with all cookie and
* unencrypted login text removed. Otherwise, returns original |entry| object.
* This is needed so that JSON log dumps can be made without affecting the
- * source data.
+ * source data. Also, if the input entry's headers are an object, the resulting
+ * object will have its headers in a list.
*/
stripCookiesAndLoginInfo = function(entry) {
- if (!entry.params || !entry.params.headers ||
- !(entry.params.headers instanceof Array)) {
+ if (!entry.params || !entry.params.headers)
return entry;
+ var headers = entry.params.headers;
+ if (!(headers instanceof Object) && !(headers instanceof Array))
+ return;
+
+ if (headers instanceof Object) {
+ headers = [];
+ for (var key in entry.params.headers)
+ headers.push(key + ': ' + entry.params.headers[key]);
}
// Duplicate the top level object, and |entry.params|. All other fields are
@@ -456,7 +464,7 @@
entry = shallowCloneObject(entry);
entry.params = shallowCloneObject(entry.params);
- entry.params.headers = entry.params.headers.map(stripCookieOrLoginInfo);
+ entry.params.headers = headers.map(stripCookieOrLoginInfo);
return entry;
}

Powered by Google App Engine
This is Rietveld 408576698