Chromium Code Reviews| 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..70ac233724ce25fdcc05f3987ac71a9451f576ad 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, |
| + NetLog::LogLevel /* log_level */) { |
| + 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,10 @@ 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)); |
|
szym
2012/07/31 17:59:26
nit: no need for line break
|
| stream_->set_spdy_headers(headers.Pass()); |
| stream_->SetRequestTime(request_time); |