Index: net/spdy/spdy_http_stream.cc |
diff --git a/net/spdy/spdy_http_stream.cc b/net/spdy/spdy_http_stream.cc |
index 1f79e6413b7813ccd6e63317950ae61b6f70e196..a807b3aefb51e3b8bd5c568efdbec9ee1b505ab1 100644 |
--- a/net/spdy/spdy_http_stream.cc |
+++ b/net/spdy/spdy_http_stream.cc |
@@ -12,9 +12,12 @@ |
#include "base/bind_helpers.h" |
#include "base/logging.h" |
#include "base/message_loop.h" |
+#include "base/stringprintf.h" |
+#include "base/values.h" |
#include "net/base/address_list.h" |
#include "net/base/host_port_pair.h" |
#include "net/base/load_flags.h" |
+#include "net/base/net_log.h" |
#include "net/base/net_util.h" |
#include "net/http/http_request_headers.h" |
#include "net/http/http_request_info.h" |
@@ -25,6 +28,23 @@ |
namespace net { |
+namespace { |
+ |
+Value* NetLogSpdySendRequestCallback(const SpdyHeaderBlock& headers, |
eroman
2012/07/31 19:45:39
IMPORTANT: Define this parameter as a |const SpdyH
szym
2012/07/31 22:49:34
I believe that the same can be accomplished with b
eroman
2012/08/01 00:20:29
Thanks for the info szym, I didn't know about that
|
+ NetLog::LogLevel /* log_level */) { |
ramant (doing other things)
2012/07/31 19:48:57
nit: +1 to eroman's comments. Was wondering why we
|
+ DictionaryValue* dict = new DictionaryValue(); |
+ ListValue* headers_list = new ListValue(); |
+ for (SpdyHeaderBlock::const_iterator it = headers.begin(); |
+ it != headers.end(); ++it) { |
+ headers_list->Append(new StringValue(base::StringPrintf( |
+ "%s: %s", it->first.c_str(), it->second.c_str()))); |
+ } |
+ dict->Set("headers", headers_list); |
+ return dict; |
+} |
+ |
+} // namespace |
+ |
SpdyHttpStream::SpdyHttpStream(SpdySession* spdy_session, |
bool direct) |
: ALLOW_THIS_IN_INITIALIZER_LIST(weak_factory_(this)), |
@@ -198,6 +218,9 @@ int SpdyHttpStream::SendRequest(const HttpRequestHeaders& request_headers, |
CreateSpdyHeadersFromHttpRequest(*request_info_, request_headers, |
headers.get(), stream_->GetProtocolVersion(), |
direct_); |
+ stream_->net_log().AddEvent( |
+ NetLog::TYPE_HTTP_TRANSACTION_SPDY_SEND_REQUEST_HEADERS, |
+ base::Bind(&NetLogSpdySendRequestCallback, *headers)); |
stream_->set_spdy_headers(headers.Pass()); |
stream_->SetRequestTime(request_time); |