diff options
author | rch@chromium.org <rch@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-01-07 11:20:03 +0000 |
---|---|---|
committer | rch@chromium.org <rch@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-01-07 11:20:03 +0000 |
commit | 47f9573c7dbe25764c58c00637efc80e57629ae4 (patch) | |
tree | 092407db7c2431f7928fc324d58c17913141afce /net | |
parent | 27511c9f0c852cf4846707d22615da6362e0672e (diff) | |
download | chromium_src-47f9573c7dbe25764c58c00637efc80e57629ae4.zip chromium_src-47f9573c7dbe25764c58c00637efc80e57629ae4.tar.gz chromium_src-47f9573c7dbe25764c58c00637efc80e57629ae4.tar.bz2 |
Log the QUIC priority when sending requests.
Review URL: https://codereview.chromium.org/125333002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@243259 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net')
-rw-r--r-- | net/base/net_log_event_type_list.h | 8 | ||||
-rw-r--r-- | net/quic/quic_http_stream.cc | 6 | ||||
-rw-r--r-- | net/quic/quic_http_utils.cc | 10 | ||||
-rw-r--r-- | net/quic/quic_http_utils.h | 9 |
4 files changed, 30 insertions, 3 deletions
diff --git a/net/base/net_log_event_type_list.h b/net/base/net_log_event_type_list.h index ca43b1b..7ebe01c 100644 --- a/net/base/net_log_event_type_list.h +++ b/net/base/net_log_event_type_list.h @@ -989,6 +989,14 @@ EVENT_TYPE(HTTP_TRANSACTION_SEND_REQUEST_BODY) // } EVENT_TYPE(HTTP_TRANSACTION_SPDY_SEND_REQUEST_HEADERS) +// This event is sent for a HTTP request over a SPDY stream. +// The following parameters are attached: +// { +// "headers": <The list of header:value pairs>, +// "quic_priority": <Integer representing the priority of this request>, +// } +EVENT_TYPE(HTTP_TRANSACTION_QUIC_SEND_REQUEST_HEADERS) + // Measures the time to read HTTP response headers from the server. EVENT_TYPE(HTTP_TRANSACTION_READ_HEADERS) diff --git a/net/quic/quic_http_stream.cc b/net/quic/quic_http_stream.cc index 00ff773..b8141bb 100644 --- a/net/quic/quic_http_stream.cc +++ b/net/quic/quic_http_stream.cc @@ -419,12 +419,12 @@ int QuicHttpStream::DoSendHeaders() { } // Log the actual request with the URL Request's net log. stream_net_log_.AddEvent( - NetLog::TYPE_HTTP_TRANSACTION_SPDY_SEND_REQUEST_HEADERS, - base::Bind(&SpdyHeaderBlockNetLogCallback, &request_headers_)); + NetLog::TYPE_HTTP_TRANSACTION_QUIC_SEND_REQUEST_HEADERS, + base::Bind(&QuicRequestNetLogCallback, &request_headers_, priority_)); // Also log to the QuicSession's net log. stream_->net_log().AddEvent( NetLog::TYPE_QUIC_HTTP_STREAM_SEND_REQUEST_HEADERS, - base::Bind(&SpdyHeaderBlockNetLogCallback, &request_headers_)); + base::Bind(&QuicRequestNetLogCallback, &request_headers_, priority_)); bool has_upload_data = request_body_stream_ != NULL; diff --git a/net/quic/quic_http_utils.cc b/net/quic/quic_http_utils.cc index 173403d..853b078 100644 --- a/net/quic/quic_http_utils.cc +++ b/net/quic/quic_http_utils.cc @@ -20,4 +20,14 @@ NET_EXPORT_PRIVATE RequestPriority ConvertQuicPriorityToRequestPriority( IDLE : static_cast<RequestPriority>(HIGHEST - priority); } +base::Value* QuicRequestNetLogCallback( + const SpdyHeaderBlock* headers, + QuicPriority priority, + NetLog::LogLevel log_level) { + base::DictionaryValue* dict = static_cast<base::DictionaryValue*>( + SpdyHeaderBlockNetLogCallback(headers, log_level)); + dict->SetInteger("quic_priority", static_cast<int>(priority)); + return dict; +} + } // namespace net diff --git a/net/quic/quic_http_utils.h b/net/quic/quic_http_utils.h index c7e031a..a62b9ef 100644 --- a/net/quic/quic_http_utils.h +++ b/net/quic/quic_http_utils.h @@ -5,9 +5,11 @@ #ifndef NET_QUIC_QUIC_HTTP_UTILS_H_ #define NET_QUIC_QUIC_HTTP_UTILS_H_ +#include "base/values.h" #include "net/base/net_export.h" #include "net/base/request_priority.h" #include "net/quic/quic_protocol.h" +#include "net/spdy/spdy_header_block.h" namespace net { @@ -17,6 +19,13 @@ NET_EXPORT_PRIVATE QuicPriority ConvertRequestPriorityToQuicPriority( NET_EXPORT_PRIVATE RequestPriority ConvertQuicPriorityToRequestPriority( QuicPriority priority); +// Converts a SpdyHeaderBlock and priority into NetLog event parameters. Caller +// takes ownership of returned value. +NET_EXPORT base::Value* QuicRequestNetLogCallback( + const SpdyHeaderBlock* headers, + QuicPriority priority, + NetLog::LogLevel log_level); + } // namespace net #endif // NET_QUIC_QUIC_HTTP_UTILS_H_ |