|
|
Created:
8 years, 4 months ago by pauljensen Modified:
8 years, 4 months ago CC:
chromium-reviews, cbentzel+watch_chromium.org, eroman, darin-cc_chromium.org Base URL:
svn://svn.chromium.org/chrome/trunk/src Visibility:
Public. |
DescriptionLog SPDY request headers in URL_REQUEST events in net-internals.
BUG=135203
TEST=
Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=149482
Patch Set 1 #
Total comments: 1
Patch Set 2 : Remove unneeded line break #
Total comments: 4
Patch Set 3 : Switch from const reference to const pointer passing to logging callback #
Messages
Total messages: 21 (0 generated)
Please review this little CL to log SPDY request headers in URL_REQUEST events in net-internals. The goal is to make it easier to understand URL_REQUEST events that use the SPDY protocol, especially when things like redirections occur. URL_REQUEST events that use the HTTP protocol already include the request headers in the URL_REQUEST log. The idea being that its much easier to read through the URL_REQUEST than to go digging into the HTTP_STREAM_JOB and then into the SPDY_SESSION event log to find the request headers. This addresses crbug.com/135203
I should mention that one potential improvement to this CL would be to share about 7 lines of code between NetLogAddressListCallback and NetLogSpdySynCallback and my new NetLogSpdySendRequestCallback function. I'm not sure this is worth the added complexity.
Driveby comment: You're also going to want to modify getParamaterWriterForEventType in chrome/browser/resources/net_internals/log_view_painter.js to format the headers like they are for HTTP requests. You'll either need to use "writeParamsForRequestHeaders" and modify it to work when there's no "line" parameter, or make a similar function that handles that case. Change should be straight forward - just note that "getParamaterWriterForEventType" is returning a function.
lgtm http://codereview.chromium.org/10824115/diff/1/net/spdy/spdy_http_stream.cc File net/spdy/spdy_http_stream.cc (right): http://codereview.chromium.org/10824115/diff/1/net/spdy/spdy_http_stream.cc#n... net/spdy/spdy_http_stream.cc:224: *headers)); nit: no need for line break
Removing myself. Raman, can you review the SPDY change?
lgtm
Nevermind - I was wrong. We have code that displays lists named "headers" correctly. LGTM.
On 2012/07/31 19:20:21, Matt Menke wrote: > Nevermind - I was wrong. We have code that displays lists named "headers" > correctly. LGTM. spdy_session.cc's NetLogSpdySynCallback is also logging the SpdyHeaderBlock.
On 2012/07/31 19:38:32, ramant wrote: > On 2012/07/31 19:20:21, Matt Menke wrote: > > Nevermind - I was wrong. We have code that displays lists named "headers" > > correctly. LGTM. > > spdy_session.cc's NetLogSpdySynCallback is also logging the SpdyHeaderBlock. Right, but for HTTP, we have code that formats the ListValue based on net log event code. I incorrectly assumed the same was true in all cases.
http://codereview.chromium.org/10824115/diff/4002/net/spdy/spdy_http_stream.cc File net/spdy/spdy_http_stream.cc (right): http://codereview.chromium.org/10824115/diff/4002/net/spdy/spdy_http_stream.c... net/spdy/spdy_http_stream.cc:33: Value* NetLogSpdySendRequestCallback(const SpdyHeaderBlock& headers, IMPORTANT: Define this parameter as a |const SpdyHeaderBlock*|. The issue has to do with how base::Bind() works -- if it is defined as a const reference, base::Bind() infrastructure will create a copy of the header block which is undesirable for our logging purposes.
http://codereview.chromium.org/10824115/diff/4002/net/spdy/spdy_http_stream.cc File net/spdy/spdy_http_stream.cc (right): http://codereview.chromium.org/10824115/diff/4002/net/spdy/spdy_http_stream.c... net/spdy/spdy_http_stream.cc:34: NetLog::LogLevel /* log_level */) { nit: +1 to eroman's comments. Was wondering why we didn't pass const SpdyHeaderBlock* headers as it was done in NetLogSpdySynCallback.
lgtm
On 2012/07/31 21:22:30, ramant wrote: > lgtm Thanks for changing it to const SpdyHeaderBlock*.
lgtm
http://codereview.chromium.org/10824115/diff/4002/net/spdy/spdy_http_stream.cc File net/spdy/spdy_http_stream.cc (right): http://codereview.chromium.org/10824115/diff/4002/net/spdy/spdy_http_stream.c... net/spdy/spdy_http_stream.cc:33: Value* NetLogSpdySendRequestCallback(const SpdyHeaderBlock& headers, On 2012/07/31 19:45:39, eroman wrote: > IMPORTANT: Define this parameter as a |const SpdyHeaderBlock*|. The issue has to > do with how base::Bind() works -- if it is defined as a const reference, > base::Bind() infrastructure will create a copy of the header block which is > undesirable for our logging purposes. I believe that the same can be accomplished with base::ConstRef (defined in bind_helpers.h). It implies that the argument must outlive the callback, which is the case here, and might be more readable (style-compliant) than passing a pointer.
http://codereview.chromium.org/10824115/diff/4002/net/spdy/spdy_http_stream.cc File net/spdy/spdy_http_stream.cc (right): http://codereview.chromium.org/10824115/diff/4002/net/spdy/spdy_http_stream.c... net/spdy/spdy_http_stream.cc:33: Value* NetLogSpdySendRequestCallback(const SpdyHeaderBlock& headers, On 2012/07/31 22:49:34, szym wrote: > On 2012/07/31 19:45:39, eroman wrote: > > IMPORTANT: Define this parameter as a |const SpdyHeaderBlock*|. The issue has > to > > do with how base::Bind() works -- if it is defined as a const reference, > > base::Bind() infrastructure will create a copy of the header block which is > > undesirable for our logging purposes. > > I believe that the same can be accomplished with base::ConstRef (defined in > bind_helpers.h). It implies that the argument must outlive the callback, which > is the case here, and might be more readable (style-compliant) than passing a > pointer. Thanks for the info szym, I didn't know about that!
I switched to using base::ConstRef(*headers).
On 2012/08/01 14:52:00, pauljensen wrote: > I switched to using base::ConstRef(*headers). Sorry to be a bother, please don't forget to upload your changes. thanks.
Sorry, I did upload the changes but then after talking with szym I realized every other logging call back just used const* so it would be confusing to break the style in just one place. So I deleted the change list before lunch. I'm just going to go with the const* CL. Switching everything to ConstRef can be brought up as a separate issue so it can be done as a whole.
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/pauljensen@chromium.org/10824115/10001
Change committed as 149482 |