Chromium Code Reviews| Index: net/spdy/hpack/hpack_decoder.cc |
| diff --git a/net/spdy/hpack/hpack_decoder.cc b/net/spdy/hpack/hpack_decoder.cc |
| index 575a5c19b715a25d0989b9048e808b137da3231c..27827b94c7a979ebc626775a80a8484b9f8110af 100644 |
| --- a/net/spdy/hpack/hpack_decoder.cc |
| +++ b/net/spdy/hpack/hpack_decoder.cc |
| @@ -7,6 +7,7 @@ |
| #include <utility> |
| #include "base/logging.h" |
| +#include "base/trace_event/memory_usage_estimator.h" |
| #include "net/spdy/hpack/hpack_constants.h" |
| #include "net/spdy/hpack/hpack_entry.h" |
| #include "net/spdy/spdy_flags.h" |
| @@ -116,6 +117,14 @@ void HpackDecoder::set_max_decode_buffer_size_bytes( |
| max_decode_buffer_size_bytes_ = max_decode_buffer_size_bytes; |
| } |
| +size_t HpackDecoder::EstimateMemoryUsage() const { |
| + return header_table_.size() + |
|
DmitrySkiba
2017/02/06 18:02:34
HpackHeaderTable has EMU now, so this should be EM
xunjieli
2017/02/08 15:42:50
Done.
|
| + base::trace_event::EstimateMemoryUsage(headers_block_buffer_) + |
| + base::trace_event::EstimateMemoryUsage(decoded_block_) + |
| + base::trace_event::EstimateMemoryUsage(key_buffer_) + |
| + base::trace_event::EstimateMemoryUsage(value_buffer_); |
| +} |
| + |
| bool HpackDecoder::HandleHeaderRepresentation(StringPiece name, |
| StringPiece value) { |
| size_updates_allowed_ = false; |