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

Unified Diff: net/spdy/spdy_headers_block_parser.cc

Issue 2367973002: Log compressed size of HTTP/2 requests. (Closed)
Patch Set: Created 4 years, 3 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
« no previous file with comments | « net/spdy/spdy_flags.cc ('k') | net/spdy/spdy_headers_block_parser_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/spdy/spdy_headers_block_parser.cc
diff --git a/net/spdy/spdy_headers_block_parser.cc b/net/spdy/spdy_headers_block_parser.cc
index d5f03413a18a3300a589ee4cbed43f50fedfd4f9..6eb16fbe4389079cb846358b263d2f11da619258 100644
--- a/net/spdy/spdy_headers_block_parser.cc
+++ b/net/spdy/spdy_headers_block_parser.cc
@@ -6,6 +6,7 @@
#include "base/sys_byteorder.h"
#include "net/spdy/spdy_bug_tracker.h"
+#include "net/spdy/spdy_flags.h"
namespace net {
namespace {
@@ -113,7 +114,16 @@ bool SpdyHeadersBlockParser::HandleControlFrameHeadersData(
next_state = READING_KEY_LEN;
} else {
next_state = READING_HEADER_BLOCK_LEN;
- handler_->OnHeaderBlockEnd(total_bytes_received_);
+ if (FLAGS_chromium_http2_flag_log_compressed_size) {
+ // We reach here in two cases: 1) Spdy3 or 2) HTTP/2 without hpack
+ // encoding. For the first case, we just log the uncompressed size
+ // since we are going to deprecate Spdy3 soon. For the second case,
+ // the compressed size is the same as the uncompressed size.
+ handler_->OnHeaderBlockEnd(total_bytes_received_,
+ total_bytes_received_);
+ } else {
+ handler_->OnHeaderBlockEnd(total_bytes_received_);
+ }
stream_id_ = kInvalidStreamId;
// Expect to have consumed all buffer.
if (reader.Available() != 0) {
« no previous file with comments | « net/spdy/spdy_flags.cc ('k') | net/spdy/spdy_headers_block_parser_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698