OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "net/spdy/hpack/hpack_decoder.h" | 5 #include "net/spdy/hpack/hpack_decoder.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "net/spdy/hpack/hpack_constants.h" | 10 #include "net/spdy/hpack/hpack_constants.h" |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
82 | 82 |
83 // Data in headers_block_buffer_ should have been parsed by | 83 // Data in headers_block_buffer_ should have been parsed by |
84 // HandleControlFrameHeadersData and removed. | 84 // HandleControlFrameHeadersData and removed. |
85 if (headers_block_buffer_.size() > 0) { | 85 if (headers_block_buffer_.size() > 0) { |
86 DVLOG(1) << "headers_block_buffer_.size() should be zero, but is " | 86 DVLOG(1) << "headers_block_buffer_.size() should be zero, but is " |
87 << headers_block_buffer_.size(); | 87 << headers_block_buffer_.size(); |
88 return false; | 88 return false; |
89 } | 89 } |
90 | 90 |
91 if (handler_ != nullptr) { | 91 if (handler_ != nullptr) { |
92 handler_->OnHeaderBlockEnd(total_header_bytes_); | 92 if (FLAGS_chromium_http2_flag_log_compressed_size) { |
| 93 handler_->OnHeaderBlockEnd(total_header_bytes_, total_parsed_bytes_); |
| 94 } else { |
| 95 handler_->OnHeaderBlockEnd(total_header_bytes_); |
| 96 } |
93 } | 97 } |
94 headers_block_buffer_.clear(); | 98 headers_block_buffer_.clear(); |
95 total_parsed_bytes_ = 0; | 99 total_parsed_bytes_ = 0; |
96 header_block_started_ = false; | 100 header_block_started_ = false; |
97 handler_ = nullptr; | 101 handler_ = nullptr; |
98 return true; | 102 return true; |
99 } | 103 } |
100 | 104 |
101 const SpdyHeaderBlock& HpackDecoder::decoded_block() const { | 105 const SpdyHeaderBlock& HpackDecoder::decoded_block() const { |
102 return decoded_block_; | 106 return decoded_block_; |
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
274 *output = StringPiece(*buffer); | 278 *output = StringPiece(*buffer); |
275 return result; | 279 return result; |
276 } | 280 } |
277 if (input_stream->MatchPrefixAndConsume(kStringLiteralIdentityEncoded)) { | 281 if (input_stream->MatchPrefixAndConsume(kStringLiteralIdentityEncoded)) { |
278 return input_stream->DecodeNextIdentityString(output); | 282 return input_stream->DecodeNextIdentityString(output); |
279 } | 283 } |
280 return false; | 284 return false; |
281 } | 285 } |
282 | 286 |
283 } // namespace net | 287 } // namespace net |
OLD | NEW |